[openstreetmap-website] Announce Overpass API as download mirror (#635)

Roland Olbricht notifications at github.com
Sat Dec 7 09:31:08 UTC 2013


Ok, the following patch
- makes the export alternatives always visible (addressing #606)
- adds an entry for Overpass API with an adapting bounding box
- adds a hint to explain that the export button may fail (to avoid further questions of the topic "Export failed" on help.osm.org)

```
>From 81aae81eaa5e128cd0dad76f144a903a6f615409 Mon Sep 17 00:00:00 2001
From: Roland Olbricht <roland.olbricht at gmx.de>
Date: Sat, 7 Dec 2013 10:24:25 +0100
Subject: [PATCH] Made download alternatives always visible and added Overpass
 API as option.

---
 app/assets/javascripts/index/export.js |    5 ++++-
 app/views/site/export.html.erb         |   36 +++++++++++++++++++-------------
 config/locales/en.yml                  |    4 ++++
 3 files changed, 30 insertions(+), 15 deletions(-)

diff --git a/app/assets/javascripts/index/export.js b/app/assets/javascripts/index/export.js
index 053f516..544af70 100644
--- a/app/assets/javascripts/index/export.js
+++ b/app/assets/javascripts/index/export.js
@@ -41,11 +41,14 @@ OSM.Export = function(map) {
     $("#minlat").val(bounds.getSouth().toFixed(precision));
     $("#maxlon").val(bounds.getEast().toFixed(precision));
     $("#maxlat").val(bounds.getNorth().toFixed(precision));
+
+    document.getElementById("overpass-export").href = "http://overpass-api.de/api/map?bbox="
+        + $("#minlon").val() + "," + $("#minlat").val() + "," + $("#maxlon").val() + "," + $("#maxlat").val();
   }
 
   function validateControls() {
     $("#export_osm_too_large").toggle(getBounds().getSize() > OSM.MAX_REQUEST_AREA);
-    $("#export_commit").toggle(getBounds().getSize() < OSM.MAX_REQUEST_AREA);
+    $("#small_export_view").toggle(getBounds().getSize() < OSM.MAX_REQUEST_AREA);
   }
 
   page.pushstate = page.popstate = function(path) {
diff --git a/app/views/site/export.html.erb b/app/views/site/export.html.erb
index 1765072..6e442a4 100644
--- a/app/views/site/export.html.erb
+++ b/app/views/site/export.html.erb
@@ -27,22 +27,30 @@
     <p class="warning">
       <%= t'export.start.too_large.body' %>
     </p>
-    <dl class="inner12">
-      <dt><a href="http://planet.openstreetmap.org/"><%= t'export.start.too_large.planet.title' %></a></dt>
-      <dd><%= t'export.start.too_large.planet.description' %></dd>
-
-      <dt><a href="http://download.geofabrik.de/"><%= t'export.start.too_large.geofabrik.title' %></a></dt>
-      <dd><%= t'export.start.too_large.geofabrik.description' %></dd>
-
-      <dt><a href="http://metro.teczno.com/"><%= t'export.start.too_large.metro.title' %></a></dt>
-      <dd><%= t'export.start.too_large.metro.description' %></dd>
-
-      <dt><a href="http://wiki.openstreetmap.org/wiki/Download"><%= t'export.start.too_large.other.title' %></a></dt>
-      <dd><%= t'export.start.too_large.other.description' %></dd>
-    </dl>
   </div>
 
-  <div class="export_button">
+  <div class="export_button" id="small_export_view">
     <%= submit_tag t('export.start.export_button'), :id => "export_commit" %>
+
+    <br/><br/><strong><%= t'export.start.too_large.advice' %></strong>
   </div>
+  
+  <dl class="inner12">  
+    <dt><a id="overpass-export" href="http://overpass-api.de/api/map?bbox="><%= t'export.start.too_large.overpass.title' %></a></dt>
+    <dd><%= t'export.start.too_large.overpass.description' %></dd>
+    
+    <dt><a href="http://planet.openstreetmap.org/"><%= t'export.start.too_large.planet.title' %></a></dt>
+    <dd><%= t'export.start.too_large.planet.description' %></dd>
+
+    <dt><a href="http://download.geofabrik.de/"><%= t'export.start.too_large.geofabrik.title' %></a></dt>
+    <dd><%= t'export.start.too_large.geofabrik.description' %></dd>
+
+    <dt><a href="http://metro.teczno.com/"><%= t'export.start.too_large.metro.title' %></a></dt>
+    <dd><%= t'export.start.too_large.metro.description' %></dd>
+
+    <dt><a href="http://wiki.openstreetmap.org/wiki/Download"><%= t'export.start.too_large.other.title' %></a></dt>
+    <dd><%= t'export.start.too_large.other.description' %></dd>
+    </dl>
+  <br/>
+
 <% end %>
diff --git a/config/locales/en.yml b/config/locales/en.yml
index a1c4e50..3a07188 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -311,10 +311,14 @@ en:
       licence: "Licence"
       export_details: 'OpenStreetMap data is licensed under the <a href="http://opendatacommons.org/licenses/odbl/1.0/">Open Data Commons Open Database License</a> (ODbL).'
       too_large:
+        advice: "If the above export fails, please consider one of these alternatives:"
         body: "This area is too large to be exported as OpenStreetMap XML Data. Please zoom in or select a smaller area, or use one of the sources listed below for bulk data downloads."
         planet:
           title: "Planet OSM"
           description: "Regularly-updated copies of the complete OpenStreetMap database"
+        overpass:
+          title: "This bounding box from Overpass API mirror"
+          description: "Download this bounding box from an OSM data mirror server"
         geofabrik:
           title: "Geofabrik Downloads"
           description: "Regularly-updated extracts of continents, countries, and selected cities"
-- 
1.7.9.5
```

---
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/issues/635#issuecomment-30051346
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20131207/bf13a0a0/attachment-0001.html>


More information about the rails-dev mailing list