Recent

Author Topic: convert kml file to gps  (Read 827 times)

folkeu08

  • Full Member
  • ***
  • Posts: 111
convert kml file to gps
« on: September 16, 2023, 11:06:18 am »
Hi Team,
I'm struggling a bit with the transformation of a klm file into GPS format.
For my software, I trace in geoportail the influence of the archaeological diagnosis in the "Web Mercato" format to be in the same coordinate format as OpenStreet Map.
I export the polygon points in a KML file format.
In Lazarus, I use the LazMapView library to display this diagnostic extent on the OpenStreetMap basemaps. Manually, it works with manual transformation of the file into GPS format.
The GPS file is a format taken from walkers' GPS to display their route.
I did a rewind but when converting the last line of coordinates, it gives me crap. It also adds the “Index” and “points” information to me.
I assume this is created by my end of file sign. You can see it when you use the reel.
I go through several steps to get to the GPS.
The shit is in my last Button_OnClick loop.
Do you have a clue because my loop does what I want but shit on the last line of the TStringlist.. The mouth starts on line 120 of the main_unit
The KML file to load is "Etion2.kml" for conversion.
THANKS
Fanch

paweld

  • Hero Member
  • *****
  • Posts: 1268
Re: convert kml file to gps
« Reply #1 on: September 16, 2023, 02:24:18 pm »
it's an xml file, so it's most convenient to read it with dedicated modules. Attached is an example using SAX.
For more information about xml: https://wiki.lazarus.freepascal.org/XML_Tutorial
Best regards / Pozdrawiam
paweld

folkeu08

  • Full Member
  • ***
  • Posts: 111
Re: convert kml file to gps
« Reply #2 on: October 01, 2023, 11:15:34 pm »
Hello paweld
I'm back from a trip and I'm going to resume the rest of the project. Thank you for your help.
I will now try to hard save the information for each footprint.
I have two possibilities for this:
 * Put the result of the conversion in a blob field of an SQLite database to reread the text for each requested display,
 * create a table containing all the attitude-longitude points.
To test the right method to use because for a diagnosis, several areas can be represented as in the case of a wind farm.
My 2 ideas may not be good, I'll see by testing.
I discover by creating to learn at the same time!
Thanks

 

TinyPortal © 2005-2018