New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
allow to export notes through osm.org #427
Comments
actually, it would be also very nice to be able to get gpx of an individual note. as an example, right now i'm interested in 3 diagonal notes in the middle of an area where getting a bbox would throw 8 or so other notes at me. if this can't be handled in the same issue, i'd be glad to create a new one :) |
You can already do both these things! Try: and |
hmm, i might be missing something here... but how can i get to such a url from osm.org interface ? |
I never said you could - it's an API so is normally exposed in documentation rather than directly. That's not to say we couldn't add those links, though I'm not sure how you would choose which of the four supported formats to offer, or where you would actually put the links. All I was saying is that the technology already exists. |
link for downloading the visible notes could be in 'export' section; the main idea is to make notes easy to work on by mappers who actually want to go out and verify them :) |
i wanted to go and check several notes "on the ground" yesterday, but i was in a hurry, so getting them on my gps was too cumbersome... which reminded me about this issue ;) a) placement - for individual notes, let's place a link in the note popup itself, at the top of it - somewhere where the permalink icon is currently b) 4 different formats refer to XML, RSS, json or GPX (as per the api docs) there's another issue of the gps output being pretty bad, but i'll create a new issue about that soon ;) edit : it's #457 about gpx output containing css and other useless info |
Here is a rudimentary patch, which adds a drop-down list into the 'Export' site. Now you can select between different formats, OSM XML being the default as before, additionally Notes in the four supported formats. This also has the beneficial side effect that now one knows that OSM XML data will be exported. This wasn't clear to me before pressing the Export button to start the download. I don't have the time and surely am lacking some web development skills to bring it forward in the near future, but maybe it is a starting point for someone else. diff --git a/app/controllers/export_controller.rb b/app/controllers/export_controller.rb
index bd020f2..ee9f8d3 100644
--- a/app/controllers/export_controller.rb
+++ b/app/controllers/export_controller.rb
@@ -13,6 +13,22 @@ class ExportController < ApplicationController
# redirect to API map get
redirect_to "http://api.openstreetmap.org/api/#{API_VERSION}/map?bbox=#{bbox}"
+ elsif format == "notes_rss"
+ # redirect to API notes get
+ redirect_to "http://api.openstreetmap.org/api/#{API_VERSION}/notes.rss?bbox=#{bbox}&limit=10000"
+
+ elsif format == "notes_xml"
+ # redirect to API notes get
+ redirect_to "http://api.openstreetmap.org/api/#{API_VERSION}/notes.xml?bbox=#{bbox}&limit=10000"
+
+ elsif format == "notes_json"
+ # redirect to API notes get
+ redirect_to "http://api.openstreetmap.org/api/#{API_VERSION}/notes.json?bbox=#{bbox}&limit=10000"
+
+ elsif format == "notes_gpx"
+ # redirect to API notes get
+ redirect_to "http://api.openstreetmap.org/api/#{API_VERSION}/notes.gpx?bbox=#{bbox}&limit=10000"
+
elsif format == "mapnik"
# redirect to a special 'export' cgi script
format = params[:mapnik_format]
diff --git a/app/views/site/export.html.erb b/app/views/site/export.html.erb
index 6bf3365..68ef08e 100644
--- a/app/views/site/export.html.erb
+++ b/app/views/site/export.html.erb
@@ -6,7 +6,6 @@
</h2>
<%= form_tag({:controller => "export", :action => "finish"}, :class => "export_form") do %>
- <%= hidden_field_tag 'format', 'osm' %>
<div class='export_area_inputs'>
<div class='export_boxy' style="border: 1px solid #ccc;">
@@ -29,6 +28,17 @@
</p>
</div>
+ <div>
+ <label for="format">Data type:</label>
+ <select id="format" name="format">
+ <option value="osm">Map data (OSM XML)</option>
+ <option value="notes_rss">Notes (RSS)</option>
+ <option value="notes_xml">Notes (XML)</option>
+ <option value="notes_json">Notes (JSON)</option>
+ <option value="notes_gpx">Notes (GPX)</option>
+ </select>
+ </div>
+
<div id="export_commit">
<div class="export_button">
<%= submit_tag t('export.start.export_button') %> |
I really don't see this as a good approach - export is, and has been for many years, for exporting maps and I don't think we should overload it with other things. |
Sorry, didn't realise this was an existing ticket. Have reopened it now. |
Given that we have two check boxes for "Map Notes" and "Map Data" in the "Layers" side bar directly among each other, I don't see why the similarity between these two kinds of raw data should not be picked up on the "Export" site. |
fwiw I quite like the suggested modification. It adds zero extra clicks to existing workflows, but makes notes data available for point-and-click users, and as marcows points out it gives a visual clue about what it is you'll be downloading. |
To be honest I had forgotten that panel was only for data export now - given that it probably does make more sense. @marcows - if you want to propose a change it's better to open a proper PR and reference this issue than to paste the patch into this ticket. |
I deliberately did not because I didn't plan to continue working on it and wanted to avoid having an unfinished pull request floating around. But maybe it actually is better even in this case, so I will probably catch up on this at home. |
notes have a great potential to collect feedback from 'normal users', but that works if somebody actually works on them.
right now, placing notes on a portable device involves an api download, which is not convenient and not even within the reach of many mappers.
it would be great if osm.org would allow to export currently visible notes as a gpx (for an upload to a gps device, for example) - this could be in the export tab or whatever, as long as it is a simple click-result operation
The text was updated successfully, but these errors were encountered: