Skip to content

Commit

Permalink
Fix #23925: Indicate/link to alternative download methods when the us…
Browse files Browse the repository at this point in the history
…er attempts to download too much data

git-svn-id: https://josm.openstreetmap.de/svn/trunk@19225 0c6e7542-c601-0410-84e7-c038aed88b3b
  • Loading branch information
taylor.smock committed Sep 18, 2024
1 parent d3364a7 commit dd04b0b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/org/openstreetmap/josm/gui/HelpAwareOptionPane.java
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ public static int showOptionDialog(Component parentComponent, Object msg, String
if (msg instanceof String) {
String msgStr = (String) msg;
content = new HtmlPanel(msgStr.startsWith("<html>") ? msgStr : "<html>" + msgStr + "</html>");
((HtmlPanel) content).enableClickableHyperlinks();
} else {
content = msg;
}
Expand Down
12 changes: 11 additions & 1 deletion src/org/openstreetmap/josm/tools/ExceptionUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
import org.openstreetmap.josm.data.osm.Relation;
import org.openstreetmap.josm.data.osm.Way;
import org.openstreetmap.josm.gui.help.HelpUtil;
import org.openstreetmap.josm.io.ChangesetClosedException;
import org.openstreetmap.josm.io.IllegalDataException;
import org.openstreetmap.josm.io.MissingOAuthAccessTokenException;
Expand Down Expand Up @@ -578,7 +579,16 @@ public static String explainBadRequest(OsmApiException e) {
errorHeader.startsWith("You requested too many nodes"))) {
message += "<br>"
+ tr("The area you tried to download is too big or your request was too large."
+ "<br>Either request a smaller area or use an export file provided by the OSM community.");
+ "<br>Either request a smaller area or use an export file provided by the OSM community."
+ "<br><br>Downloading a smaller area is <em>recommended</em>!"
+ "<br><br>Advanced users can use one of the following options:"
+ "<br><ul>"
+ "<li><a href=\"{0}\">Overpass</a></li>"
+ "<li><a href=\"{1}\">Geofabrik</a></li>"
+ "<li><a href=\"{2}\">OSM Planet File</a></li>"
+ "</ul>", HelpUtil.getHelpTopicUrl("/Help/Action/Download#DownloadfromOverpassAPI"),
"https://www.geofabrik.de/data/download.html",
"https://planet.openstreetmap.org/");
} else if (errorHeader != null) {
message += tr("<br>Error message(untranslated): {0}", errorHeader);
}
Expand Down

0 comments on commit dd04b0b

Please sign in to comment.