Cartodb: URL import of OSM Overpass API imports only Points

Created on 25 Oct 2016  路  3Comments  路  Source: CartoDB/cartodb

First of all: Great work on #5042 !

I tried this today, using this url: http://overpass-api.de/api/interpreter?data=area%5B%22ISO3166-1%22%3D%22NO%22%5D-%3E.search%3B%0A%28%0A%20%20node%5Bindustrial%3Dbrewery%5D%28area.search%29%3B%0A%20%20node%5Bmicrobrewery%3Dyes%5D%28area.search%29%3B%0A%20%20node%5Bcraft%3Dbrewery%5D%28area.search%29%3B%0A%20%20way%5Bindustrial%3Dbrewery%5D%28area.search%29%3B%0A%20%20way%5Bmicrobrewery%3Dyes%5D%28area.search%29%3B%0A%20%20way%5Bcraft%3Dbrewery%5D%28area.search%29%3B%0A%20%20relation%5Bindustrial%3Dbrewery%5D%28area.search%29%3B%0A%20%20relation%5Bmicrobrewery%3Dyes%5D%28area.search%29%3B%0A%20%20relation%5Bcraft%3Dbrewery%5D%28area.search%29%3B%0A%29%3B%0Aout%20geom%3B

(yes, a rather long query, but it works!)

After some minutes I get four tables:

table_6600800442_lines
table_6600800442_multilinestrings
table_6600800442_multipolygons
table_6600800442_points

Budt, only the table table_6600800442_points has any rows. I know for certain that there are polygons in the data returned from the dataset as well, so I suspect that the Overpass API parser just handles points, is this correct?

Backend bug

Most helpful comment

The problem here is that the query is only exporting the lines/polygons, but it's missing the points that compose them. You can use the recursion operators for that. For example, in @oriolbx example:

http://overpass-api.de/api/interpreter?data=way(50.745,7.17,50.75,7.18);out;

Selects ways in a bounding box and outputs them, but not the points. To fix that, you can use:

http://overpass-api.de/api/interpreter?data=way(50.745,7.17,50.75,7.18);out;>;out;

You first output all the ways in the bounding box. Then, you traverse those relations downwards and output them, thus, outputting the component nodes.

Here is some more information, although the feature is not very well documented.

All 3 comments

@CartoDB/support can you take a look and confirm?

That is happening to me too with a different query to get points, I'm getting an empty table. This is the URL to get the data: http://overpass-api.de/api/interpreter?data=way(50.745,7.17,50.75,7.18);out;

However, if I try this other query with Overpass API I get all the different tables (points, polygons, etc):

http://overpass-api.de/api/interpreter?data=(node(50.745,7.17,50.75,7.18);way(50.745,7.17,50.75,7.18);relation(50.745,7.17,50.75,7.18););out;

This problem seems to be in the OSM Overpass API, what CARTO does is taking all the data of the URL and import it to your account directly (as long as is a supported format).

The problem here is that the query is only exporting the lines/polygons, but it's missing the points that compose them. You can use the recursion operators for that. For example, in @oriolbx example:

http://overpass-api.de/api/interpreter?data=way(50.745,7.17,50.75,7.18);out;

Selects ways in a bounding box and outputs them, but not the points. To fix that, you can use:

http://overpass-api.de/api/interpreter?data=way(50.745,7.17,50.75,7.18);out;>;out;

You first output all the ways in the bounding box. Then, you traverse those relations downwards and output them, thus, outputting the component nodes.

Here is some more information, although the feature is not very well documented.

Was this page helpful?
0 / 5 - 0 ratings