Rendering .shp file with ITiledProvider

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

Rendering .shp file with ITiledProvider

Post by KasperD »

Hello all,

One of our customers who's experimenting with rendering .shp files in the .NET Mapcontrol (and is also the customer from issue http://xserver.ptvgroup.com/forum/viewt ... f=14&t=383 ) has the following issue:

The customer used the example from the .NET Mapcontrol documentation "Show a Shape File Content - Using a tiled provider" to display a custom .shp file in the map. However, the areas were drawn at different (wrong locations), so the customer began to troubleshoot by copying the code and needed sources and resources into a blank project.
His findings:

- When using the SharpMap and ProjNet dll from 'our' xServer .NET directory, all is well and the areas are drawn correctly
- However, the customer uses NuGet to obtain the correct packages, and this is also his preferred method. When adding the SharpMap package, the problem appears. To get it working again, the customer had to change some 'using' statements; apparently this has changed in the newer version of the SharpMap package. See the 16.patch file; - has been removed, + has been added. (This is a patch file for Mercurial in which you can see the differences between 'our' DLL's and the DLL's from NuGet, mostly "using" statements).

What stands out is that the customer has to use both GeoAPI.CoordinateSystems.Transformations and ProjNet.CoordinateSystems.Transformations to be able to compile the project again. He thinks this is why the coordinate transformations go wrong.

Customer is using Visual Studio 2012. I've combined all the needed files into this download link: https://ptvbox.ptvgroup.com/index.php/s/FNCyX9NlLK86jwg

Could you have a look and see what might be causing the coordinate shift when using NuGet?
Thanks in advance,
f.gailfuß
Posts: 8
Joined: Fri Sep 16, 2016 8:02 am

Re: Rendering .shp file with ITiledProvider

Post by f.gailfuß »

Frank Gailfuß
PTV GROUP Germany
f.gailfuß
Posts: 8
Joined: Fri Sep 16, 2016 8:02 am

Re: Rendering .shp file with ITiledProvider

Post by f.gailfuß »

SharpMap 1.1 requires some additional references and uses GeoAPI.Geometries.Envolope instead of SharpMap.Geometries.BoundingBox to express rectangles and bounding boxes. The latter change is crucial as ShapMap changes the order of the coordinates in some places - once that is fixed, the demo initially attached to http://xserver.ptvgroup.com/forum/viewt ... f=14&t=383 runs well with SharpMap 1.1 and your logicx.shp Shapefile. Please find an updated demo attached. We'll check if we incorporate SharpMap 1.1 into DemoCenter with the next release.
Attachments
ShapeDemo.rar
Shape Demo based on SharpMap 1.1
(3.27 MiB) Downloaded 412 times
Frank Gailfuß
PTV GROUP Germany
KasperD
Posts: 14
Joined: Tue Jun 17, 2014 8:15 am

Re: Rendering .shp file with ITiledProvider

Post by KasperD »

Frank,

Thanks for the reply and the research work. I'll forward the information to the customer.
Post Reply