OpenStreetMap Forum

The Free Wiki World Map

You are not logged in.

#1 2018-11-22 22:52:16

osmnoob
Member
Registered: 2018-11-22
Posts: 2

osmfilter and convert create empty osm files

Hello My objective is to create a csv file of all the shops in graz located in the country of austria.

Since I don't have enough space to unzip the austria osm file so I used bzcat to unzip from the terminal.

i used the graz.poly file to help me filter the shops in graz.

this is how my command with pipes looks like.

bzcat 2018-austia-latest.osm.bz2 | osmconvert - -B=Graz.poly -o=mys.osm | ./osmfilter mys.osm --keep= --nodes="shops=" -o=graz_shops.osm | ./osmconvert graz_shops.osm --all-to-nodes --csv="@id @lon @lat name" -o=grazshops.csv

however when i enter this in the terminal

I get osmfilter error: file empty: graz_shops.osm osmconvert error: file empty: mys.osm

can anyone tell me what I am doing wrong? thank you in advance

Offline

#2 2018-11-23 17:31:18

GerdP
Member
Registered: 2015-12-18
Posts: 864

Re: osmfilter and convert create empty osm files

I think osmfilter cannot read from a pipe, besides that you tell osmcomvert to write the output to file mys.osm.
Not sure what you need on *nix to execute osmfilter after osmconvert, is it & instead of | ?

You should also use mys.o5m instead, it is much faster and neds less space.

Last edited by GerdP (2018-11-23 17:34:36)

Offline

#3 2018-11-23 20:16:46

osmnoob
Member
Registered: 2018-11-22
Posts: 2

Re: osmfilter and convert create empty osm files

i asked our tutor from university and he said we can only use osm files and then we have to convert it to csv.

this time i unzipped the osm file and used this command

osmfilter 2018-austria-latest.osm --keep= --keep-nodes="shops=graz" -o=grazshops.osm |osmconvert - -B=Graz.poly -o=grazshops.osm |osmconvert - --all-to-nodes --csv="@id @lon @lat name" -o=grazshops.csv

i still get empty files

we have to use unix command line to complete this task.
no matter how much I try i always get empty files.
really don't know how to solve this

Offline

#4 2018-11-23 20:25:16

mmd
Member
Registered: 2010-11-06
Posts: 1,771

Re: osmfilter and convert create empty osm files

"shops=graz" doesn't seem right. There's probably no OSM object with key "shop" and value "graz".

You can use the following query in overpass turbo to validate your results: https://overpass-turbo.eu/s/DWu

Offline

Board footer

Powered by FluxBB