Cruisers Forum
 


Reply
  This discussion is proudly sponsored by:
Please support our sponsors and let them know you heard about their products on Cruisers Forums. Advertise Here
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 16-01-2025, 23:58   #1
Registered User

Join Date: Aug 2009
Location: Onboard, currently cruising in SE Asia
Boat: St. Francis 44 Mk II (Catamaran)
Posts: 259
Send a message via Skype™ to SoggyPaws
Help when an GPX file won't import

I was trying to import some old GPX files from a few years ago, in order to clean them up, so they are more presentable to share with others. (mainly adding the "Don't show if you zoom out, more than xxx")
This is an extension, in the waypoint gpx, which will automatically hide the waypoint if you zoom out more than 1:5 million). Helpful when you have a lot of waypoints (marks) in a small area:

[opencpn:scale_min_max UseScale="true" ScaleMin="5000000" ScaleMax="0" /]

Normally I open the gpx with a text editor and search and replace something like:
[opencpn:viz_name>1{/opencpn:viz_name]
with
[opencpn:viz_name]1[/opencpn:viz_name][opencpn:scale_min_max UseScale="true" ScaleMin="5000000" ScaleMax="0" /]

But my gpx files were from a non-OpenCPN source or so old OpenCPN didn't include those extensions in a normal waypoint.

So my plan was to import them into an empty OpenCPN database, and export them again, which adds the OpenCPN extensions.

But I tried and tried and neither file would import, and there was NOTHING in the OpenCPN log (or in a pop-up) that indicated the exact problem. Just a generic error message in the log that said "there was an error importing file filename. I also tried importing it as a Temporary Layer, and the layer showed up in the list with 0 items (and no error message).

I remembered an old GPX utility program, and opened the file with that. And lo and behold, it told me the exact line and column of the error, and an idea of what the error was.

One file had a non-UTF8 symbol in it (I think it was a smart quote) AND a random letter I had typed in somewhere it didn't belong while trying to play with the file. The other had [gpx] as the last line instead of [/gpx]

So, if you are having trouble importing a gpx and trying to figure out what the problem is GPX Editor might help you out. It is a tiny file, no installer, just run it from wherever. Can download it here:
https://sourceforge.net/projects/gpxeditor/

Developers... the source is there, would be nice if OpenCPN's import function would at least give you a clue (and would be nice to get an error message on the screen vs just nothing imports).

Note: Cruiser's forum apparently uses pointy brackets as code within the forum, so anything in gpx format with the pointy brackets disappears (even if you put CODE or HTML tags around it). So if you are trying to do this yourself in a gpx file, replace the square brackets above with pointy brackets.

Hope this helps someone else.
Sherry sv Soggy Paws
SoggyPaws is offline   Reply With Quote
Old 17-01-2025, 09:52   #2
Marine Service Provider
 
bdbcat's Avatar

Join Date: Mar 2008
Posts: 7,712
Re: Help when an GPX file won't import

Sherry...


Thank you so much for drilling down into this.
I will take a look at gpxeditor, and maybe we can adopt some of its error checking logic.


Dave
bdbcat is offline   Reply With Quote
Old 17-01-2025, 17:16   #3
Registered User

Join Date: Aug 2009
Location: Onboard, currently cruising in SE Asia
Boat: St. Francis 44 Mk II (Catamaran)
Posts: 259
Send a message via Skype™ to SoggyPaws
Re: Help when an GPX file won't import

Quote:
Originally Posted by bdbcat View Post
Thank you so much for drilling down into this.
I will take a look at gpxeditor, and maybe we can adopt some of its error checking logic.
Dave,
One other "nice to have" is to (optionally?) show a scrollable pop-up list of the waypoints that are being eliminated as "duplicates" on the screen.
Currently says "XX duplicates have been eliminated" without showing any details. No way to verify if the duplicate elimination is done correctly.

Would be nice for "XX duplicates have been eliminated, would you like to see the list?" and then have a pop-up where you can scroll the list (with copy ability for checking later?)

I took at peek at GPX Editor source. It's Pascal. Brings back memories!
Sherry
SoggyPaws is offline   Reply With Quote
Old 18-01-2025, 01:31   #4
Registered User

Join Date: Sep 2023
Location: Cruising
Posts: 570
Re: Help when an GPX file won't import

Also don't forget that ai can be a very powerful tool, perplexity won't accept xml but i changed an opencpn navobj to a txt, added an emoji and duplicated a waypoint then uploaded to perplexity (you need to log on to allow upload>
Q
"attached is an xml file. i want to import it into opencpn. list anything which might be an error for opencpn and list any duplicates. also give an overview of the data inside the file"

Ans>
Quote:
The attached XML file appears to be a GPX (GPS Exchange Format) file containing waypoint data for use with OpenCPN, a popular open-source navigation software. Here's an overview of the file contents and potential issues:
Overview
The file contains:
5 waypoints (wpt elements)
Waypoint coordinates (latitude and longitude)
Timestamps for each waypoint
Symbols and types for the waypoints
Extensions with OpenCPN-specific data
Potential Errors and Issues
Duplicate Waypoints: There are two waypoints with identical coordinates:
Latitude: 36.800560903
Longitude: -8.972856758
These duplicates may cause confusion in OpenCPN1
.
Invalid Symbol: One of the duplicate waypoints has an invalid symbol:
<sym>triangle��</sym>
The emoji (��) in the symbol name may not be recognized by OpenCPN and could potentially cause issues1
.
Inconsistent Naming: Only one waypoint has a name:
<name>my name</name>
While this isn't an error, it's inconsistent and may make identification difficult in OpenCPN1
.
Scale Min/Max Inconsistency: The waypoints have different scale_min_max settings:
Most waypoints: UseScale="false"
One waypoint: UseScale="true" ScaleMin="1000000" ScaleMax="0"
This inconsistency might affect how waypoints are displayed at different zoom levels1
.
Waypoint Range Rings: Only one waypoint has visible range rings:
<opencpn:waypoint_range_rings visible="true" number="1" step="0.100000001" units="1" colour="#FF0000" />
This inconsistency might affect how waypoints are displayed in OpenCPN1
.
Data Summary
Number of Waypoints: 5
Coordinate Range:
Latitude: 35.980824013 to 36.800560903
Longitude: -9.736611252 to -7.710756667
All waypoints are timestamped on 2025-01-18, between 08:10:51Z and 08:10:59Z
All waypoints have the type "WPT"
Most waypoints use the "triangle" symbol
While OpenCPN should be able to import this file, addressing the duplicate waypoints and the invalid symbol would be advisable to ensure smooth operation and accurate navigation data.
That's from Pro, but the free version still returned most of the above info with a bit less detail, free can have 5 pro searches per day
Opencpn imported the file renamed to .xml with "duplicates removed"
barcoMeCasa is offline   Reply With Quote
Reply

Tags
import

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help! GPX File Import Not Functioning reflectionsv37 OpenCPN 22 26-03-2018 17:57
GPX Route won't import AnchorageGuy OpenCPN 9 10-02-2015 12:55
.gpx import data error?? onehalfmoon OpenCPN 3 03-04-2013 07:24
Import GPX Tracks Crash Bluesipp OpenCPN 25 29-10-2011 01:20
How to Import gpx Tracks into MaxSea George64 Navigation 0 10-09-2010 16:56

Advertise Here


All times are GMT -7. The time now is 00:42.


Google+
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Social Knowledge Networks
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2025, vBulletin Solutions, Inc.

ShowCase vBulletin Plugins by Drive Thru Online, Inc.