2

I am able to download osm data with the following url request "http://www.overpass-api.de/api/map?*bbox=7.505549,6.482084,7.511999,6.488254". It is generating a map.osm file, in that some of the roads are extending beyond the bbox limit and not exactly clipped to the bbox.

How do I sort this issue?

4
  • Do you want the way (road) to be included or not included, or do you somehow expect it to be truncated?
    – BradHards
    Nov 11, 2014 at 7:33
  • The XAPI compability layer does not clip ways. It selects the whole ways as they have been stored into OSM database wiki.openstreetmap.org/wiki/Overpass_API/…. With the native Overpass query language you can probably do what you want wiki.openstreetmap.org/wiki/Overpass_API/Language_Guide
    – user30184
    Nov 11, 2014 at 8:18
  • Yes Brad. I want the roads to be truncated at bbox
    – Pugazh
    Nov 11, 2014 at 9:22
  • Then you have to perform some post-processing. This API will only serve raw data without performing any modifications. If the way starts inside the bounding box but ends outside of it, then you will receive it exactly like that.
    – scai
    Nov 11, 2014 at 10:20

1 Answer 1

4

As pointed out in one of the comments above, you get a filtered subset of the "source data" when you use the OverPass API. It isn't going to modify that source data, which is what truncation implies.

I think the best way forward would be to extract the area you wanted, and import it into a tool like QGIS, and use that to truncate the lines (in QGIS, Vector->Geoprocessing Tools -> Clip). Another alternative would be to render the result you want, then use a raster clip, but the intermediate steps may involve working with data you didn't want.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.