socrata/geospace — pull request #31 by urmilan (2014-11-18 00:39:02+00:00)
Title: Override bad default precision when using Geotools GeoJSON

By default, Geotools GeoJSON writer truncates any coordinates to 4 decimal places. We use the Geotools GeoJSON writer to generate the upsert payload for putting shapefiles into Soda Server, and many shapefiles are specifying coordinates with 10 or more decimal places, so we lose a bunch of precision during ingest.

An insidious thing about this bug is that when the shape coordinates are truncated, we are actually making them invalid in some cases, because now some polygons will no longer be a closed shape, or intersect themselves. Geospace validation doesn't catch this, because the validation step occurs before the ingestion step. The shapes get ingested in an invalid form and then we can't call any interesting geo functions on them (eg. concave/convex hull) because those functions will fail when they encounter any invalid shapes.

Other notes:
- I picked 16 as the precision override because that is the most precise I have encountered in any shapefiles so far.
- Next step is to check whether we need a fix for this in soql-reference too.