Comments (7)
Hi,
can you provide me the GPS track so that I can verify the calculation?
Marcus
from phpgeo.
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.
Hi,
the CSV file didn't make it through Github's email gateway ;-) Can you create a Gist for it?
Marcus
from phpgeo.
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.
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.
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.
Thanks a lot, Issue is resolved now.
from phpgeo.
Related Issues (20)
- Geofence from point HOT 1
- Polygon area calculation HOT 1
- It doesn't support multipolygon ? HOT 2
- Warning emitted for valid coordinates in CoordinateFactory HOT 2
- Feature: Simplify Polygon HOT 2
- "Longitude value must be numeric" bad exception HOT 4
- Library Use HOT 1
- Calculate cardinal direction distances between two coordinates HOT 2
- Division by zero in BearingEllipsoidal.php on line 206 HOT 5
- Find all objects within specific Distance HOT 2
- Add support for PHP 8.1
- Remove support for PHP 7.2
- Add deprecations for version 5.0
- PHP Fatal error: Uncaught Error: Class "Location\Coordinate" not found in ....
- Build errors in PHP 8.x
- Explanation of warning for non-geo wiz
- Point directions
- Point-to-line distance is incorrect sometimes HOT 6
- Merging multiple adjacent rectangles into one polygon
- Line::intersectsLine() is buggy HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from phpgeo.