Why not ask your question on the new OpenStreetMap Community Forum?


I'm implementing a webpage that embedded an openstreetmap map. I want to let the user select an area and export it to osm file from my webpage. Is this feasible ??

asked 11 Feb '14, 20:23

Nour%20K's gravatar image

Nour K
accept rate: 0%

edited 12 Feb '14, 01:05

aseerel4c26's gravatar image

aseerel4c26 ♦

Likely it is. You just need to extract the bounding box of the selection and then pass it to the OSM API (please, this way only if you have a low traffic, private webpage and it only works for small areas).

It may be useful to know which map library you are using (e.g. OpenLayers or Leaflet) or if you do not care. Probably the selection part is the harder part of your idea.

For OpenLayers this FAQ entry might help. You might also want to have a look at www.osm.org which does such a selection (uses Leaflet).

permanent link

answered 12 Feb '14, 01:09

aseerel4c26's gravatar image

aseerel4c26 ♦
accept rate: 18%

edited 12 Feb '14, 13:48

So it is feasible!! Thanks a lot. That's true the selection is the harder part. I'm using OpenLayers as my map library. I have succeed to embed the openstreetmap map into my webpage but I don't have any idea yet on how to implement the selection of an area from this map and the extraction of the bounding box of the selected area.

(12 Feb '14, 11:13) Nour K

I would suggest to make the pure "rectangular selection in OpenLayers by user" (for example by a box drawn by the user's mouse) question a new question as it is not specific to your export thing afterwards. And, maybe an OpenLayers forum (instead of this help site) would be more useful as it is not specific to OSM anymore. However, many OpenLayers questions are on this help site despite that.

(12 Feb '14, 13:47) aseerel4c26 ♦
Your answer
toggle preview

Follow this question

By Email:

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



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:


question asked: 11 Feb '14, 20:23

question was seen: 5,294 times

last updated: 12 Feb '14, 13:48

powered by OSQA