From frankie at frankieroberto.com Sun Jun 28 12:41:40 2009 From: frankie at frankieroberto.com (Frankie Roberto) Date: Sun, 28 Jun 2009 17:41:40 +0100 Subject: [Osmlib-devel] Measuring the length of a way Message-ID: <1350f7a40906280941y65c68fbby3b5cf0c5cb52932f@mail.gmail.com> Hi, Just found this gem - nice work! Thought I'd post a quick problem I'm trying to solve here, in case you can help point me at a solution. Given a way retrieved from OSM, what would be the best way of calculating its total length (in say, metres or kilometres)? Does this formula look like the right one?: http://stackoverflow.com/questions/27928/how-do-i-calculate-distance-between-two-latitude-longitude-points Second question: any chance we could include this method in the gem? :-) Frankie -- Frankie Roberto Experience Designer, Rattle 0114 2706977 http://www.rattlecentral.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jochen at remote.org Mon Jun 29 02:17:21 2009 From: jochen at remote.org (Jochen Topf) Date: Mon, 29 Jun 2009 08:17:21 +0200 Subject: [Osmlib-devel] Measuring the length of a way In-Reply-To: <1350f7a40906280941y65c68fbby3b5cf0c5cb52932f@mail.gmail.com> References: <1350f7a40906280941y65c68fbby3b5cf0c5cb52932f@mail.gmail.com> Message-ID: <20090629061721.GA11215@eldorado.topf.org> On Sun, Jun 28, 2009 at 05:41:40PM +0100, Frankie Roberto wrote: > Thought I'd post a quick problem I'm trying to solve here, in case you can > help point me at a solution. Given a way retrieved from OSM, what would be > the best way of calculating its total length (in say, metres or > kilometres)? Does this formula look like the right one?: > http://stackoverflow.com/questions/27928/how-do-i-calculate-distance-between-two-latitude-longitude-points Haven't checked the formula, but "great-circle distance" and "Haversine" formula, are definitely right. > Second question: any chance we could include this method in the gem? :-) osmlib is for OSM related stuff, calculating great-circle distance or other geometry functions should probably go into a geo library such as GeoRuby. Jochen -- Jochen Topf jochen at remote.org http://www.remote.org/jochen/ +49-721-388298 From frankie at frankieroberto.com Mon Jun 29 04:58:45 2009 From: frankie at frankieroberto.com (Frankie Roberto) Date: Mon, 29 Jun 2009 09:58:45 +0100 Subject: [Osmlib-devel] Measuring the length of a way In-Reply-To: <20090629061721.GA11215@eldorado.topf.org> References: <1350f7a40906280941y65c68fbby3b5cf0c5cb52932f@mail.gmail.com> <20090629061721.GA11215@eldorado.topf.org> Message-ID: <1350f7a40906290158j2983391n978c99eb437a7f6e@mail.gmail.com> On Mon, Jun 29, 2009 at 7:17 AM, Jochen Topf wrote: > Thought I'd post a quick problem I'm trying to solve here, in case you can > > help point me at a solution. Given a way retrieved from OSM, what would > be > > the best way of calculating its total length (in say, metres or > > kilometres)? Does this formula look like the right one?: > > > http://stackoverflow.com/questions/27928/how-do-i-calculate-distance-between-two-latitude-longitude-points > > Haven't checked the formula, but "great-circle distance" and "Haversine" > formula, are definitely right. > Thanks. Will investigate further. > > Second question: any chance we could include this method in the gem? :-) > > osmlib is for OSM related stuff, calculating great-circle distance or other > geometry functions should probably go into a geo library such as GeoRuby. Fair point. I'll check out what existing Ruby geo gems there are out there. Frankie -- Frankie Roberto Experience Designer, Rattle 0114 2706977 http://www.rattlecentral.com -------------- next part -------------- An HTML attachment was scrubbed... URL: