I want to use osmconvert to .csv to put certain fields into a csv file and I want to keep the relations. First, I want to run osmfilter to filter data to just street, city, state, lat, long where street, city, and state are all populated for each record. In other words, I don't want a bunch of records with the state populated but not the city and street. I created a parameters file with the following -v -keep= -keep-relations all addr:street!= addr:city!= addr:state!= Then I run osmconvert like below, but I am getting records where the state is just populated. Also, I see records where the just street and city are populated. ./osmconvert planetfile.osm --csv"addr:street addr:city addr:state" --csv-headline -o=filteredfile.csv. I also tried @lat and @long in the above statement to filter lat and long for the street as well, but then it didn't report any streets, cities or states, just lat and long. So, I guess there is two questions? How do I filter the data such that all the fields I need are populated? And how do I tack on lat and long in the convert statement to get it to appear with the addresses in the csv? asked 14 Sep '12, 17:06 JMB5 |
Jochen is right, Osmium is much more fexible if you want to do special data processing. However, what you want to accomplish can be done with osmfilter/osmconvert too. For example:
$ ./osmfilter bremen.o5m --keep="addr:country= and addr:city= and addr:street=" --ignore-dependencies | ./osmconvert - --csv="@oname @id @lon @lat addr:country addr:city addr:street" I am just not sure what you mean with "keeping the relations". If you really want only relations but nothing else, you might want to filter this way: $ ./osmfilter bremen.o5m --keep="" --keep-relations="addr:country= and ... answered 18 Sep '12, 23:52 Marqqs overwhelming - you saved my day: many many thanks for sharing your insights - great!
(22 May '14, 20:26)
say_hello_to...
hi there! could you help out? I am using your osmfilter nodes_hiAgra.osm --keep="addr:street=" --ignore-depemdencies --drop-relations --drop-ways |osmconvert - --csv="@id @lon @lat addr:street " and only got 1 line .... But streets are more in that area What to do? I need only id,lon,lat, street_name
(11 Jun '14, 12:44)
Gevork
|
I am not sure I understand exactly what you want, but if you find that osmconvert doesn't do what you need, you might want to try Osmium, specifically the "osmjs" utility that comes with it. Osmjs can also create CSV files and you can write small Javascript snippets to define exactly what you need, so it is rather flexible. There are examples in the "osmjs" directory in the distribution. answered 16 Sep '12, 07:56 Jochen Topf hello dear jochen many many thanks for sharing your insights - great! you helped me alot
(22 May '14, 20:25)
say_hello_to...
|
many many thanxk you helped me alot