From 0be56b7b0827cc74d98566b1e6c39e52abf20dd6 Mon Sep 17 00:00:00 2001 From: mdankov Date: Tue, 31 Mar 2015 18:18:46 +0000 Subject: 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 --- contrib/android-update-map-sizes.pl | 41 +++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100755 contrib/android-update-map-sizes.pl (limited to 'contrib') diff --git a/contrib/android-update-map-sizes.pl b/contrib/android-update-map-sizes.pl new file mode 100755 index 000000000..ca0f41d85 --- /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() { + $size="$1L" if(/^Content-Length:\s*(\d+)/) + } + close IN; + } while($size eq "==err=="); + print "$prefix $size, $suffix\n"; + } else { + print "$_"; + } +} -- cgit v1.2.1