on opensuse 13.1 i try to do some gis-works with a large file: france-latest.osm.bz2 which i gathered from here: [url]http://download.geofabrik.de/europe.html[/url] what do i do with that file france-latest.osm.bz2
what is aimed? i want to extract all things that belong to the POI restaurant which is long lat name adress etc - etx. i have the following things up and running: package perl-XML-Twig and run xml_split with a command available on openSUSE to split xml files named xml_split (it is part of the package perl-XML-Twig) Now we try to run the following command (I hope we have enough hard disk space since the output is roughly 20GB).
this will result in a bunch of 100 Mb large xml files france-001.xml,france-002.xml and so on. Weu then have the xslt (the name of the root element) and of course we will need a loop in the bash to process the several files and collect all the results together.
question: what do i need to get all the aimed data out of the dataset - i.e. long lat name adress etc - etx. here below we have a data-chunk out of the xml-file that we have parsed: see it
well - how to get all the data out of the above mentioned file with the xslt-processing asked 11 Apr '14, 11:38 say_hello_to... |
I wouldn't get hung up on the fact that OSM data's in XML format. As @SK53 suggested above, there are lots of existing OSM tools for extracting data (most of which have had questions asked about before here). I'd extract (an initially small) geographical area using osmosis, then look at using osmfilter to extract the data (possibly having used osmconvert to convert the data into a format that osmfilter can understand). Also perhaps consider osmium. answered 12 Apr '14, 15:56 SomeoneElse ♦ many many thanks for all your ideas - i will add all those packages on opensuse 13.1 .- hopefully i will get them installed - either via commandline or yast
(12 Apr '14, 21:07)
say_hello_to...
|
Are you aware that bzcat and bz2 file name extension is a hint to a compressed osm file? You have to uncompress it in the very right way, so I would NOT recommend to use anything like a pipe in your console prompt. Instead of downloading france.osm.bz2 ... try the osm.pbf file ... it is a kind of binary format. Then you should get familiar with the tools calles osmconvert and osmfilter ... see the OSM wiki how to use them. and before processing the whole France, I recommend to try some tests before with a smaller country extract or a region extract available also via geofabrik.de With osmconvert you can produce a CSV file from raw OSM data, to load in a database or spreadsheet programm. Success? answered 11 Apr '14, 12:12 stephan75 hello dear stephan many many thanks - i will follow your advices and will do as you recommend. i try to work on a smaller country-extract or region - guess that geofabrik has some. love to do some conversions to csv - or to load into a db-or spreadsheet
(12 Apr '14, 13:37)
say_hello_to...
btw - if i have a big big file such as the one of germany - should i separate it into pieces using xml-split!?
(12 Apr '14, 13:39)
say_hello_to...
|
btw - i also installed osmfilter: see here http://wiki.openstreetmap.org/wiki/Osmfilter
i am not sure if it succeedet or failed!? answered 12 Apr '14, 21:43 say_hello_to... |
I would NOT recommend using xslt to extract data from OSM XML files. It's just a lot more work and more complicated than using some of the available OSM tools.
hello dear sk53 many many thanks - i will follow your advices and will do as you recommend. btw - if i have a big big file such as the one of germany - should i separate it into pieces using xml-split!?
Personally, I'd use osmosis to extract data from within a large downloaded .osm or osm.pbf file
See also this forum question which seems to be related (and has a bit more info).