PolygonHandler could be more tolerant
-------------------------------------
Key: GEOT-3205
URL: http://jira.codehaus.org/browse/GEOT-3205
Project: GeoTools
Issue Type: Improvement
Affects Versions: 2.6.1
Environment: All
Reporter: Eric Engle
Attachments: PolygonHandler.diff
The shapefile geometry parsing takes some steps to handle geometries that are
not entirely valid -- like a polygon with just one hole. The included patch
extends this tolerance in two ways.
First, if the type of the geometry is a polygon, we know the last point should
equal the first, but if for some reason the last closing point was omitted, we
add it instead of failing. This is a fairly common error in USGS shapefiles of
Mars for some reason and seems safe enough to correct.
Second, if the polygon vertices are backward, the PolygonHandler would fail
even in the case where there was only one component to the shape. It seems safe
to accept single-part polygons regardless of the order vertices are in, so the
patch reverses them automatically in that case.
I would love to see this improvement in a future Geotools release, so please
let me know if there is anything I can do to improve the patch.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel