Recent

Author Topic: GIS Library for Lazarus  (Read 11470 times)

MarkMLl

  • Hero Member
  • *****
  • Posts: 5862
Re: GIS Library for Lazarus
« Reply #30 on: October 08, 2022, 10:26:48 pm »
So, is this an issue with WGS84.pas, or am I misunderstanding something about GIS coordinates?  I have no survey training, so this latter is a real possibility.

In the interest of resolving this relatively quickly, I would suggest that a question on gis.stackexchange.com phrased like "I am using a software library which appears to use this sign convention: is this compliant with WGS84?" is in order.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Mike.Cornflake

  • Hero Member
  • *****
  • Posts: 1256
Re: GIS Library for Lazarus
« Reply #31 on: October 08, 2022, 11:21:27 pm »
It seems to me that it is necessary to check the formulas for the use of x and y.

Nice.  I see what you're saying now.  Thanks

OK, I'll start trying to debug WGS84.pas.
Lazarus Trunk/FPC Trunk on Windows [7, 10]
  Have you tried searching this forum or the wiki?:   http://wiki.lazarus.freepascal.org/Alternative_Main_Page
  BOOKS! (Free and otherwise): http://wiki.lazarus.freepascal.org/Pascal_and_Lazarus_Books_and_Magazines

Mike.Cornflake

  • Hero Member
  • *****
  • Posts: 1256
Re: GIS Library for Lazarus
« Reply #32 on: October 10, 2022, 05:03:22 am »
Got to the bottom of the oddities I saw.  Don't understand the why, but it's deliberate code in two spots.  Here's one.

Code: Pascal  [Select][+][-]
  1.   if UTM.southhemi then UTM.Y:=UTM.Y*-1;
  2.  
  3.   // reversal of UTM-X and UTM-Y to geodetic orientation
  4.   // kasta om UTM-X och UTM-Y till geodetisk orientering
  5.   t := UTM.X;
  6.   UTM.X := UTM.Y;
  7.   UTM.Y := t;

Original comment is in swedish.  I've used Google Translate to convert the commments.  Based on that I've added a property: TWGS88.IgnoreGeodeticOrientation.  It's false by default, which leaves the existing code to run.  Setting it True though stops the above conversion.   All values are now as I expect them.
Lazarus Trunk/FPC Trunk on Windows [7, 10]
  Have you tried searching this forum or the wiki?:   http://wiki.lazarus.freepascal.org/Alternative_Main_Page
  BOOKS! (Free and otherwise): http://wiki.lazarus.freepascal.org/Pascal_and_Lazarus_Books_and_Magazines

 

TinyPortal © 2005-2018