From c02ea76fcf5b57c826689bf60c9aa89e4e02037c Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Sat, 25 Jan 2014 21:19:19 +0100 Subject: Use builtin cURL (not wget), and tidy option handling. --- localosmpath2geojson | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'localosmpath2geojson') diff --git a/localosmpath2geojson b/localosmpath2geojson index ded5391..6ff317b 100755 --- a/localosmpath2geojson +++ b/localosmpath2geojson @@ -16,7 +16,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . # -# Depends: wget gdal-bin perl-modules +# Depends: gdal-bin perl-modules set -eu @@ -27,14 +27,14 @@ onlineosmxml2geojson() { echo '[' first=yes for feature in "$@"; do + url="http://www.openstreetmap.org/api/0.6/relation/$feature/full" [ -n "$first" ] || echo ',' - wget -O- http://www.openstreetmap.org/api/0.6/relation/$feature/full \ - | ogr2ogr --config OSM_USE_CUSTOM_INDEXING NO -f GeoJSON /vsistdout/ /vsistdin/ multilinestrings + ogr2ogr --config OSM_USE_CUSTOM_INDEXING NO -f GeoJSON /vsistdout/ /vsicurl_streaming/"$url" multilinestrings first= done echo ']' } -onlineosmxml2geojson "$@" \ +onlineosmxml2geojson $features \ | json_pp -json_opt pretty,canonical \ | perl -0 -pe 's/ /\t/g; s/},\s*{/}, {/g; s/\[\s*([\d.,]+)\s*([\d.]+)\s*\]/[$1 $2]/g' -- cgit v1.2.3