Skip to content

triangulate output depending or order of input data #279

Closed

Description

@simolon

Description of the problem

It seems that the output of triangulate depends in some cases on the order of the data in the input table.

gmt triangulate -
cat  xxx.txt | gmt triangulate -R362000/382000/399500/419500 -I250 -Gunsrt.grd
gmt grd2xyz unsrt.grd > unsrt.xyz
sort xxx.txt | gmt triangulate -R362000/382000/399500/419500 -I250 -Gsrted.grd
gmt grd2xyz srted.grd > srted.xyz
diff -q srted.xyz unsrt.xyz 

Full error message

triangulate(core) 5.3.1 (r17229) [64-bit] - Optimal (Delaunay) triangulation and gridding of Cartesian table data
[...]
Files srted.xyz and unsrt.xyz differ

System information

  • Operating system:
    Debian GNU/Linux 9 (stretch)
  • Version of GMT:
    5.3.1 (r17229) [64-bit]

unsrt
srted

xxx.txt

Activity

  1. welcome commented on Jan 3, 2019

    @welcome

    👋 Thanks for opening your first issue here! Please make sure you filled out the template with as much detail as possible. We appreciate that you took the time to contribute!

  2. simolon commented on Jan 3, 2019

    @simolon
    Author

    I saw that the manually installed older GMT version produces the correct results.
    triangulate 4.5.18 [64-bit] - Optimal (Delaunay) triangulation of Cartesian xyz-data [Shewchuk]

    I now recompiled it with the other algorithm, and get similarly messed up results. Here it says:
    triangulate 4.5.18 [64-bit] - Optimal (Delaunay) triangulation of Cartesian xyz-data [Watson]

    Is that probably a known issue of the Watson algorithm? I guess this one is the one use in the Debian packaged version due to the public domain status?

  3. joa-quim commented on Jan 3, 2019

    @joa-quim
    Member

    It's not a known issue to us and I doubt that we will try to investigate/fix it. There are many more important things to do in GMT than to worry because Debian decided to build against Watson instead of Shewchuk. Sorry.

  4. simolon commented on Jan 3, 2019

    @simolon
    Author
  5. PaulWessel commented on Jan 4, 2019

    @PaulWessel
    Contributor

    I will try to look into this over the weekend but my plate is very full these days so no promises.

  6. simolon commented on Jan 4, 2019

    @simolon
    Author

    I will try to look into this over the weekend but my plate is very full these days so no promises.

    Thanks a lot for that, but don't sweat it, there is no urgent need for us now that we know about the problem, but once you got time it surely would be good to investigate this a bit further.

  7. PaulWessel commented on Jan 6, 2019

    @PaulWessel
    Contributor

    Closing this since the warning is now merged into master.

  8. simolon commented on Jan 7, 2019

    @simolon
    Author

    Hi Paul and Joaquim,

    sorry to post into this closed thread, but I just figured out what the real problem seems to be. We missed to spot that there were duplicate lines in some of our input files. This seems to be the culprit, having identical x/y pairs in the input data. The sorting in some cases fixed it, but in some other cases caused the error to manifest while the unsorted ones worked.

    So the warning when unsorted is in fact unnecessary, and rather should be an error when duplicate x/y pairs are found.

    Sorry for your troubles... and thanks for your great work.

  9. added a commit that references this issue on Jan 7, 2019
  10. added a commit that references this issue on Jan 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions