This project is read-only.

Maximum String Size for Shape.CreateFromString

Feb 2, 2012 at 8:20 PM


I'm writing a MapWindow 4.8.6 plugin to query spatial data from SQL Server 2008, convert the results to a shapfile, and display in MapWindow.  The spatial column from SQL Server 2008 is first converted to Well Known Text and then to a SerializedString for use in the MapWinGIS "Shape.CreateFromString" method.

Everything works fine until I try querying very complex shapes that result in long Serialized Strings.  In particular, when the Serialized String exceeds 600,000 or so (specifically 624,842 in my example), MapWindow crashes completely (no error message or anything; it just disappears).

My questions are: Is there a maximum string size that Shape.CreateFromString can work with and if so, is there any work-around for this limitation?

Feb 10, 2012 at 12:12 AM

I figured this out.  The large string size was coincidental.  The real problem was that geometries that were failing were not valid, even though they looked fine in the original shapefile, they had rings that were in the wrong orientation.