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

Hi

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
11113
accept rate: 0%

edited 12 Feb '14, 01:05

aseerel4c26's gravatar image

aseerel4c26 ♦
32.6k18248554


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 ♦
32.6k18248554
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
1

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 ♦

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
×113

question asked: 11 Feb '14, 20:23

question was seen: 5,869 times

last updated: 12 Feb '14, 13:48

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