Cruisers Forum
 


Join CruisersForum Today

Reply
 
Thread Tools Rate Thread Display Modes
Old 10-06-2010, 08:33   #1
Registered User
 
Netsurfer's Avatar

Join Date: Jan 2010
Location: Cologne, Germany
Boat: Beneteau Oceanis 331
Posts: 557
GPX Support in Version 2.1.0

Though there are some improvements from version 1.3.6 to 2.1.0 it still seems to be a little buggy.

Cause I have no idea of C++ I do not (fully) understand the code (in navutil.cpp e.g.). So I have to ask some questions first, to (hopefully) understand OCPN's handling of GPX data/ files afterwards :

  1. OCPN now adds an extensions section to each rte and trk section
    Code:
    <extensions>
                <opencpn:start></opencpn:start>
                <opencpn:end></opencpn:end>
                <opencpn:viz>1</opencpn:viz>
            </extensions>
    What is this needed for?
  2. OCPN adds an extensions section to each rtept and trkpt section
    rtept
    Code:
    <extensions>
                    <opencpn:prop>A,1,1,0,1</opencpn:prop>
                </extensions>
    trkpt
    Code:
    <extensions>
                        <opencpn:prop>A,1,0,0,1</opencpn:prop>
                    </extensions>
    What is this needed for? Especially as it always seems to be the same data?
I have downloaded the GPX file that Geoid96 has attached (Feature Requests) and imported it to OCPN. As a result all trackpoints were wrong (lat/lon). Just as an example:
Original version:
Code:
<trk>
    <name>MAY-23-10 03:13:42 PM</name>
    <trkseg>
      <trkpt lat="57.883771" lon="11.588074">
        <ele>19.36</ele>
        <time>2010-05-23T07:00:27Z</time>
      </trkpt>
      <trkpt lat="57.883770" lon="11.588076">
        <ele>14.08</ele>
        <time>2010-05-23T07:00:29Z</time>
      </trkpt>
      <trkpt lat="57.883770" lon="11.588076">
        <ele>11.19</ele>
        <time>2010-05-23T07:00:30Z</time>
      </trkpt>
After import:
Code:
<trk>
        <name>MAY-23-10 03:13:42 PM</name>
        <number>1276177151</number>
        <extensions>
            <opencpn:start></opencpn:start>
            <opencpn:end></opencpn:end>
            <opencpn:viz>1</opencpn:viz>
        </extensions>
        <trkseg>
            <trkpt lat="57,000000" lon="11,000000">
                <time>2010-05-23T07:00:27Z</time>
                <name></name>
                <sym>circle</sym>
                <type>WPT</type>
                <extensions>
                    <opencpn:prop>A,0,0,0,1</opencpn:prop>
                </extensions>
            </trkpt>
            <trkpt lat="57,000000" lon="11,000000">
                <time>2010-05-23T07:00:29Z</time>
                <name></name>
                <sym>circle</sym>
                <type>WPT</type>
                <extensions>
                    <opencpn:prop>A,0,0,0,1</opencpn:prop>
                </extensions>
            </trkpt>
            <trkpt lat="57,000000" lon="11,000000">
                <time>2010-05-23T07:00:30Z</time>
                <name></name>
                <sym>circle</sym>
                <type>WPT</type>
                <extensions>
                    <opencpn:prop>A,0,0,0,1</opencpn:prop>
                </extensions>
            </trkpt>
So something seems to go terribly wrong.

If there is any programmer out there (hi PjotrC ) willing to adjust/ correct the GPX handling I will support him as much as I can.

It might also be a better solution/ way of handling if all extensions sections would be eliminated on export.

And the other way around on import: Existing extensions sections should be deleted or replaced by OCPN's ones (if necessary).

IMHO the goal should be that OCPN is able to import any valid GPX file (which shouldn't be that hard to achieved, though unfortunately I am not able to do it by myself ).

Gunther
__________________

__________________
Deutschsprachige Community- und Support-Website unter OpenCPN.de
Netsurfer is offline   Reply With Quote
Old 10-06-2010, 09:01   #2
Marine Service Provider
 
bdbcat's Avatar

Join Date: Mar 2008
Posts: 4,878
Gunther....

Leaving the issue of Extensions for a moment....

1. Does the geoid96 track display properly on your system?

2. How did you generate the gpx output with "," (comma) separators? By GPX out, or by looking at navobj.xml?


Clearly the problem on output is "," and "." separator problem.

GPX standard is to use "." worldwide, and convert on input and output.

Maybe we are not properly converting on output?

Anyway, on US system, geoid96 track works fine, in and out.

Dave
__________________

__________________
bdbcat is offline   Reply With Quote
Old 10-06-2010, 09:13   #3
Registered User
 
Netsurfer's Avatar

Join Date: Jan 2010
Location: Cologne, Germany
Boat: Beneteau Oceanis 331
Posts: 557
Dave,
Quote:
Originally Posted by bdbcat View Post
1. Does the geoid96 track display properly on your system?
It is showed properly, but with the wrong lat/lon values.
Quote:
2. How did you generate the gpx output with "," (comma) separators? By GPX out, or by looking at navobj.xml?
By GPX out.

Quote:
Clearly the problem on output is "," and "." separator problem.

GPX standard is to use "." worldwide, and convert on input and output.

Maybe we are not properly converting on output?

Anyway, on US system, geoid96 track works fine, in and out.
You are right. The original file has "." as separator whereas the output file has ",".
But even though the file I use for import has "." as separator all lat/lon values are set to "xx.00.000".

Thanks for help,
Gunther
__________________
Deutschsprachige Community- und Support-Website unter OpenCPN.de
Netsurfer is offline   Reply With Quote
Old 10-06-2010, 09:22   #4
Senior Cruiser
 
idpnd's Avatar

Cruisers Forum Supporter

Join Date: Sep 2007
Location: Almerķa, ES
Boat: Chiquita 46 - Libertalia
Posts: 1,551
In the DE/Germany locale the decimal separator is "," perhaps that's the issue here..
__________________
sv Libertalia
idpnd is offline   Reply With Quote
Old 10-06-2010, 09:38   #5
Registered User
 
Netsurfer's Avatar

Join Date: Jan 2010
Location: Cologne, Germany
Boat: Beneteau Oceanis 331
Posts: 557
Quote:
Originally Posted by idpnd View Post
In the DE/Germany locale the decimal separator is "," perhaps that's the issue here..
Yes, it is ...

When I change the "." to "," in the original file and import it all works well.

So the question is how to avoid these problems with different locale settings?
Or would it be simply possible to set the correct (corresponding to the local setting) character on import?

Gunther
__________________
Deutschsprachige Community- und Support-Website unter OpenCPN.de
Netsurfer is offline   Reply With Quote
Old 10-06-2010, 10:11   #6
Senior Cruiser
 
idpnd's Avatar

Cruisers Forum Supporter

Join Date: Sep 2007
Location: Almerķa, ES
Boat: Chiquita 46 - Libertalia
Posts: 1,551
Quote:
Originally Posted by Netsurfer View Post
So the question is how to avoid these problems with different locale settings?
Or would it be simply possible to set the correct (corresponding to the local setting) character on import?
Whatever programme is exporting the data ought to adhere to the international gps convention (see dave's comment above) with a "."
__________________
sv Libertalia
idpnd is offline   Reply With Quote
Old 10-06-2010, 10:15   #7
Registered User
 
Netsurfer's Avatar

Join Date: Jan 2010
Location: Cologne, Germany
Boat: Beneteau Oceanis 331
Posts: 557
Quote:
Originally Posted by idpnd View Post
Whatever programme is exporting the data ought to adhere to the international gps convention (see dave's comment above) with a "."
Yes, I totally agree with you!

But the problem is when you are on a system with a local setting other than "." for the decimal point (e.g. like German) and you import a GPX file (with "." as decimal point) it is not recognized by OCPN and all values after the decimal point become "0".

And on export the "." is swapped by the character given by the local setting (e.g. "," for German).

Gunther
__________________
Deutschsprachige Community- und Support-Website unter OpenCPN.de
Netsurfer is offline   Reply With Quote
Old 10-06-2010, 11:45   #8
Marine Service Provider
 
bdbcat's Avatar

Join Date: Mar 2008
Posts: 4,878
Gunther....

We had problems with locale long ago. Was fixed at the time.

All this GPX stuff works fine on my XP system when set for German locale.
I never see "," on output of GPX. GPX input followed by output of same route to different name produces no ",", only "." as it should.

What system are you running? Anyone else running German locale seeing problems? What system?

Thanks
Dave
__________________
bdbcat is offline   Reply With Quote
Old 10-06-2010, 14:52   #9
Registered User
 
Netsurfer's Avatar

Join Date: Jan 2010
Location: Cologne, Germany
Boat: Beneteau Oceanis 331
Posts: 557
Dave,

Quote:
Originally Posted by bdbcat View Post
Gunther....

We had problems with locale long ago. Was fixed at the time.
Sorry about that - no malicious intent ...

Quote:
All this GPX stuff works fine on my XP system when set for German locale.
I never see "," on output of GPX. GPX input followed by output of same route to different name produces no ",", only "." as it should.

What system are you running?
Windows 7 Ultimate, 32 Bit

I looked at the settings for "Region and Language" which is set to German. There is an option (drop-down list) to set the decimal pointer - only item is ","!

I googled this topic and found several sites describing this problem. Only offered solution was to edit the files with an editor to the needed format ("." or ",").

Sorry for the inconvenience,
Gunther
__________________
Deutschsprachige Community- und Support-Website unter OpenCPN.de
Netsurfer is offline   Reply With Quote
Old 10-06-2010, 15:18   #10
Marine Service Provider
 
bdbcat's Avatar

Join Date: Mar 2008
Posts: 4,878
Gunther....

No bad intent taken. It was a real headbanger at the time, though.
Finally solved it by forcing opencpn to always use '.' for system library calls that care about locale.

So, I wonder why it is not working on your system? A mystery. Win7 issue, maybe?

Any other German or (',' instead of'.') users able to import and export GPX without error?

I'll google some....

Thanks
Dave
__________________
bdbcat is offline   Reply With Quote
Old 10-06-2010, 16:51   #11
Registered User
 
Viking Sailor's Avatar

Join Date: Nov 2006
Location: San Francisco Bay
Boat: Fantasia 35 - s/v Feeling Good
Posts: 1,074
Dave,

I found these three earlier discussions about numeric formats.

It is my understanding that OpenCPN should except any of the common formats for date, time, latitude, longitude, and speed. However, it only outputs latitude and longitude as decimal degrees using dot notation and cardinal points.

Paul



OpenCPN

OpenCPN Version 1.3.5 Beta Technical

OpenCPN Version 1.3.5 Beta Technical
__________________
Viking Sailor is offline   Reply With Quote
Old 10-06-2010, 17:48   #12
Marine Service Provider
 
bdbcat's Avatar

Join Date: Mar 2008
Posts: 4,878
Paul....
Thanks for the research. I remember the discussion now.

My question is:
Does GPX I/O work with "," locale for anyone except me? It does not work for Netsurfer. Anyone else?

Thanks
Dave
__________________
bdbcat is offline   Reply With Quote
Old 10-06-2010, 18:47   #13
Registered User

Join Date: Feb 2010
Location: On the go. Not in Prague.
Posts: 4,016
Quote:
Originally Posted by bdbcat View Post
Does GPX I/O work with "," locale for anyone except me?
Dave,
works here on Czech XP SP2 without any problems. I tried to switch the format settings and OCPN ignores it exactly as it should. Don't have any W7 machine handy, but maybe there will be some available tomorrow so I will try there.

Pavel
__________________
nohal is offline   Reply With Quote
Old 11-06-2010, 03:41   #14
Registered User

Join Date: Feb 2010
Location: On the go. Not in Prague.
Posts: 4,016
Dave,
just made a quick test on Czech Win7 and no ',' problem observed. Weird...

Pavel
__________________
nohal is offline   Reply With Quote
Old 11-06-2010, 04:16   #15
Registered User
 
Netsurfer's Avatar

Join Date: Jan 2010
Location: Cologne, Germany
Boat: Beneteau Oceanis 331
Posts: 557
Quote:
Originally Posted by nohal View Post
just made a quick test on Czech Win7 and no ',' problem observed. Weird...
That's really astonishing ...!

Even when I create a new route in OCPN and export it, the decimal separator in the file is a comma.

I wrote a blog entry on the German website to get some more users to try.

Gunther

PS: Maybe it is of interest for someone?
IBM-supplied country code defaults
__________________

__________________
Deutschsprachige Community- und Support-Website unter OpenCPN.de
Netsurfer is offline   Reply With Quote
Reply

Thread Tools
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
c-map support bobsadler Product or Service Reviews & Evaluations 6 11-09-2008 13:07



Copyright 2002- Social Knowledge, LLC All Rights Reserved.

All times are GMT -7. The time now is 02:14.


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

ShowCase vBulletin Plugins by Drive Thru Online, Inc.