This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

how to reduce polygon_geojson co-ordinates

0

Hi to all,

We can get co-ordinates for a region(city/state/country) using polygon_geojson=1 in nominatim url. It will give large amount of data(co-ordinates) for large regions(example for a country). Now i want to reduce the co-ordinates count. How it is possible?

asked 09 Jul '15, 10:15

Rajavelu_M's gravatar image

Rajavelu_M
253454858
accept rate: 33%

Are you asking for an algorithm for simplifying a polygon?

(09 Jul '15, 10:25) scai ♦

@scai: yes. An algorithm for simplifying a polygon is fine. For example http://nominatim.openstreetmap.org/search?q=India&polygon_geojson=1&format=json The above url gives 1.5MB data. I want to reduce co-ordinates and the size to around 200kb.

(09 Jul '15, 10:35) Rajavelu_M
1

gpsbabel can simplify tracks which could be an option depending on what you are trying to do.

(09 Jul '15, 11:41) scai ♦

... or try JOSM offline editor (not sure whether it can load geojson, but it has a simplify feature for lines)... or maybe QGIS?

(10 Jul '15, 20:25) stephan75

One Answer:

1

I was trying to do the same and found that using param polygon_threshold=0.009 is usefull

answered 26 Feb '19, 15:09

shaniqwa's gravatar image

shaniqwa
16
accept rate: 0%

Source code available on GitHub .