I am running a LayerMapping on a set of ShapeFiles acquired from a County 
GIS Department. I've done a quite a bit of this, and this is the first time 
I"ve seen such an issue. As LayerMapping is proceeding through the file 
saving model instances, it encounters one that it can't handle:

"GDAL_ERROR 1: b'Geometry of polygon of fid 5572 cannot be translated to 
Simple Geometry. All polygons will be contained in a multipolygon.'"
"GDAL_ERROR 1: b'organizePolygons() received an unexpected geometry. 
 Either a polygon with interior rings, or a polygon with less than 4 
points, or a non-Polygon geometry.  Return arguments as a collection.'"
"GEOS_ERROR: IllegalArgumentException: Invalid number of points in 
LinearRing found 3 - must be 0 or >= 4"
"Failed to save the feature (id: 5572) into the model with the keyword 
arguments:"
And the final Exception:
"GEOSException: Error encountered checking Geometry returned from GEOS C 
function "GEOSWKTReader_read_r"."

The best description of the issue I can find is 
https://github.com/r-spatial/sf/issues/1589. In this help thread, and a 
related one, they talk about a utility called "MakeValid" to resolve this 
LinearRing issue.

It appears I need to either add a point to any of these "LinearRing" 
instances, or somehow otherwise fix these items.

I'm not sure that sending the ShapeFiles back to the County to "fix" would 
be productive.

Does anyone have anything to contribute as far as how I might best move 
forward with this set of ShapeFiles?

Is there another forum where I should be addressing this issue? Need more 
information?

Thanks!

Steve Watts

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/82fe8d9e-e83a-4e6c-bde1-1665ddd45670n%40googlegroups.com.

Reply via email to