POI download problem

Hi there,

Some help needed for a total newbie. I’m trying to download a list of Points of Interest/POIs (most specifically food venues: restaurants, supermarkets…) from a UK county.

So hey presto, this is what I’ve done:

  1. I’ve gone to the API website (info here: http://www.overpass-api.de/query_form.html - http://wiki.openstreetmap.org/wiki/Overpass_API))
  2. Then using a query I’ve downloaded a bound box covering the area I’m interested in (not the county itself, but a box defined by max.&min lat and max&min longitude of the county).
  3. Result: a file (~160 Mbytes), that is supposed to contain all the data from that area (food venues, and all the rest: road, streets, etc).

Since the file POIs are to be processed by another application (ArcGIS), I’ve exported the file I’ve got from the API to different formats (KML, CSV…). Apparently KML format, my favorite, doesn’t work and gives errors (in Google Earth & ArcGIS). Not sure whether this is caused by the source file, or by the conversion…

So I’m really in doubt on whether I’ve made the right decision and file is correct. Can anyone help on these questions:

• Is Openstreet API the right way to go for getting POIs for the UK? Any other free data source? Any other suggestions?
• Is there a way to get the POIs from a county (apart from the bounding box) (Y/N)?
• Do I get ALL the POIs in the Openstreetmap when downloading from the API? I’m askign this 'cause when you open the file, number of certain POIs (say, pubs) is not huge (roughly, 100 for this county), whereas when I go to Openstreet map the details and number of pubs seems to be higher. Shouldn’t both match precisely?

Any other simple alternative ways to deal with this also appreciated.

Thanks in advance, A.

An alternative way would be:

Thanks, sounds like a good alternative (if the original one doesn’t work!).

Yet when I say I’m a newbie, I really mean it: I take Osmosis does that (get apolygon POIs). But the resulting file is in what format?

My concern is that I get something similar to previous try (which was good enough), but then it doesn’t allow conversion (or the conversion gives an error…).

Not sure on whether people here converts files all the time from *%$ format (I guess .OSM) to more popular ones (like .KML or the similar) or not.

THNX

Another option is to use GDAL http://gdal.org/ogr/drv_osm.html

This is how you can do it on Windows and write out POIs directly into shapefile.

Acquire development version of GDAL from http://www.gisinternals.com/sdk/
Select a suitable version, for example for 32-bit Windows
http://www.gisinternals.com/sdk/PackageList.aspx?file=release-1600-gdal-mapserver.zip
Download and unzip, let’s say into c:\gdal_dev
Open Windows command window, go to c:\gdal_dev and run sdkshell.bat

Now search file osmconf.ini from c:\gdal_dev\bin\gdal-data and open it with text editor.
Edit the point layer section so that the key list in parameter “attributes” contains “amenity”
and save the file. Here is an example of an edited section

[points]

common attributes

osm_id=yes
osm_version=no
osm_timestamp=no
osm_uid=no
osm_user=no
osm_changeset=no

keys to report as OGR fields

attributes=name,amenity,fee

keys that, alone, are not significant enough to report a node as a OGR point

unsignificant=created_by,converted_by,source,time,ele

keys that should NOT be reported in the “other_tags” field

ignore=created_by,converted_by,source,time,ele,note,openGeoDB:,fixme,FIXME

uncomment to avoid creation of “other_tags” field

other_tags=no

Next dowload some OSM data in .pbf format from http://download.geofabrik.de/osm/
Finally convert as

ogr2ogr -f “ESRI Shapefile” toilets.shp osmfile.osm.pbf -sql “select * from points where amenity=‘toilets’”

What happens here is

  • output is directed into shapefile “toilets.shp”
  • input file is “osmfile.osm.pbf”
  • OpenStreetMap POIs with tag “amenity=toilets” get selected

Ogr2ogr command is easy to adjust for selecting something else. Just take care that osmdonf.ini includes all the tags which are used in the SQL query and what you want to get into the resulting dataset. Output can be any format that GDAL/OGR supports for writing, including KML http://gdal.org/ogr/ogr_formats.html. All the projections are supported too, and everything works in a similar way on Linux and Mac.

Thanks, sounds tricky but promising. I’ll probably try this Monday.

Not necessarily aimed at you, but I’m still in doubt on:

  1. whether what you download from http://www.overpass-api.de/query_form.html
    (which I immagine is the same as geofabrik) is the same as the ‘normal’ Openstreetmap.org map

  2. Which format is that in? If I look at my file, it’s got no extension (one would say it must be .OSM, a variant of XML, but not sure really…).

Hi,

You can use OSM data you have downloaded from the overpass-api. I am not sure if the OGR/OSM driver wants to see it with .osm file name extension, but you can try it easily. Actually you do not need to do separate download but GDAL can read data directly from the service. The followind commands should work on Windows

Reading data from XAPI:
ogrinfo -ro -al
/vsicurl_streaming/“http://open.mapquestapi.com/xapi/api/0.6/node[amenity=pub][bbox=-77.041579,38.885851,-77.007247,38.900881]

or from Overpass API:
ogrinfo -ro -al
/vsicurl_streaming/"http://overpass.osm.rambler.ru/cgi/interpreter?data=(node(50.746%2C7.154%2C50.748%2C7.157)%3B<%3B)%3Bout%20meta%3B "

You will need to read a bit about ogrinfo and ogr2ogr tools but it will be worth the trouble.

Hello!
What exactly is the output format you need?