Skip to content
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

Open
richlv opened this issue Aug 6, 2013 · 13 comments
Open

allow to export notes through osm.org #427

richlv opened this issue Aug 6, 2013 · 13 comments

Comments

@richlv
Copy link

richlv commented Aug 6, 2013

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

@richlv
Copy link
Author

richlv commented Aug 6, 2013

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 :)

@richlv
Copy link
Author

richlv commented Aug 6, 2013

hmm, i might be missing something here... but how can i get to such a url from osm.org interface ?
i'm thinking of a "casual mapper" who would like to go to osm.org, see notes and then just drop them off in their gps unit for review

@tomhughes
Copy link
Member

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.

@richlv
Copy link
Author

richlv commented Aug 7, 2013

link for downloading the visible notes could be in 'export' section;
link for downloading individual notes could be in the note popup.

the main idea is to make notes easy to work on by mappers who actually want to go out and verify them :)

@richlv
Copy link
Author

richlv commented Aug 20, 2013

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)
the primary goal is to allow contributors to go out and check on the notes, so gpx should be available in any case. we can also have a dropdown like for the 'edit' "tab", with the default being gpx.

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

@marcows
Copy link
Contributor

marcows commented Jul 28, 2015

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') %>

Before (original):
Export original

After (with selection):
Export with selection

@tomhughes
Copy link
Member

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.

@tomhughes tomhughes reopened this Jul 28, 2015
@tomhughes
Copy link
Member

Sorry, didn't realise this was an existing ticket. Have reopened it now.

@marcows
Copy link
Contributor

marcows commented Jul 28, 2015

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.

@danstowell
Copy link
Contributor

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.

@tomhughes
Copy link
Member

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.

@marcows
Copy link
Contributor

marcows commented Jul 29, 2015

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants