Recent

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

MarkMLl

  • Hero Member
  • *****
  • Posts: 6692
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: 1260
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: 1260
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

maurobio

  • Hero Member
  • *****
  • Posts: 623
  • Ecology is everything.
    • GitHub
Re: GIS Library for Lazarus
« Reply #33 on: May 09, 2023, 01:35:03 pm »
Hi,

I don't know if this is still of interest, but I have successfully used in a Lazarus/FPC application the library below (derived from Shapefile C Library, http://shapelib.maptools.org/):

https://web.archive.org/web/20070403193915/http://www.triplexware.huckfinn.de/shpapi.html

It is simple and fast.

Hope this helps.

Best regards,
UCSD Pascal / Burroughs 6700 / Master Control Program
Delphi 7.0 Personal Edition
Lazarus 2.0.12 - FPC 3.2.0 on GNU/Linux Mint 19.1, Lubuntu 18.04, Windows XP SP3, Windows 7 Professional, Windows 10 Home

 

TinyPortal © 2005-2018