.NET Mapcontrol with custom .shp file

Within this forum we want to offer discussions all around our .NET based Map control including all .Net-language specific questions concerning calls of the xServer-API. Attention: xServer-relevant concepts can be found in further forums such as xRoute or xTour.
Post Reply
KasperD
Posts: 14
Joined: Tue Jun 17, 2014 8:15 am

.NET Mapcontrol with custom .shp file

Post by KasperD »

Hello everbody,

One of our customers who is more experienced with the .NET Mapcontrol (Logicx) is trying to implement a .shp file with specific geographic data into the Mapcontrol for display purposes. The original .shp file works well, however it contains too much information for their use-case and has a negative influence on the zooming/panning speed. Therefore we used QGIS to extract the needed data from this .shp file (4ppc.zip, see attached) into a new custom .shp file (logicx.zip, see attached), sufficient for their use-case.

However, when using the "Show a Shape File Content" from the .NET Mapcontrol Documentation and trying to display the custom "logicx" .shp file, an error message appears (see attached).
the variable sharpMap isn't null, the exception appears when using the GetMap method in the dll.

Can you reproduce this locally, and possibly find out if it has to do with our custom .shp file? Or is there another way to get our custom .shp file working?

thanks in advance,
Attachments
4ppc.zip
(2.17 MiB) Downloaded 274 times
logicx.zip
(112.72 KiB) Downloaded 287 times
logicx error.png
f.gailfuß
Posts: 8
Joined: Fri Sep 16, 2016 8:02 am

Re: .NET Mapcontrol with custom .shp file

Post by f.gailfuß »

I can confirm that SharpMap, the 3rd party component we're using for demoing the Shapefile access, seems to have a problem with your logicx.shp Shapefile. SharpMap fails while running a query against your data ("ExecuteIntersectionQuery"). I cannot tell if this is a problem of SharpMap or the Shapefile itself. You can force rendering by catching SharpMap's exceptions; I can see one area being rendered but I cannot tell if the output is complete (see my sample attached). There's a newer version of SharpMap available. Unfortunately this seems to have a coordinate transformation problem in our context so that this version is currently not an option.

You reported that your initial problem with the full set of data was that it has a negative influence on the zooming/panning speed. As our Shapefile implementation has just been provided for demo purposes, it has room for optimizations. Currently each tile being rendered requires a dedicated SharpMap; thus, Shapefiles are intialized repeatedly with every tile being requested. We tried to optimize this behavior using cached SharpMap instances. Hopefully this allows you to use your initial set of data working around the problem with logicx.shp.

We'll investigate into the problem with the newer SharpMap version separately; not sure if solves your problem and if we can provide a quick solution for that.
Attachments
ShapeDemo.rar
Shapefile demo with optimized SharpMapTiledProvider
(2.9 MiB) Downloaded 277 times
Frank Gailfuß
PTV GROUP Germany
KasperD
Posts: 14
Joined: Tue Jun 17, 2014 8:15 am

Re: .NET Mapcontrol with custom .shp file

Post by KasperD »

Frank,

Thanks for your reply. As the customer only needed 2 specific postal code area's, together with the fact that in the initial implementation rendering the entire .shp file had a negative impact on performance, we've extracted the needed postal code areas using QGIS 2.14
Not sure whether this manual extraction is causing the error messages, but i've checked your project and only part of the 'extracted' shp file is rendered, so it might correlate. When uploading the .shp file into QGIS, the areas needed are drawn correctly; see attached screenshot below. I'll look into extracted the needed postal code data with QGIS again and will use your project to render it.

If you could keep me updated on the problem with the newer SharpMap version that would be great, as that would most likely solve the issue completely.

Edit: i've made a new extract from QGIS and this seems to be working correctly in the project you've send me. I'll send it to the customer and will ask him to test for himself.
Attachments
WGB19 PLAWA.zip
(156.03 KiB) Downloaded 291 times
qgis.png
f.gailfuß
Posts: 8
Joined: Fri Sep 16, 2016 8:02 am

Re: .NET Mapcontrol with custom .shp file

Post by f.gailfuß »

Regarding the newer SharpMap version, please find an answer and updated demo in http://xserver.ptvgroup.com/forum/viewt ... f=14&t=384.
Frank Gailfuß
PTV GROUP Germany
Post Reply