Comments (8)
I would probably refactor DistanceCalculator and use instance of it instead static method.
Something like that:
$calculator = new DistanceCalculator($points);
$rawDistance = $calculator->getRawDistance();
$distanceWithAltitude = $calculator->getRealDistance()
Better ideas for method names?
from phpgpx.
Hi, nice idea. I am thinking of the implementation. If it's better to create a new attribute or create a configuration flag. What do you think?
Sorry for the later response, I was on holiday.
from phpgpx.
Well I guess it will be best if there is parallel property with calculated distance with included altitude. Right now in my project I'm using both of them. Distance with altitude to have real distance and Distance without altitude to calculate average grade between two points. :)
from phpgpx.
OK then :) Would you like to offer PR or I should do the implementation?
from phpgpx.
Hmm, sounds good to me. I am just not sure about changing API (I am not proud about the library versioning :D )
from phpgpx.
Well, isn't that DistanceCalculator for internal use only? If so, shouldn't be a problem.
from phpgpx.
Ahh I see, sorry. So then is not problem at all ;)
from phpgpx.
Implemented as realDistance
property in Route
, Segment
, Stats
, Track
objects.
from phpgpx.
Related Issues (20)
- Error when last trk point does not have a time set HOT 1
- Cumulative elevation loss HOT 2
- Implementing way point and creation time extensions HOT 1
- use custom trackpoint extension (in this case: Bad-Elf)? HOT 8
- Elevation string float becomes null in getJSON() call HOT 3
- cumulativeElevationLoss is missing in stats HOT 1
- Tag a new version HOT 3
- Error when $person->links is null HOT 2
- Should be 1.1.0 HOT 1
- startedAt and finishedAt values are not present if the first (or last) point is without timestamp
- Error installing with composer HOT 2
- cumulativeElevationGain and cumulativeElevationLoss not correct when missing parts of track with gps problem? HOT 10
- Class Error (Fatal error: Uncaught Error: Class "phpGPX\phpGPX" not found in) HOT 3
- [PR advise] Add coordinates for remarqued statistic points HOT 2
- phpGPX\Parsers\ExtensionParser::toXML(): Argument #1 ($extensions) must be of type phpGPX\Models\Extensions HOT 2
- Waypoints at the root of the gpx tag HOT 5
- Middlewares
- Removal of Summarizable and toArray HOT 2
- Minimum altitude is not necessarily the first point HOT 3
- Add version GPX
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 phpgpx.