summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authormdankov <mdankov@ffa7fe5e-494d-0410-b361-a75ebd5db220>2015-03-31 18:18:46 +0000
committermdankov <mdankov@ffa7fe5e-494d-0410-b361-a75ebd5db220>2015-03-31 18:18:46 +0000
commit0d32c3896946018de52a02e4b2d4df41a0f36175 (patch)
tree5d236f30beaa6816d8c1b3f8024199e327b38b6d /contrib
parent8a00dbc9fe202689614b8a44f5266d27c6b61358 (diff)
downloadnavit-svn-0d32c3896946018de52a02e4b2d4df41a0f36175.tar.gz
Add:port_android:Script to update predefined map sizes in NavitMapDownloader.java
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@6039 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/android-update-map-sizes.pl41
1 files changed, 41 insertions, 0 deletions
diff --git a/contrib/android-update-map-sizes.pl b/contrib/android-update-map-sizes.pl
new file mode 100755
index 00000000..ca0f41d8
--- /dev/null
+++ b/contrib/android-update-map-sizes.pl
@@ -0,0 +1,41 @@
+#!/usr/bin/perl
+# Navit, a modular navigation system.
+# Copyright (C) 2005-2008 Navit Team
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# version 2 as published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the
+# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301, USA.
+
+
+print STDERR "NavitMapDownloader.java map sizes update script.\n";
+print STDERR "Please feed me NavitMapDownloader.java on stdin, get the updated file on stdout.\n";
+
+while(<>){
+ if(/^(.*new osm_map_values\(.*)"([\-0-9\.]+)"\s*,\s*"([\-0-9\.]+)"\s*,\s*"([\-0-9\.]+)"\s*,\s*"([\-0-9\.]+)"\s*,\s*([0-9L]+)\s*,\s*([0-9L]+.*\).*$)/i) {
+ $prefix=qq($1 "$2", "$3", "$4", "$5",);
+ $suffix=$7;
+ $size="==err==";
+ $curline="$_";
+ do{
+ print STDERR $curline;
+ open IN, "curl --head -L http://maps.navit-project.org/api/map/?bbox=$2,$3,$4,$5|";
+ while(<IN>) {
+ $size="$1L" if(/^Content-Length:\s*(\d+)/)
+ }
+ close IN;
+ } while($size eq "==err==");
+ print "$prefix $size, $suffix\n";
+ } else {
+ print "$_";
+ }
+}