Code Monkey home page Code Monkey logo

Comments (7)

mjaschen avatar mjaschen commented on May 28, 2024

Hi,

can you provide me the GPS track so that I can verify the calculation?

Marcus

from phpgeo.

v920749 avatar v920749 commented on May 28, 2024

Hi,

Thanks for replying.

Attached is csv file of real track data for one of my device.

Total distance traveled is confirmed to be > 135 Km You can check the
distance between first coordinate and last coordinate which is greater that
the total track length as per track getdistance.

Using track it comes out to be 97.2 KM with vincenty.

I tried to debug a bit and added echo to steps difference and I observed
that step distance was only upto three decimal places. I tried setting
precision in PHP.ini to 50 but still same. I have a feeling that this might
be summing up and causing the error

Thanks again for replying. Let me know if I can provide anything else for a
solution.

Regards

Amit Nagpal

On Thu, Mar 26, 2015 at 1:55 PM, Marcus Jaschen [email protected]
wrote:

Hi,

can you provide me the GPS track so that I can verify the calculation?

Marcus


Reply to this email directly or view it on GitHub
#5 (comment).

from phpgeo.

mjaschen avatar mjaschen commented on May 28, 2024

Hi,

the CSV file didn't make it through Github's email gateway ;-) Can you create a Gist for it?

Marcus

from phpgeo.

v920749 avatar v920749 commented on May 28, 2024

Ohh... its first time I am reporting an issue on Github

Anyway, First element in row is primary key of table.
Here is the gist

https://gist.github.com/v920749/4eb0568d51cac42316cd

Regards

Amit Nagpal

On Thu, Mar 26, 2015 at 3:38 PM, Marcus Jaschen [email protected]
wrote:

Hi,

the CSV file didn't make it through Github's email gateway ;-) Can you
create a Gist https://gist.github.com for it?

Marcus


Reply to this email directly or view it on GitHub
#5 (comment).

from phpgeo.

mjaschen avatar mjaschen commented on May 28, 2024

Hi,

I created a quick test and it gives me a total length of about 142 kilometres.

This script:

<?php

require_once __DIR__ . '/vendor/autoload.php';

$polyline = new \Location\Polyline();

$fh = fopen('gps_track.csv', 'r');

while (($data = fgetcsv($fh, 1000, "\t")) !== false) {
    if (is_null($data[0]) || is_null($data[1])) {
        continue;
    }
    $polyline->addPoint(new \Location\Coordinate($data[0], $data[1]));
}

fclose($fh);

printf("Number of points in track...%d\n", $polyline->getNumberOfPoints());
printf("Length of track.............%0.3f m\n", $polyline->getLength(new \Location\Distance\Vincenty()));

produces this output:

% php polyline_distance.php
Number of points in track...859
Length of track.............142181.131 m

Here ist the test data (it's exactly your CSV but with the first column removed).

from phpgeo.

mjaschen avatar mjaschen commented on May 28, 2024

Hi,

I'm using PHP 5.5 on OS X and different Linux systems:

% php -v
PHP 5.5.22 (cli) (built: Feb 19 2015 21:35:13)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies
    with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2015, by Zend Technologies
    with Xdebug v2.2.5, Copyright (c) 2002-2014, by Derick Rethans

Here are my PHP settings generated with php -i.

Maybe you can create a diff with your PHP settings to get a hint why your result is wrong.

Marcus

from phpgeo.

v920749 avatar v920749 commented on May 28, 2024

Thanks a lot, Issue is resolved now.

from phpgeo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.