Hexagon Geospatial
MENU

Developer Discussions

Discuss topics with other Hexagon Geospatial Power Portfolio developers and experts to get the most out of our products.
Showing results for 
Search instead for 
Do you mean 
Reply
Highlighted
Frequent Contributor
Posts: 159
Registered: ‎01-14-2018

Adding query to Legend and Map View giving 0 number of features

[ Edited ]

Hello all Smiley Happy ,

 

I am trying to add an equijoin query for 2 text files to the legend and map view in c# as follows:

 

The equijoin GRecordset is called "_Points_Joined_GRecordset"

The query is called "myQuery_Points"

 

 

//Test how many records are there in _Points_Joined_GRecordset?
int conta = _Points_Joined_GRecordset.RecordCount;
SWF.MessageBox.Show(conta.ToString()); gives 136 records which is true

GDO.GRecordset myQPrs = myQuery_Points.Recordset as GDO.GRecordset;

//LegendEntry
PView.LegendEntry _pointsLegendEntry = new PView.LegendEntry(); _pointsLegendEntry.InputRecordset = myQPrs; GeoMedia.MapWindow mapWindow = this._currentApplication.ActiveWindow as GeoMedia.MapWindow; MapviewLib.GMMapView mapView = mapWindow.MapView as MapviewLib.GMMapView; if (mapView.Legend.LegendEntries.Count == 0)
{
mapView.Legend.LegendEntries.Append(_pointsLegendEntry, null, null);
}
else
{
mapView.Legend.LegendEntries.Append(_pointsLegendEntry, 1, null);
} mapView.Legend.Fit(); mapView.Refresh(true);

When I run this code the join query appear at the legend to have (0) records and nothing appear on the mapview as in the picture

 

0 Records.JPG

 

Also When I try Display it on, the GeoMedia crashes.

 

Best Regards

Khaled

 

Do you need immediate support?
Please submit a Ticket through our
Development Ticket Portal.