Skip Menu |
 

This queue is for tickets about the Algorithm-GooglePolylineEncoding CPAN distribution.

Report information
The Basics
Id: 74303
Status: resolved
Priority: 0/
Queue: Algorithm-GooglePolylineEncoding

People
Owner: Nobody in particular
Requestors: jidanni [...] jidanni.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



From jidanni [...] jidanni.org Tue Jan 24 01: 33:21 2012
CC: srezic [...] cpan.org
MIME-Version: 1.0
X-Spam-Status: No, score=-2 tagged_above=-99.9 required=10 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1] autolearn=ham
X-Spam-Flag: NO
X-Virus-Checked: Checked by ClamAV on 16.mx.develooper.com
Content-Type: multipart/mixed; boundary="=-=-="
Message-ID: <87obtta9uj.fsf [...] jidanni.org>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
X-Spam-Score: -2
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id 52DA9241334 for <cpan-bug+Algorithm-GooglePolylineEncoding [...] hipster.bestpractical.com>; Tue, 24 Jan 2012 01:33:21 -0500 (EST)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7Svlitil+NmF for <cpan-bug+Algorithm-GooglePolylineEncoding [...] hipster.bestpractical.com>; Tue, 24 Jan 2012 01:33:19 -0500 (EST)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id D0E7B240C2D for <bug-Algorithm-GooglePolylineEncoding [...] rt.cpan.org>; Tue, 24 Jan 2012 01:33:18 -0500 (EST)
Received: (qmail 17432 invoked by uid 103); 24 Jan 2012 06:33:18 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 24 Jan 2012 06:33:18 -0000
Received: from caiajhbdcbbj.dreamhost.com (HELO homiemail-a4.g.dreamhost.com) (208.97.132.119) by 16.mx.develooper.com (qpsmtpd/0.80/v0.80-19-gf52d165) with ESMTP; Mon, 23 Jan 2012 22:33:15 -0800
Received: from homiemail-a4.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a4.g.dreamhost.com (Postfix) with ESMTP id CBF3F51C073; Mon, 23 Jan 2012 22:33:12 -0800 (PST)
Received: from jidanni.org (218-163-21-17.dynamic.hinet.net [218.163.21.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: jidanni [...] jidanni.org) by homiemail-a4.g.dreamhost.com (Postfix) with ESMTPSA id B3B3A51C070; Mon, 23 Jan 2012 22:33:11 -0800 (PST)
Authentication-Results: hipster.bestpractical.com (amavisd-new); domainkeys=pass header.from=jidanni [...] jidanni.org
Authentication-Results: hipster.bestpractical.com (amavisd-new); dkim=pass header.i= [...] jidanni.org
Delivered-To: cpan-bug+Algorithm-GooglePolylineEncoding [...] hipster.bestpractical.com
Subject: worse roundtrip performance
Return-Path: <jidanni [...] jidanni.org>
Domainkey-Signature: a=rsa-sha1; c=nofws; d=jidanni.org; h=from:to:cc:subject :date:message-id:mime-version:content-type; q=dns; s=jidanni.org ; b=LEysykog/BzZXlcs9eHuI5QB3affjJrYlruGF4l+vidSrXvy8ZABjmrQeHtk 7lms9dYBke/1PJVB9pQg24A/6r/U/2fW3omw09YlP3PUFwU+qFW62P684ZKdkgPq f4xbK/GsfQWhv8+DqLWdpEMFu38qBRVKMM0DDUdQ1LhNcEQ=
X-RT-Mail-Extension: algorithm-googlepolylineencoding
X-Original-To: cpan-bug+Algorithm-GooglePolylineEncoding [...] hipster.bestpractical.com
X-Spam-Check-BY: 16.mx.develooper.com
Dkim-Signature: v=1; a=rsa-sha1; c=relaxed; d=jidanni.org; h=from:to:cc :subject:date:message-id:mime-version:content-type; s= jidanni.org; bh=o+NA9Mum1yuR6+LSEqJy5Tm7bdw=; b=fvcNpb/TgyPNH8X0 ZxGf7K+h5apVY4sxrL5QhFlHSKqKgnG0DvTdXNS2aM9S88uMRnEIjx9h0K0HGCSu 65F9WDtHBsXFH3V2XNLLSDNVEjHDRMVZurauqg7pMitdjH/mv3HIJ5eYoFW9LSPi ikr3bIYfBMY+lpzQMBiKlSLUAEE=
Date: Tue, 24 Jan 2012 14:33:08 +0800
X-Spam-Level:
To: bug-Algorithm-GooglePolylineEncoding [...] rt.cpan.org
From: jidanni [...] jidanni.org
Content-Length: 0
content-type: text/plain; charset="utf-8"
X-RT-Original-Encoding: ascii
Content-Length: 114
Download (untitled) / with headers
text/plain 114b
Doing some roundtrip tests, it seems some tightening up is needed. Enclosed is a test program. $VERSION = '0.02';
Content-Description: program
content-type: text/plain; charset="utf-8"
content-disposition: attachment; filename="kml2googlepolylinetest"
X-RT-Original-Encoding: ascii
Content-Length: 4638

Message body is not shown because sender requested not to inline it.

From jidanni [...] jidanni.org Tue Jan 24 01: 42:25 2012
MIME-Version: 1.0
X-Spam-Status: No, score=-2 tagged_above=-99.9 required=10 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1] autolearn=ham
X-Spam-Flag: NO
References: <rt-3.8.HEAD-14884-1327386802-82.74303-3-0 [...] rt.cpan.org>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
Message-ID: <87k44ha9fc.fsf [...] jidanni.org>
Content-Type: text/plain; charset="utf-8"
X-RT-Original-Encoding: utf-8
X-Spam-Score: -2
Authentication-Results: hipster.bestpractical.com (amavisd-new); domainkeys=pass header.from=jidanni [...] jidanni.org
Authentication-Results: hipster.bestpractical.com (amavisd-new); dkim=pass header.i= [...] jidanni.org
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id 258EF241334 for <cpan-bug+algorithm-googlepolylineencoding [...] hipster.bestpractical.com>; Tue, 24 Jan 2012 01:42:25 -0500 (EST)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id e0aOJuJpPSPX for <cpan-bug+algorithm-googlepolylineencoding [...] hipster.bestpractical.com>; Tue, 24 Jan 2012 01:42:23 -0500 (EST)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id 86ED7240C2D for <bug-algorithm-googlepolylineencoding [...] rt.cpan.org>; Tue, 24 Jan 2012 01:42:23 -0500 (EST)
Received: (qmail 17971 invoked by uid 103); 24 Jan 2012 06:42:22 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 24 Jan 2012 06:42:22 -0000
Received: from caiajhbdcaib.dreamhost.com (HELO homiemail-a38.g.dreamhost.com) (208.97.132.81) by 16.mx.develooper.com (qpsmtpd/0.80/v0.80-19-gf52d165) with ESMTP; Mon, 23 Jan 2012 22:42:20 -0800
Received: from homiemail-a38.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a38.g.dreamhost.com (Postfix) with ESMTP id 3A5D910AFB0 for <bug-algorithm-googlepolylineencoding [...] rt.cpan.org>; Mon, 23 Jan 2012 22:42:18 -0800 (PST)
Received: from jidanni.org (218-163-21-17.dynamic.hinet.net [218.163.21.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: jidanni [...] jidanni.org) by homiemail-a38.g.dreamhost.com (Postfix) with ESMTPSA id D961D10AFAD for <bug-algorithm-googlepolylineencoding [...] rt.cpan.org>; Mon, 23 Jan 2012 22:42:17 -0800 (PST)
Delivered-To: cpan-bug+algorithm-googlepolylineencoding [...] hipster.bestpractical.com
Subject: Re: [rt.cpan.org #74303] AutoReply: worse roundtrip performance
Domainkey-Signature: a=rsa-sha1; c=nofws; d=jidanni.org; h=from:to:subject :references:date:message-id:mime-version:content-type; q=dns; s= jidanni.org; b=Eqsydu7fjbvnSotjmfKgPyrGmY9kbp4In159YTF2ZN8/JY98/ tHteP4HM5smjkU6SRmMFCWDXvWcEjv1YmK0twOHQR33ib39WNjrvno7MfJczN7Wl azdaJX3A8go9Xgkn6I7KVEpW69t2Eq4Sx7336IX0IKlunWZ8genFiu5Oy0=
Return-Path: <jidanni [...] jidanni.org>
Dkim-Signature: v=1; a=rsa-sha1; c=relaxed; d=jidanni.org; h=from:to :subject:references:date:message-id:mime-version:content-type; s=jidanni.org; bh=HzGU/2miO4/k+PrvsqncDFP95cM=; b=NtKx/srINkbDW 0t/2mKqA7tQOG/eMhvMYcyopBRL/padFGmvagHLH/f1yJyYvj0tbf3qpCRsUSL4Z n9jt0Jn6fAJjLzOq3m9LZtYexwQf0Dg4vwL2jXX2pAiHV4QFHCxDJZKEkMoXMeLH bw/rNYpumwPVz9OP9UPqto3yuZ4r7M=
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: cpan-bug+algorithm-googlepolylineencoding [...] hipster.bestpractical.com
X-RT-Mail-Extension: algorithm-googlepolylineencoding
Date: Tue, 24 Jan 2012 14:42:15 +0800
X-Spam-Level:
To: bug-algorithm-googlepolylineencoding [...] rt.cpan.org
From: jidanni [...] jidanni.org
RT-Message-ID: <rt-3.8.HEAD-14878-1327387345-1403.74303-0-0 [...] rt.cpan.org>
Content-Length: 72
MIME-Version: 1.0
In-Reply-To: <rt-3.8.HEAD-14878-1327387345-1403.74303-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
References: <rt-3.8.HEAD-14884-1327386802-82.74303-3-0 [...] rt.cpan.org> <87k44ha9fc.fsf [...] jidanni.org> <rt-3.8.HEAD-14878-1327387345-1403.74303-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="UTF-8"
Message-ID: <rt-3.8.HEAD-14879-1327446720-1759.74303-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 351
Download (untitled) / with headers
text/plain 351b
On 2012-01-24 01:42:25, jidanni@jidanni.org wrote: Show quoted text
> Most of it I hacked from http://www.usnaviguide.com/google-encode.htm .
Can you try out the patched version: git clone git://github.com/eserte/algorithm-googlepolylineencoding.git -b RT74303 With my sample kml files there are no more differences to the other algorithm. Regards, Slaven
From jidanni [...] jidanni.org Wed Jan 25 00: 33:01 2012
MIME-Version: 1.0
X-Spam-Status: No, score=-2 tagged_above=-99.9 required=10 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1] autolearn=ham
X-Spam-Flag: NO
References: <rt-3.8.HEAD-14879-1327446720-371.74303-6-0 [...] rt.cpan.org>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
Message-ID: <87r4yony8i.fsf [...] jidanni.org>
Content-Type: text/plain; charset="utf-8"
X-RT-Original-Encoding: utf-8
X-Spam-Score: -2
Authentication-Results: hipster.bestpractical.com (amavisd-new); domainkeys=pass header.from=jidanni [...] jidanni.org
Authentication-Results: hipster.bestpractical.com (amavisd-new); dkim=pass header.i= [...] jidanni.org
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id 8FD0D241473 for <cpan-bug+algorithm-googlepolylineencoding [...] hipster.bestpractical.com>; Wed, 25 Jan 2012 00:33:01 -0500 (EST)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id v8SbiGK3tfsF for <cpan-bug+algorithm-googlepolylineencoding [...] hipster.bestpractical.com>; Wed, 25 Jan 2012 00:32:55 -0500 (EST)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id 113BC240E03 for <bug-algorithm-googlepolylineencoding [...] rt.cpan.org>; Wed, 25 Jan 2012 00:32:53 -0500 (EST)
Received: (qmail 13414 invoked by uid 103); 25 Jan 2012 05:32:53 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 25 Jan 2012 05:32:53 -0000
Received: from caiajhbdcagg.dreamhost.com (HELO homiemail-a3.g.dreamhost.com) (208.97.132.66) by 16.mx.develooper.com (qpsmtpd/0.80/v0.80-19-gf52d165) with ESMTP; Tue, 24 Jan 2012 21:32:42 -0800
Received: from homiemail-a3.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a3.g.dreamhost.com (Postfix) with ESMTP id 1CA8D28406E for <bug-algorithm-googlepolylineencoding [...] rt.cpan.org>; Tue, 24 Jan 2012 21:32:32 -0800 (PST)
Received: from jidanni.org (218-163-21-214.dynamic.hinet.net [218.163.21.214]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: jidanni [...] jidanni.org) by homiemail-a3.g.dreamhost.com (Postfix) with ESMTPSA id BEC9928406A for <bug-algorithm-googlepolylineencoding [...] rt.cpan.org>; Tue, 24 Jan 2012 21:32:31 -0800 (PST)
Delivered-To: cpan-bug+algorithm-googlepolylineencoding [...] hipster.bestpractical.com
Subject: Re: [rt.cpan.org #74303] worse roundtrip performance
Domainkey-Signature: a=rsa-sha1; c=nofws; d=jidanni.org; h=from:to:subject :references:date:message-id:mime-version:content-type; q=dns; s= jidanni.org; b=FaS6F/DbHsP2eYzZf+MkVrlyyRXyCAWGmf4i586uOmDuSb2tg hD0oNEFQ6aKAzW0unxYpdck7gFEMM+a9YuHftIJtXQ6wI4Gxy60443YbCoaEhsBu GkRGW3lL/KkVHEOr2EA7vyZyGeln+ry/AfFq1Jd6DfDMfmPpcLQzVMr03U=
Return-Path: <jidanni [...] jidanni.org>
Dkim-Signature: v=1; a=rsa-sha1; c=relaxed; d=jidanni.org; h=from:to :subject:references:date:message-id:mime-version:content-type; s=jidanni.org; bh=smIboqMBrQhPPssOQTiH4Dtyl5Y=; b=bdowWiN6iDn8P obddaEcVYh/HeygYFmY1Xncd+LtiVzVr2XIGweOBwr9BNN4vElmb/bDDjN4mfWyO A6klyqdKBC/62TS3jjHwofuVUuHJsQrV4NO+ftGrf3FtSM+OIFQLSMIEtza01IzI ejhHHx/7jZSdph+lYD50A0wtF7rsbw=
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: cpan-bug+algorithm-googlepolylineencoding [...] hipster.bestpractical.com
X-RT-Mail-Extension: algorithm-googlepolylineencoding
Date: Wed, 25 Jan 2012 13:32:29 +0800
X-Spam-Level:
To: bug-algorithm-googlepolylineencoding [...] rt.cpan.org
From: jidanni [...] jidanni.org
RT-Message-ID: <rt-3.8.HEAD-14879-1327469582-500.74303-0-0 [...] rt.cpan.org>
Content-Length: 93
Years ago I removed git. I will have to wait until it is installable with cpanminus to test.
From slaven [...] rezic.de Wed Jan 25 02: 11:14 2012
MIME-Version: 1.0
X-Spam-Status: No, score=-2.47 tagged_above=-99.9 required=10 tests=[AWL=-0.570, BAYES_00=-1.9] autolearn=ham
X-Authentication-Warning: biokovo.herceg.de: eserte set sender to slaven [...] rezic.de using -f
In-Reply-To: <rt-3.8.HEAD-14879-1327469582-829.74303-5-0 [...] rt.cpan.org> (Dan Jacobson via's message of "Wed\, 25 Jan 2012 00\:33\:02 -0500")
X-Mailer: GNU Emacs/sendmail [version 22.3.1]
X-Spam-Flag: NO
X-Provags-ID: V02:K0:Z5tug5lgFEQrEL06IyYbFUdZSOKNHmBZ+oP/RsLNUxn gaa7DBlQ1ervmnRtbMSq5lCXbzrXn7IlC2j9QcuiZNliWxf2Uv k9VQNq48aO7rekmSdNUNGvi3shPDvINnfDFG0stkbD4H9j7lC8 HQYpAUPtNy2GqTFZu7Mn7xBRcvlkOOv1OoNhkvGH73s8+ET/tI OMb6OyVait9Hg9k02GejKQmdM1UuRCfKh0Z63qWdHC5H+QDrD4 9mC3MbWaK8a9XsAnzflaHq9JhEhYM2zBe4TNXngXyIOUwxe1Vi 3K0aaOtBJURGquprDrfbxDJb3iJY+xtRF8cqj6TpI3z1GnKc7k jSR9luI3L2IQwVFcv3pbz8Prk21Rs4WbWhA6M4fI/
References: <RT-Ticket-74303 [...] rt.cpan.org> <rt-3.8.HEAD-14879-1327446720-371.74303-6-0 [...] rt.cpan.org> <87r4yony8i.fsf [...] jidanni.org> <rt-3.8.HEAD-14879-1327469582-829.74303-5-0 [...] rt.cpan.org>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
Reply-To: slaven [...] rezic.de
Message-ID: <87sjj4b6n5.fsf [...] biokovo.herceg.de>
Content-Type: text/plain; charset="utf-8"
X-RT-Original-Encoding: utf-8
X-Spam-Score: -2.47
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id 18D88241490 for <cpan-bug+Algorithm-GooglePolylineEncoding [...] hipster.bestpractical.com>; Wed, 25 Jan 2012 02:11:14 -0500 (EST)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id CmfveQDYwR2P for <cpan-bug+Algorithm-GooglePolylineEncoding [...] hipster.bestpractical.com>; Wed, 25 Jan 2012 02:11:12 -0500 (EST)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id 0C7A9241451 for <bug-Algorithm-GooglePolylineEncoding [...] rt.cpan.org>; Wed, 25 Jan 2012 02:11:11 -0500 (EST)
Received: (qmail 20475 invoked by uid 103); 25 Jan 2012 07:11:11 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 25 Jan 2012 07:11:11 -0000
Received: from moutng.kundenserver.de (HELO moutng.kundenserver.de) (212.227.17.10) by 16.mx.develooper.com (qpsmtpd/0.80/v0.80-19-gf52d165) with ESMTP; Tue, 24 Jan 2012 23:11:09 -0800
Received: from localhost.localdomain (g226032116.adsl.alicedsl.de [92.226.32.116]) by mrelayeu.kundenserver.de (node=mreu3) with ESMTP (Nemesis) id 0MAX6s-1RvxIJ0ddS-00Bbrx; Wed, 25 Jan 2012 08:11:05 +0100
Received: from biokovo.herceg.de (localhost [127.0.0.1]) by biokovo.herceg.de (8.14.3/8.14.3) with ESMTP id q0P79Ir5073995; Wed, 25 Jan 2012 08:09:18 +0100 (CET) (envelope-from slaven [...] rezic.de)
Received: (from eserte [...] localhost) by biokovo.herceg.de (8.14.3/8.14.3/Submit) id q0P79Iu6073994; Wed, 25 Jan 2012 08:09:18 +0100 (CET) (envelope-from slaven [...] rezic.de)
Delivered-To: cpan-bug+Algorithm-GooglePolylineEncoding [...] hipster.bestpractical.com
Subject: Re: [rt.cpan.org #74303] worse roundtrip performance
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (berkeley-unix)
Return-Path: <slaven [...] rezic.de>
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: cpan-bug+Algorithm-GooglePolylineEncoding [...] hipster.bestpractical.com
X-RT-Mail-Extension: algorithm-googlepolylineencoding
Date: Wed, 25 Jan 2012 08:09:18 +0100
X-Spam-Level:
To: bug-Algorithm-GooglePolylineEncoding [...] rt.cpan.org
From: Slaven Rezic <slaven [...] rezic.de>
RT-Message-ID: <rt-3.8.HEAD-14880-1327475475-97.74303-0-0 [...] rt.cpan.org>
Content-Length: 1585
Download (untitled) / with headers
text/plain 1.5k
"Dan Jacobson via RT" <bug-Algorithm-GooglePolylineEncoding@rt.cpan.org> writes: Show quoted text
> Queue: Algorithm-GooglePolylineEncoding > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=74303 > > > Years ago I removed git. > I will have to wait until it is installable with cpanminus to test. >
Here's a patch: diff --git a/GooglePolylineEncoding.pm b/GooglePolylineEncoding.pm index 0d3fef3..14df217 100644 --- a/GooglePolylineEncoding.pm +++ b/GooglePolylineEncoding.pm @@ -72,14 +72,13 @@ sub encode_number { sub encode_polyline { my(@path) = @_; my @res; - my($curr_lat,$curr_lon) = do { my $first = shift @path; ($first->{lat}, $first->{lon}) }; - push @res, encode_number($curr_lat), encode_number($curr_lon); + my($curr_lat_e5,$curr_lon_e5) = (0,0); for my $lat_lon (@path) { - my($lat,$lon) = ($lat_lon->{lat}, $lat_lon->{lon}); - my $deltay = $lat - $curr_lat; - my $deltax = $lon - $curr_lon; + my($lat_e5,$lon_e5) = map { sprintf("%.0f", $_*1e5) } ($lat_lon->{lat}, $lat_lon->{lon}); + my $deltay = ($lat_e5 - $curr_lat_e5) / 1e5; + my $deltax = ($lon_e5 - $curr_lon_e5) / 1e5; push @res, encode_number($deltay), encode_number($deltax); - ($curr_lat,$curr_lon) = ($lat,$lon); + ($curr_lat_e5,$curr_lon_e5) = ($lat_e5,$lon_e5); } join '', @res; } -- Slaven Rezic - slaven <at> rezic <dot> de BBBike - route planner for cyclists in Berlin WWW version: http://www.bbbike.de Perl/Tk version for Unix and Windows: http://bbbike.sourceforge.net
From slaven [...] rezic.de Wed Jan 25 02: 31:24 2012
CC: undisclosed-recipients:;
MIME-Version: 1.0
X-Spam-Status: No, score=-2.375 tagged_above=-99.9 required=10 tests=[AWL=-0.475, BAYES_00=-1.9] autolearn=ham
X-Authentication-Warning: biokovo.herceg.de: eserte set sender to slaven [...] rezic.de using -f
In-Reply-To: <rt-3.8.HEAD-14879-1327469582-829.74303-5-0 [...] rt.cpan.org> (Dan Jacobson via's message of "Wed\, 25 Jan 2012 00\:33\:02 -0500")
X-Mailer: GNU Emacs/sendmail [version 22.3.1]
X-Spam-Flag: NO
X-Provags-ID: V02:K0:BIwdgfyQePBDpKkx6nTGNnEyDdXgNITGN46ak2xozyr RkH4ohEEa80PaGDkVrwXIFji7coeZqucPyfITp7k/tT1h11llR DFQmvwo+hF8NZf5nCh6pxP5mJdXllzbs+Hz9ozwUe/WpBJ54Go Ehta/Z4TwQZpEGvMy3UrILyo5Uo2HA9rK2Fu+DZRM48UjJSjin y3W1HMGxx/tySXcOXZVxZefgXO0CGc2Qg15KTVac0IoZQjRRxY ylKey0RIln7Vy6AfsM/ezYm30AsXjsaPIJhHHfx/HihcN7+fZK h81U14mQk2AM2uiQF/hzt/eXGTKS4JOl6Vv+KM/Ba2A71sEYdh WIsVRjkxYuV+jjybdP2piN+sWWNSB9z9jFJJrpdFL
References: <RT-Ticket-74303 [...] rt.cpan.org> <rt-3.8.HEAD-14879-1327446720-371.74303-6-0 [...] rt.cpan.org> <87r4yony8i.fsf [...] jidanni.org> <rt-3.8.HEAD-14879-1327469582-829.74303-5-0 [...] rt.cpan.org>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
Reply-To: slaven [...] rezic.de
Message-ID: <87ty3kb6ne.fsf [...] biokovo.herceg.de>
Content-Type: text/plain; charset="utf-8"
X-RT-Original-Encoding: utf-8
X-Spam-Score: -2.375
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id 801D6241451 for <cpan-bug+Algorithm-GooglePolylineEncoding [...] hipster.bestpractical.com>; Wed, 25 Jan 2012 02:31:24 -0500 (EST)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id POyDuUB9vMhq for <cpan-bug+Algorithm-GooglePolylineEncoding [...] hipster.bestpractical.com>; Wed, 25 Jan 2012 02:31:22 -0500 (EST)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id 97236240E03 for <bug-Algorithm-GooglePolylineEncoding [...] rt.cpan.org>; Wed, 25 Jan 2012 02:31:22 -0500 (EST)
Received: (qmail 22081 invoked by uid 103); 25 Jan 2012 07:31:22 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 25 Jan 2012 07:31:22 -0000
Received: from moutng.kundenserver.de (HELO moutng.kundenserver.de) (212.227.126.171) by 16.mx.develooper.com (qpsmtpd/0.80/v0.80-19-gf52d165) with ESMTP; Tue, 24 Jan 2012 23:31:19 -0800
Received: from localhost.localdomain (g226032116.adsl.alicedsl.de [92.226.32.116]) by mrelayeu.kundenserver.de (node=mrbap4) with ESMTP (Nemesis) id 0MNtql-1RiXLL0D7r-007TV4; Wed, 25 Jan 2012 08:31:16 +0100
Received: from biokovo.herceg.de (localhost [127.0.0.1]) by biokovo.herceg.de (8.14.3/8.14.3) with ESMTP id q0P7UIMo082961; Wed, 25 Jan 2012 08:30:18 +0100 (CET) (envelope-from slaven [...] rezic.de)
Received: (from eserte [...] localhost) by biokovo.herceg.de (8.14.3/8.14.3/Submit) id q0P799it073828; Wed, 25 Jan 2012 08:09:09 +0100 (CET) (envelope-from slaven [...] rezic.de)
Delivered-To: cpan-bug+Algorithm-GooglePolylineEncoding [...] hipster.bestpractical.com
Subject: Re: [rt.cpan.org #74303] worse roundtrip performance
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (berkeley-unix)
Return-Path: <slaven [...] rezic.de>
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: cpan-bug+Algorithm-GooglePolylineEncoding [...] hipster.bestpractical.com
X-RT-Mail-Extension: algorithm-googlepolylineencoding
Date: Wed, 25 Jan 2012 08:09:09 +0100
X-Spam-Level:
To: bug-Algorithm-GooglePolylineEncoding [...] rt.cpan.org
From: Slaven Rezic <slaven [...] rezic.de>
RT-Message-ID: <rt-3.8.HEAD-14878-1327476685-1055.74303-0-0 [...] rt.cpan.org>
Content-Length: 1585
Download (untitled) / with headers
text/plain 1.5k
"Dan Jacobson via RT" <bug-Algorithm-GooglePolylineEncoding@rt.cpan.org> writes: Show quoted text
> Queue: Algorithm-GooglePolylineEncoding > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=74303 > > > Years ago I removed git. > I will have to wait until it is installable with cpanminus to test. >
Here's a patch: diff --git a/GooglePolylineEncoding.pm b/GooglePolylineEncoding.pm index 0d3fef3..14df217 100644 --- a/GooglePolylineEncoding.pm +++ b/GooglePolylineEncoding.pm @@ -72,14 +72,13 @@ sub encode_number { sub encode_polyline { my(@path) = @_; my @res; - my($curr_lat,$curr_lon) = do { my $first = shift @path; ($first->{lat}, $first->{lon}) }; - push @res, encode_number($curr_lat), encode_number($curr_lon); + my($curr_lat_e5,$curr_lon_e5) = (0,0); for my $lat_lon (@path) { - my($lat,$lon) = ($lat_lon->{lat}, $lat_lon->{lon}); - my $deltay = $lat - $curr_lat; - my $deltax = $lon - $curr_lon; + my($lat_e5,$lon_e5) = map { sprintf("%.0f", $_*1e5) } ($lat_lon->{lat}, $lat_lon->{lon}); + my $deltay = ($lat_e5 - $curr_lat_e5) / 1e5; + my $deltax = ($lon_e5 - $curr_lon_e5) / 1e5; push @res, encode_number($deltay), encode_number($deltax); - ($curr_lat,$curr_lon) = ($lat,$lon); + ($curr_lat_e5,$curr_lon_e5) = ($lat_e5,$lon_e5); } join '', @res; } -- Slaven Rezic - slaven <at> rezic <dot> de BBBike - route planner for cyclists in Berlin WWW version: http://www.bbbike.de Perl/Tk version for Unix and Windows: http://bbbike.sourceforge.net
From jidanni [...] jidanni.org Wed Jan 25 02: 31:43 2012
MIME-Version: 1.0
X-Spam-Status: No, score=-2 tagged_above=-99.9 required=10 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1] autolearn=ham
X-Spam-Flag: NO
References: <rt-3.8.HEAD-14880-1327475476-583.74303-6-0 [...] rt.cpan.org>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
Message-ID: <87mx9cnsq3.fsf [...] jidanni.org>
Content-Type: text/plain; charset="utf-8"
X-RT-Original-Encoding: utf-8
X-Spam-Score: -2
Authentication-Results: hipster.bestpractical.com (amavisd-new); domainkeys=pass header.from=jidanni [...] jidanni.org
Authentication-Results: hipster.bestpractical.com (amavisd-new); dkim=pass header.i= [...] jidanni.org
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id 0BFCE241451 for <cpan-bug+algorithm-googlepolylineencoding [...] hipster.bestpractical.com>; Wed, 25 Jan 2012 02:31:43 -0500 (EST)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nm1TYq7BQK97 for <cpan-bug+algorithm-googlepolylineencoding [...] hipster.bestpractical.com>; Wed, 25 Jan 2012 02:31:42 -0500 (EST)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id B47D6240E03 for <bug-algorithm-googlepolylineencoding [...] rt.cpan.org>; Wed, 25 Jan 2012 02:31:41 -0500 (EST)
Received: (qmail 22094 invoked by uid 103); 25 Jan 2012 07:31:41 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 25 Jan 2012 07:31:41 -0000
Received: from caiajhbdcagg.dreamhost.com (HELO homiemail-a1.g.dreamhost.com) (208.97.132.66) by 16.mx.develooper.com (qpsmtpd/0.80/v0.80-19-gf52d165) with ESMTP; Tue, 24 Jan 2012 23:31:39 -0800
Received: from homiemail-a1.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a1.g.dreamhost.com (Postfix) with ESMTP id AB0C434806C for <bug-algorithm-googlepolylineencoding [...] rt.cpan.org>; Tue, 24 Jan 2012 23:31:36 -0800 (PST)
Received: from jidanni.org (218-163-21-214.dynamic.hinet.net [218.163.21.214]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: jidanni [...] jidanni.org) by homiemail-a1.g.dreamhost.com (Postfix) with ESMTPSA id 54A03348062 for <bug-algorithm-googlepolylineencoding [...] rt.cpan.org>; Tue, 24 Jan 2012 23:31:36 -0800 (PST)
Delivered-To: cpan-bug+algorithm-googlepolylineencoding [...] hipster.bestpractical.com
Subject: Re: [rt.cpan.org #74303] worse roundtrip performance
Domainkey-Signature: a=rsa-sha1; c=nofws; d=jidanni.org; h=from:to:subject :references:date:message-id:mime-version:content-type; q=dns; s= jidanni.org; b=ao6j+MueE+VIIVPzNl1vdyuZgT2ntQYGgcfM98M3mtkIsLhxM /8+xTIJUWdTe5LDnFoNBgD5J4Bp4qr9FcnFrP95aRnwJb7UczhjbDoHMuhu3ouFw DJOSYR3DxP7wKzbSpUU//IErWiA7ZfOLcvBYsIgZPRpsu9W0TCiTZIip9A=
Return-Path: <jidanni [...] jidanni.org>
Dkim-Signature: v=1; a=rsa-sha1; c=relaxed; d=jidanni.org; h=from:to :subject:references:date:message-id:mime-version:content-type; s=jidanni.org; bh=9UHNhI8bUGjNrko/o/4PV/UyuPs=; b=DAlGw41ufVNgq SU1sj2fhEIhopRWKwAQaV3rZuwZjO1Li39fclfJllNGlv5djtoPPqZNaZtLav8C0 5UEt//20BIbDtLP+IGBMfyMRtq0+5ERG599799bxZgdJ9DD4SWDQGRGoRkYnqdSS a5bapBUVmZyDPeDqxy0qJqlRl+6kI8=
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: cpan-bug+algorithm-googlepolylineencoding [...] hipster.bestpractical.com
X-RT-Mail-Extension: algorithm-googlepolylineencoding
Date: Wed, 25 Jan 2012 15:31:32 +0800
X-Spam-Level:
To: bug-algorithm-googlepolylineencoding [...] rt.cpan.org
From: jidanni [...] jidanni.org
RT-Message-ID: <rt-3.8.HEAD-14880-1327476703-1240.74303-0-0 [...] rt.cpan.org>
Content-Length: 547
Download (untitled) / with headers
text/plain 547b
Show quoted text
>>>>> "sdvR" == slaven@rezic de via RT <bug-Algorithm-GooglePolylineEncoding@rt.cpan.org> writes:
Show quoted text
sdvR> Here's a patch:
Indeed, now the results are the same as you said! But I still think you can go further and beat all the other algorithms: Given A=Original points B=Rounded to five digits points Then take them for a round trip. Why can't we get back to B, and not just B+-1? Odd, if the input is already 5 digits long, then it comes back intact. Or something like that. OK, I'm not talking very clearly, but maybe you know what I mean.
From jidanni [...] jidanni.org Sat Jan 28 23: 00:01 2012
CC: slaven [...] rezic.de
MIME-Version: 1.0
X-Spam-Status: No, score=-2 tagged_above=-99.9 required=10 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1] autolearn=ham
X-Spam-Flag: NO
References: <rt-3.8.HEAD-14880-1327475476-583.74303-6-0 [...] rt.cpan.org>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
Message-ID: <87obtnrwej.fsf [...] jidanni.org>
Content-Type: text/plain; charset="utf-8"
X-RT-Original-Encoding: utf-8
X-Spam-Score: -2
Authentication-Results: hipster.bestpractical.com (amavisd-new); domainkeys=pass header.from=jidanni [...] jidanni.org
Authentication-Results: hipster.bestpractical.com (amavisd-new); dkim=pass header.i= [...] jidanni.org
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id D78702412BF for <cpan-bug+algorithm-googlepolylineencoding [...] hipster.bestpractical.com>; Sat, 28 Jan 2012 23:00:00 -0500 (EST)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zpdFZHldSX1L for <cpan-bug+algorithm-googlepolylineencoding [...] hipster.bestpractical.com>; Sat, 28 Jan 2012 22:59:58 -0500 (EST)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id D477724007F for <bug-algorithm-googlepolylineencoding [...] rt.cpan.org>; Sat, 28 Jan 2012 22:59:57 -0500 (EST)
Received: (qmail 8456 invoked by uid 103); 29 Jan 2012 03:59:56 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 29 Jan 2012 03:59:56 -0000
Received: from caiajhbdcahe.dreamhost.com (HELO homiemail-a62.g.dreamhost.com) (208.97.132.74) by 16.mx.develooper.com (qpsmtpd/0.80/v0.80-19-gf52d165) with ESMTP; Sat, 28 Jan 2012 19:59:55 -0800
Received: from homiemail-a62.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a62.g.dreamhost.com (Postfix) with ESMTP id 505FF63406E; Sat, 28 Jan 2012 19:59:52 -0800 (PST)
Received: from jidanni.org (218-174-211-117.dynamic.hinet.net [218.174.211.117]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: jidanni [...] jidanni.org) by homiemail-a62.g.dreamhost.com (Postfix) with ESMTPSA id B2F8F634064; Sat, 28 Jan 2012 19:59:51 -0800 (PST)
Delivered-To: cpan-bug+algorithm-googlepolylineencoding [...] hipster.bestpractical.com
Subject: Re: [rt.cpan.org #74303] worse roundtrip performance
Domainkey-Signature: a=rsa-sha1; c=nofws; d=jidanni.org; h=from:to:cc:subject :references:date:message-id:mime-version:content-type; q=dns; s= jidanni.org; b=WO6Y1OyK1nc7accHLI8yhSTzq+1KLi62N4i6FDBoMZQXzP7dJ oD4o4BdktMD1Gv4S8sazlgASJH4jgnupDfmrjiJYz3bY0YO8SY0aIHd8D8zKUGS1 nJe1kees+ce4sQWJYUBO0lwXtL2DNMDtOVh+/S448WeCb1NXlgPk/hY1B0=
Return-Path: <jidanni [...] jidanni.org>
Dkim-Signature: v=1; a=rsa-sha1; c=relaxed; d=jidanni.org; h=from:to:cc :subject:references:date:message-id:mime-version:content-type; s=jidanni.org; bh=UoxUNqfXeiCgl4twKJb+/BdXl+Q=; b=n04eHHrywU1Nk Du27j/d7g+3S4JRvKnpN7AsilaSomwdYc1JGvDePmLENPBRZm+qCeKjumrfrmIxb jlTgcUGvNvPTlnY+P8bfRkabfpx/8ktemJHs5S/6cMFJ7uultRqZ+Zh4xfLFeOpl auO2zp8XxbrnftBYG4AJHxZ60RIynI=
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: cpan-bug+algorithm-googlepolylineencoding [...] hipster.bestpractical.com
X-RT-Mail-Extension: algorithm-googlepolylineencoding
Date: Sun, 29 Jan 2012 11:59:48 +0800
X-Spam-Level:
To: bug-algorithm-googlepolylineencoding [...] rt.cpan.org
From: jidanni [...] jidanni.org
RT-Message-ID: <rt-3.8.HEAD-17367-1327809601-542.74303-0-0 [...] rt.cpan.org>
Content-Length: 1199
Download (untitled) / with headers
text/plain 1.1k
Show quoted text
sdvR> index 0d3fef3..14df217 100644
OK, yes thanks for the patch... But even with it, there is a more basic question I would like to ask first: #!/usr/bin/perl ## Let's make use Algorithm::GooglePolylineEncoding; ## give the best roundtrip results possible! ## I would like to ask even before going on roundtrips, why can't the ## algorithm produce the same string when given instead a rounded ## version of the input? ## Test with ## $ perl thisfile somefile.kml use strict; use warnings FATAL => 'all'; my @names = qw/original rounded/; my %polyline; while (<>) { if (/([0-9.]+),([0-9.]+)/) { push @{ $polyline{original} }, { lat => $2, lon => $1 }; push @{ $polyline{rounded} }, { lat => ( sprintf "%.5f", $2 ), lon => ( sprintf "%.5f", $1 ) }; ##Correct, no? } } my %encoded_polyline; for (@names) { $encoded_polyline{$_} = Algorithm::GooglePolylineEncoding::encode_polyline( @{ $polyline{$_} } ); print $encoded_polyline{$_}, "\n"; } for ( split //, $encoded_polyline{ $names[0] } ^ $encoded_polyline{ $names[1] } ) { use feature "switch"; given ($_) { when ("\0") { print "_" } default { print "X"; } } }
From jidanni [...] jidanni.org Fri Feb 3 12: 50:35 2012
CC: bug-algorithm-googlepolylineencoding [...] rt.cpan.org
MIME-Version: 1.0
X-Spam-Status: No, score=-2 tagged_above=-99.9 required=10 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1] autolearn=ham
X-Spam-Flag: NO
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
Message-ID: <87bopfu86e.fsf [...] jidanni.org>
Content-Type: text/plain; charset="utf-8"
X-RT-Original-Encoding: utf-8
X-Spam-Score: -2
Authentication-Results: hipster.bestpractical.com (amavisd-new); domainkeys=pass header.from=jidanni [...] jidanni.org
Authentication-Results: hipster.bestpractical.com (amavisd-new); dkim=pass header.i= [...] jidanni.org
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id 87143241616 for <cpan-bug+algorithm-googlepolylineencoding [...] hipster.bestpractical.com>; Fri, 3 Feb 2012 12:50:35 -0500 (EST)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bTp19onc+Owp for <cpan-bug+algorithm-googlepolylineencoding [...] hipster.bestpractical.com>; Fri, 3 Feb 2012 12:50:32 -0500 (EST)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id 7C42524160E for <bug-algorithm-googlepolylineencoding [...] rt.cpan.org>; Fri, 3 Feb 2012 12:50:32 -0500 (EST)
Received: (qmail 5922 invoked by uid 103); 3 Feb 2012 17:50:31 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 3 Feb 2012 17:50:31 -0000
Received: from caiajhbdcbhh.dreamhost.com (HELO homiemail-a4.g.dreamhost.com) (208.97.132.177) by 16.mx.develooper.com (qpsmtpd/0.80/v0.80-19-gf52d165) with ESMTP; Fri, 03 Feb 2012 09:50:29 -0800
Received: from homiemail-a4.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a4.g.dreamhost.com (Postfix) with ESMTP id EEE0E51C074; Fri, 3 Feb 2012 09:50:26 -0800 (PST)
Received: from jidanni.org (218-163-17-179.dynamic.hinet.net [218.163.17.179]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: jidanni [...] jidanni.org) by homiemail-a4.g.dreamhost.com (Postfix) with ESMTPSA id 5BFDB51C063; Fri, 3 Feb 2012 09:50:26 -0800 (PST)
Delivered-To: cpan-bug+algorithm-googlepolylineencoding [...] hipster.bestpractical.com
Subject: Re: [rt.cpan.org #74303] forget sprintf
Domainkey-Signature: a=rsa-sha1; c=nofws; d=jidanni.org; h=from:to:cc:subject :date:message-id:mime-version:content-type; q=dns; s=jidanni.org ; b=c/RTAKHv29QrrmH8naWzIm+AZ1H2H7hZQ6GIull+sGgvaOM4LQBpE37MTEsD 5kWTd8ztpjInAJrPODhnYGtFDCBpkQuNzyQtxXfCb737nqNyE+sN2uBZKVq0oo8g a/CHgECClj2BMDmXYp2ZcojOp7EITJW2XEjPu9py5iWA4SQ=
Return-Path: <jidanni [...] jidanni.org>
Dkim-Signature: v=1; a=rsa-sha1; c=relaxed; d=jidanni.org; h=from:to:cc :subject:date:message-id:mime-version:content-type; s= jidanni.org; bh=OY3SbQvFXoQxDdqZS0lihb7Cy9s=; b=ADundH0E6GBsHsDz LmgGgnw4xxVaGjZeL7uNMxyFlVEh/yWVdfN5tvY8WuSxE/kvDe+AX31f6Vv9grNY H7oTNUP6QWALb5xz7HhWwk/pdKcUEmTUyuHMClvkSsnn9AGZQbbBF9oxB2iFVYSU OTeWd5plAnzieIzRW/GH2QLXAcE=
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: cpan-bug+algorithm-googlepolylineencoding [...] hipster.bestpractical.com
X-RT-Mail-Extension: algorithm-googlepolylineencoding
Date: Sat, 04 Feb 2012 01:40:41 +0800
X-Spam-Level:
To: srezic [...] cpan.org, slaven [...] rezic.de
From: jidanni [...] jidanni.org
RT-Message-ID: <rt-3.8.HEAD-17369-1328291436-808.74303-0-0 [...] rt.cpan.org>
Content-Length: 831
Download (untitled) / with headers
text/plain 831b
$ perldoc -q \ round mentions half-way-point alternation... so forget all my sprintf stuff. Your way is better! OK, maybe there is no more roundtrip problem. #!/usr/bin/perl use strict; use warnings FATAL => 'all'; use Algorithm::GooglePolylineEncoding; my @encoded_polyline; my @decoded_polyline; while (<>) { if (/([0-9.]+),([0-9.]+)/) { push @{ $decoded_polyline[0] }, { lat => $2, lon => $1 }; } } for ( 0 .. 2 ) { $encoded_polyline[$_] = Algorithm::GooglePolylineEncoding::encode_polyline( @{ $decoded_polyline[$_] } ); print $encoded_polyline[$_], "\n"; @{ $decoded_polyline[ $_ + 1 ] } = Algorithm::GooglePolylineEncoding::decode_polyline( $encoded_polyline[$_] ); } for (@encoded_polyline) { use Digest::MD5 qw(md5 md5_hex md5_base64); print md5_hex($_), "\n"; }


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.