Polygon irregularity

Hi i have been working on a project using a shapefile in a server side app
i have developed and i display this map and fill the polygons color representing one of three distinct value ranges. this works well.
when i upload the same shapefile into SQL SERVER table and retrieve the
WKT inside an android java app it displays some unusual line strings i dont see in the map displayed server side.

This is the displayed map in android app, and some polylines are connecting two distinct polys inside the Multipolygon, could it be a parsing error? i have checked the shapes in the shapefile im using and cant see these verticies. Any thoughts appreciated.

Hello @MikeConroy , and welcome.

My first impression (guess) would have to do with invalid geometries, like a polygon not being closed, and so it connects to the next one. I would try validating the geometries, both before and after (by calling Shapefile.HasInvalidShapes) and see if that reveals anything.


Hi Jerry, thanks for the reply, i had checked this shape manually and all looked good, but as suggested i ran the Function for the shapefile and it returned True so all polygons in the original shapefile are ok. Screenshot of original map on the Desktop App side looks good also as shown below.

The shapefile in SQL Server, I have accessed to ensure that the polygons are drawn clean, which they do. I parsed the WKT using my own code and then also referenced the open source rts topology classes to see if the number of geo points retrieved were the same as my original parsing code, and they are different…so ill run the same code using rts class to extract latlang and see if the problem still exists
Thanks Mike

Hi Jerry and all Solved this, turned out some of the shapes had inner holes which caused the problem, i changed the parsing code using jts topology and dislays the shapes clearly thanks

Hello Mike. That’s good news. Thanks for the update.