openstreetmap / iD

🆔 The easy-to-use OpenStreetMap editor in JavaScript.

Home Page:https://www.openstreetmap.org/edit?editor=id

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add Object Directly via URL in iD Editor

baditaflorin opened this issue · comments

Description

I would like to request a feature that allows adding a new object directly via a URL in the iD editor. Currently, it is possible to edit existing objects using the following URL formats:

Node: https://www.openstreetmap.org/edit?editor=id&node=node_id
Way: https://www.openstreetmap.org/edit?editor=id&way=way_id
Relation: https://www.openstreetmap.org/edit?editor=id&relation=relation_id

However, there is no way to add a new object directly through a URL. This feature would be beneficial for scenarios where users select from a predefined list of things and then click "Add to Source," which would redirect them to the iD editor with the object ready to be added.

Proposed URL Format:
The proposed URL format to add a new object directly should look like this:

https://www.openstreetmap.org/edit?editor=id#map=18/${lat}/${lon}&add=${encodeURIComponent(JSON.stringify(tags))}

Example Usage:

If a user wants to add an amenity with the tag amenity=drinking_water, the URL should be formatted as:

https://www.openstreetmap.org/edit?editor=id#map=18/40.7128/-74.0060&add=${encodeURIComponent(JSON.stringify({"amenity":"drinking_water"}))}
This URL will open the iD editor centered on the specified latitude and longitude and set it to add a point with the specified tags.

Benefits:

Enhances the usability of the iD editor by allowing direct addition of objects via URL.
Streamlines the process for users to add commonly used amenities and objects.
Reduces the steps needed for users to contribute new data to OpenStreetMap.

Additional Notes:
The implementation should handle the encoding of tag parameters properly to ensure the URL functions correctly.
This feature should support at least nodes and ways.

Thank you for considering this feature request. I believe it will greatly enhance the user experience and efficiency of the iD editor.

Screenshots

No response

Currently users need to do things like this
image

And this keeps us in the realms of pro users, suers that need to know and remember tags, etc.

Instead of allowing us to have simple websites that are focused on specific things (think wheelmap.org / public drinking water places, etc where the user does not care about roads, house nunbers and other things, he wants to know where is the closest place where he can find water, for example,and when he finds a new place, to be able to quickly add it to the map in less than 20 seconds, while also attaching a photo for source if he choose to, lets say

Hey @baditaflorin thank you for sharing your use case. I don't think this is something to be done in iD, TBH.
There are other tools, however, that will get you quite far.

(Context: I am a volunteer that helps with issues in iD)

Thanks @tordans for the answer, MapComplete looks like it was built before I was alive.

MapRoulette and or the RapidID seems like a god wa going.

Interested also if I would fork the iD editor, around where I should start looking to implement a way to do this

You can kinda do this already, but the UX sucks and it only supports a restricted subset of tags (name and 7 other tags).

To use this feature, add &gpx=... to the URL. Here's an example that loads this gpx file.

Since this was too limited for us, we forked the iD/RapiD editor for a very similar use case. You provide a geojson file which specifies the nodes/ways that should be created, edited or deleted. Then iD prompts the user to review each feature in the geojson file. It would be nice if this were built into iD or RapiD one day...