diff options
Diffstat (limited to 'localosmpath2geojson')
-rwxr-xr-x | localosmpath2geojson | 8 |
1 files changed, 4 insertions, 4 deletions
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 <http://www.gnu.org/licenses/>. # -# 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' |