Skip to content

Commit

Permalink
switch to api.openstreetmap.org
Browse files Browse the repository at this point in the history
  • Loading branch information
eserte committed Oct 12, 2023
1 parent a7b24f2 commit 00f83c1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
7 changes: 3 additions & 4 deletions miscsrc/BBBikeOsmUtil.pm
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ my $ltlnqr = qr{([-+]?\d+(?:\.\d+)?)};
my $osm_download_file_qr = qr{/download_$ltlnqr,$ltlnqr,$ltlnqr,$ltlnqr\.osm(?:\.gz|\.bz2)?$};

use vars qw($OSM_API_URL $OVERPASS_API_URL);
$OSM_API_URL = "http://www.openstreetmap.org/api/0.6";
$OSM_API_URL = "https://api.openstreetmap.org/api/0.6";
#$OVERPASS_API_URL = "http://overpass.osm.rambler.ru/cgi/interpreter"; # feels slower than the .de server (2013-11)
$OVERPASS_API_URL = "http://overpass-api.de/api/interpreter"; # quick, but compresses only sometimes
$OVERPASS_API_URL = "https://overpass-api.de/api/interpreter"; # quick, but compresses only sometimes
#$OVERPASS_API_URL = "http://api.openstreetmap.fr/oapi/interpreter"; # compresses always # was broken in 2015-12 for a couple of days; truncated downloads (2018-02)

use vars qw($MERKAARTOR_MAS_BASE $MERKAARTOR_MAS $ALLICONS_QRC $USE_MERKAARTOR_ICONS %ICON_NAME_TO_PHOTO);
Expand Down Expand Up @@ -1001,8 +1001,7 @@ sub cleanup_photos {

# TODO:
# support for main::show_info to show way xml and history xml:
# GET http://www.openstreetmap.org/api/0.5/way/22495210/history
# GET http://www.openstreetmap.org/api/0.5/way/22495210
# maybe it would be enough to run osmhistory

# Osm Menu in SRTShortcuts should be created here and changed to the
# following layout:
Expand Down
4 changes: 2 additions & 2 deletions miscsrc/bbbike.el
Original file line number Diff line number Diff line change
Expand Up @@ -928,12 +928,12 @@
)

(defun bbbike--get-osm-elem-version-perl (elemtype elemid)
(let* ((url (concat "https://www.openstreetmap.org/api/0.6/" elemtype "/" elemid))
(let* ((url (concat "https://api.openstreetmap.org/api/0.6/" elemtype "/" elemid))
(elemversion (shell-command-to-string (concat bbbike-perl-modern-executable " -MLWP::UserAgent -MXML::LibXML -e 'my $ua = LWP::UserAgent->new(timeout => 10); my $xml = $ua->get(shift)->decoded_content; print XML::LibXML->load_xml(string => $xml)->documentElement->findvalue(q{/osm/" elemtype "/@version})' " url))))
elemversion))

(defun bbbike--get-osm-elem-version-elisp (elemtype elemid)
(let* ((url (format "https://www.openstreetmap.org/api/0.6/%s/%s" elemtype elemid))
(let* ((url (format "https://api.openstreetmap.org/api/0.6/%s/%s" elemtype elemid))
(buffer (url-retrieve-synchronously url))
(content (with-current-buffer buffer
(goto-char (point-min))
Expand Down
2 changes: 1 addition & 1 deletion miscsrc/osm2bbd
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ Please specify one or more osm files. To download an osm file, you can use
the script downloadosm (usually to be found in the same directory as this
script) or raw wget, for example
wget -O filename.osm http://www.openstreetmap.org/api/0.5/map?bbox=x0,y0,x1,y1
wget -O filename.osm https://api.openstreetmap.org/api/0.5/map?bbox=x0,y0,x1,y1
Note that the bbox must not be too large, otherwise you get a 400 bad request
error.
Expand Down

0 comments on commit 00f83c1

Please sign in to comment.