JasonSanford / leaflet-vector-layers

A little help to viewing ArcGIS Server, Geocommons, Arc2Earth, CartoDB, GIS Cloud, etc. vector data in a Leaflet map
http://jasonsanford.github.io/leaflet-vector-layers
BSD 2-Clause "Simplified" License
216 stars 61 forks source link

ST_AsGeoJSON precision option #38

Closed bmcbride closed 11 years ago

bmcbride commented 11 years ago

Hey Jason,

PostGIS sets a default decimal precision of 15 for the ST_AsGeoJSON function: http://www.postgis.org/docs/ST_AsGeoJSON.html. Would it make sense to set a "geomPrecision" option for the providers that utilize PostGIS to reduce the file transfer size? I've tested with bumping it down to 6 without any noticeable difference in geometry and a smaller file size. This should improve performance. If you agree, I can put together a pull request.

BRYAN

JasonSanford commented 11 years ago

Yep. Lets leave no precision by default but allow it to be passed in.

Sent from a mobile device

On Feb 27, 2013, at 2:59 PM, Bryan McBride notifications@github.com wrote:

Hey Jason,

PostGIS sets a default decimal precision of 15 for the ST_AsGeoJSON function: http://www.postgis.org/docs/ST_AsGeoJSON.html. Would it make sense to set a "geomPrecision" option for the providers that utilize PostGIS to reduce the file transfer size? I've tested with bumping it down to 6 without any noticeable difference in geometry and a smaller file size. This should improve performance. If you agree, I can put together a pull request.

BRYAN

— Reply to this email directly or view it on GitHub.