Comments (2)
With the AbstractExtension update I get this XML (extensions is empty):
<?xml version="1.0" encoding="UTF-8"?>
<gpx xmlns="http://www.topografix.com/GPX/1/1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.1" creator="phpGPX/1.2.1" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd">
<metadata>
<time>2023-04-25T18:11:34+00:00</time>
</metadata>
<trk>
<name>2023-04-25 20:11:34 - 2023-04-25 20:25:08</name>
<trkseg>
<trkpt lat="42.3591" lon="-7.86783">
<time>2023-04-25T18:11:34+00:00</time>
<extensions/>
</trkpt>
<trkpt lat="42.3588" lon="-7.86811">
<time>2023-04-25T18:11:54+00:00</time>
<extensions/>
</trkpt>
<trkpt lat="42.35839" lon="-7.86861">
<time>2023-04-25T18:12:04+00:00</time>
<extensions/>
</trkpt>
<trkpt lat="42.35818" lon="-7.86904">
<time>2023-04-25T18:12:14+00:00</time>
<extensions/>
</trkpt>
<trkpt lat="42.35774" lon="-7.86901">
<time>2023-04-25T18:12:24+00:00</time>
<extensions/>
</trkpt>
<trkpt lat="42.35754" lon="-7.86892">
<time>2023-04-25T18:12:34+00:00</time>
<extensions/>
</trkpt>
<trkpt lat="42.35714" lon="-7.8685">
<time>2023-04-25T18:12:43+00:00</time>
<extensions/>
</trkpt>
from phpgpx.
Ok, I found the correct code :)
I couldn't find any documentation on how to use Extensions
:(
/**
* @param \App\Domains\Position\Model\Position $position
*
* @return \phpGPX\Models\Point
*/
protected function point(PositionModel $position): Point
{
$point = new Point(Point::TRACKPOINT);
$point->latitude = $position->latitude;
$point->longitude = $position->longitude;
$point->time = $position->date_at;
$trackPointExtension = new TrackPointExtension();
$trackPointExtension->speed = $position->speed;
$trackPointExtension->course = $position->direction;
$extension = new Extensions();
$extension->trackPointExtension = $trackPointExtension;
$point->extensions = $extension;
return $point;
}
from phpgpx.
Related Issues (20)
- Statistics - get Bounds of the GPX Routes HOT 15
- Track Stats not calculated when first segment contains no data
- minAltitude seems to be missing/null if any points do not have an elev tag HOT 1
- Error when TrkSeg is empty HOT 1
- Distance calculator - add altitude in formulas HOT 8
- 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
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.