NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

I am trying to write up a MATLAB function to go to a user specified location on Opens Street Maps and return the OSM file using websave(). This works but the OSM I receive is nothing more than the xml and osm version and box bounds. How do I download the nodes and tags as if I were on Open Street's site?

The URL I'm using is this: https://api.openstreetmap.org/api/0.6/map?bbox=11.54,48.14,11.543,48.145

Update: What I'm attempting to do is simply execute the "Export" function that OpenStreetMap's website has but from MATLAB. The OSM files I download do not appear to have any nodes as shown below:

<?xml version="1.0" encoding="UTF-8"?>
<osm version="0.6" generator="CGImap 0.6.1 (1926 thorn-01.openstreetmap.org)" copyright="OpenStreetMap and contributors" attribution="http://www.openstreetmap.org/copyright" license="http://opendatacommons.org/licenses/odbl/1-0/">
 <bounds minlat="48.1398000" minlon="11.5402000" maxlat="48.1402000" maxlon="11.5402000"/>
</osm>

Thanks.

asked 14 Dec '18, 16:42

jholland4134's gravatar image

jholland4134
26224
accept rate: 0%

edited 19 Dec '18, 07:03

aseerel4c26's gravatar image

aseerel4c26 ♦
32.6k18248554


I notice that the min and max longitude above are the same.

permanent link

answered 15 Dec '18, 19:04

nevw's gravatar image

nevw
9.8k2690178
accept rate: 9%

1

Thanks to nevw, I rechecked my code and noticed that I failed to expand my bounds. The rest appears to be fine.

(18 Dec '18, 22:47) jholland4134

meta: @jholland4132: Please could you mark an answer as accepted if your problem is solved now?

(19 Dec '18, 07:05) aseerel4c26 ♦

That URL is returning an OpenStreetMap XML file(6MB), and it includes nodes.. You can read information on the XML format of OSM. It's possible that Matlab just doesn't (automatically) understand what kind of XML it is, and how to process it.

If you're interested in only reading the data from OpenStreetMap, you might want to take a look at the Overpass API. This has several features so you can query specific data in the area, or get different file formats returned.

permanent link

answered 14 Dec '18, 18:55

LivingWithDragons's gravatar image

LivingWithDr...
5244616
accept rate: 4%

Thank you for the assistance.

(15 Dec '18, 15:21) jholland4134

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×315
×3

question asked: 14 Dec '18, 16:42

question was seen: 2,382 times

last updated: 19 Dec '18, 07:05

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum