Esri/terraformer-arcgis-parser — pull request #19 by patrickarlt (2014-02-21 05:09:09+00:00)
Title: Strip invalid rings out of polygons on conversion

After spending a pretty good chunk of yesterday trying to get the [NYC Police Precincts](https://data.cityofnewyork.us/Public-Safety/Police-Precincts/78dh-3ptz) imported to a feature service I narrowed the issue down to some of the polygons containing invalid rings.

[GeoJSON](http://geojson.org/geojson-spec.html#linestring) defines a "ring" as

> A LinearRing is closed LineString with 4 or more positions. The first and last positions are equivalent (they represent equivalent points)

While the [ArcGIS JSON format](http://resources.arcgis.com/en/help/arcgis-rest-api/#/Geometry_Objects/02r3000000n1000000/) is relatively undefined about the minimum number of points or the requirement to be closed, ArcGIS feature services reject polygons with fewer then 4 points or unclosed polygons.

It would probably be best not to covert rings with 3 or less points and just ignore them.