Nevron Forum

Map simplification

https://www.nevron.com/Forum/Topic4060.aspx

By Kevin Harrison - Friday, August 27, 2010

The help file gives the following simplification example:

NPolygonShape polygonShape = (NPolygonShape)shape;
NPointFList simplifiedPointList = NPointFList.Simplify(polygonShape.Points, 3);
polygonShape.Points = simplifiedPointList.ToArray();
 
Can I use this to simplify an existing shape file as I read it in?  I tried putting this code in the OnPolygonCreated and OnMultiPolygonCreated callbacks, but I suspect it is too late by then.  Additionally how do I decide what to use as the tolerance parameter?  3 is no good for my map because it is far too large.  Is there a simple algorithm I can apply to determine the best tolerance parameter?
 
Thanks
 
Kevin
By Nevron Support - Monday, August 30, 2010

Hi,

you can apply the simplification whenever you want. It is a generic algorithm that is not closely related to maps, it just simplifies polygon shapes, so you can apply it at any time. There's no an algorithm for selecting a tolerance parameter, because it depends on you map's data and the goals of your project, so our advice is to experiment until you are pleased with the results.

Note that for now the simplification acts on polygons only, so it is recommended to use it only on single shapes that are not connected to others such as islands or continents shoreline.

By Kevin Harrison - Tuesday, August 31, 2010

Hi

What I am trying to do is load a very complex map (of Canada), but simplify it as I load it.  Currently, the speed for zooming and panning is completely unusable.  Can I simplify the map as I load it?  If not, please can you suggest a way to achieve this.

Thanks

Kevin

By Nevron Support - Tuesday, August 31, 2010

Hi,

currently there's no way to simplify the map while loading it. If you need a simpler map, we recommend you use a simpler shape file. There is a huge amount of them over the Internet, so you can easily find a smaller one.