Skip to main content
Solved

Save polygon as gpx

  • October 29, 2024
  • 6 replies
  • 160 views

marta.podsiad
Supporter
Forum|alt.badge.img+9

Hi,

I’m trying to save a polygon as a GPX track and am running into an issue. Here’s what I’ve done so far:

  1. Converted the polygon to a line using GeometryCoercer
  2. Reprojected to EPSG:4326
  3. Created track_id, source, and name attributes

The translation completes successfully, but when I try to open it, I only see the attributes and no geometry. Any idea what I might be doing wrong?

 

2024-10-29 11_22_11-Window.png

Best answer by nielsgerrits

I tried to reproduce this and it works as expected.

Any errors in the log?

Maybe the source crs is not correct?

Working sample attached.

 

View original
Did this help you find an answer to your question?

6 replies

jobvdnoort
Supporter
Forum|alt.badge.img+10
  • Supporter
  • October 29, 2024

Hi Marta,

 

I see you try to write it to a GPX, readable by garmin (for example)?

I think to make this work, you also need the TrackPoints that come with a GPX normally.  

See my attached example :) 

 

 


nielsgerrits
VIP
Forum|alt.badge.img+54
  • Best Answer
  • October 29, 2024

I tried to reproduce this and it works as expected.

Any errors in the log?

Maybe the source crs is not correct?

Working sample attached.

 


nielsgerrits
VIP
Forum|alt.badge.img+54

Ah, this is caused by the attribute track_id. From the documentation.

WayPoint features must have point geometry, or they will be ignored. The elevation attribute on WayPoint features will be ignored. Instead, the z-value of the point geometry will be used.

Route and Track features are handled according to the following process:

  1. If the Route / Track has a route_id / track_id attribute, its geometry will be ignored. The route / track geometry will be written out based on the RoutePoint / TrackPoint features which share the same route_id / track_id value.
  2. If the Route / Track has no route_id / track_id attribute, the geometry will be split up into RoutePoint / TrackPoint features. These point features will have no attribution.

Adding the trackpoints with the same track_id will solve the issue, as mentioned by @jobvdnoort 


marta.podsiad
Supporter
Forum|alt.badge.img+9
  • Author
  • Supporter
  • October 29, 2024

I have managed to save the polygon as gpx and it looks fine in FME. But when added to gps I have odd lines. Images attached. Why do I have that extra lines?


nielsgerrits
VIP
Forum|alt.badge.img+54
marta.podsiad wrote:

I have managed to save the polygon as gpx and it looks fine in FME. But when added to gps I have odd lines. Images attached. Why do I have that extra lines?

How did you do this? Using Track only or Track and TrackPoints? Because if you use TrackPoints, the geometry of track will be ignored and the track is build from the trackpoints. Because of this the order of the trackpoints entering the writer does matter.


marta.podsiad
Supporter
Forum|alt.badge.img+9
  • Author
  • Supporter
  • October 30, 2024

I have removed Points and it worked with Track only


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings