GraphicsOverlay with too many points

1327
5
Jump to solution
11-29-2020 11:37 PM
FatmaAkdemir
Occasional Contributor II

I have a GraphicsOverlay containing the radar image pixel points. I am basically converting points from polar coordinates to geodetic coordinates and adding one point Geometry to my overlay for each point. Points represent the pixels in radar image. This overlay makes the exe too slow and uses excessive memory. How can I make my program be faster so that I can zoom in and out seamlessly? Is there any alternative other than GraphicsOverlay to add pixel points on top of map?

 

void MapViewer::slotDrawOnePixel(GeodeticCoord pos, QColor color){
simpleMarkerSymbol->setColor(color);
QPair<int,int> geodeticPos(pos.mLongitude.Degree()*100, pos.mLatitude.Degree()*100);
if(!mPointMap.contains(geodeticPos)){
Graphic *newPoint = new Graphic(createPoint(pos), simpleMarkerSymbol, this);
mGraphicsOverlay->graphics()->append(newPoint);
mPointMap[geodeticPos] = newPoint;
}
else{
mPointMap[geodeticPos]->setSymbol(simpleMarkerSymbol);
}
}

Geometry MapViewer::createPoint(GeodeticCoord pos)
{
double x = pos.mLongitude.Degree();
double y = pos.mLatitude.Degree();
const SpatialReference spatialRef(4326);
return Point(x, y, spatialRef);
}

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
LukeSmallwood
Esri Contributor

Hi @FatmaAkdemir, we have a few samples that use RasterLayers, for example:

https://github.com/Esri/arcgis-runtime-samples-qt/tree/master/ArcGISRuntimeSDKQt_CppSamples/Layers/R...

https://github.com/Esri/arcgis-runtime-samples-qt/tree/master/ArcGISRuntimeSDKQt_CppSamples/Layers/R...

I think they depend on the original data set being geo-rectified (e.g. in ArcGIS Pro) so I'm not sure you will be able to use that with a QPixmap.  What format is your radar image in?

 

You may be interested in this workflow which uses the ImageOverlay to display data on a scene: https://github.com/Esri/arcgis-runtime-samples-qt/tree/master/ArcGISRuntimeSDKQt_CppSamples/Scenes/A.... Note that this option is currently only available in 3D (scene) views.

View solution in original post

0 Kudos
5 Replies
LukeSmallwood
Esri Contributor

Hi @FatmaAkdemir 

 

One thing you could try is to use a Renderer with your GraphicsOverlay which will use the same symbol for all Graphics - rather than creating a new symbol for each point. This sample shows an example of that workflow. You could use an attribute on the points to choose a different color if required - see this example for that kind of approach.

If rendering individual points is not working well - you could also experiment with creating a raster dataset for your radar points. You can use a number of raster formats with the RasterLayer API.

0 Kudos
FatmaAkdemir
Occasional Contributor II

Hi @LukeSmallwood , Could you give an example about RasterLayer with dataset? Can I draw a QImage or QPixmap with RasterLayer?

0 Kudos
LukeSmallwood
Esri Contributor

Hi @FatmaAkdemir, we have a few samples that use RasterLayers, for example:

https://github.com/Esri/arcgis-runtime-samples-qt/tree/master/ArcGISRuntimeSDKQt_CppSamples/Layers/R...

https://github.com/Esri/arcgis-runtime-samples-qt/tree/master/ArcGISRuntimeSDKQt_CppSamples/Layers/R...

I think they depend on the original data set being geo-rectified (e.g. in ArcGIS Pro) so I'm not sure you will be able to use that with a QPixmap.  What format is your radar image in?

 

You may be interested in this workflow which uses the ImageOverlay to display data on a scene: https://github.com/Esri/arcgis-runtime-samples-qt/tree/master/ArcGISRuntimeSDKQt_CppSamples/Scenes/A.... Note that this option is currently only available in 3D (scene) views.

0 Kudos
FatmaAkdemir
Occasional Contributor II

Hi @LukeSmallwood ,

I have solved my problem by using ImageOverlay, thank you for your help. We are currently trying ArcGIS library to decide whether to buy a commercial license or not. We want to use this library with an offline map. Is it possible to get offline 3D map data after we get a license? The application that is going to use the library won't have an internet connection.

0 Kudos
LukeSmallwood
Esri Contributor

Hi @FatmaAkdemir we do have support for offline data using our MobileScenePackage format which you can author in ArcGIS Pro. You can also build up an offline scene yourself using offline data-sets such as a tile package (.tpk), scene layer package (.slpk).

Here's an example of using a MobileScenePackage: https://github.com/Esri/arcgis-runtime-samples-qt/tree/master/ArcGISRuntimeSDKQt_CppSamples/Scenes/O...

I hope that helps,

Luke 

0 Kudos