Jump to content

GPX Library for PHP


Tungmar

Recommended Posts

Hello

 

I'm writing a little helper script in PHP which should also create GPX files whit the Groundspeak extension to store geocache descriptions. I could not find a library which is able to write such GPX files. Does any one know one?

 

Thank you!

Link to comment
14 hours ago, Tungmar said:

Hello

 

I'm writing a little helper script in PHP which should also create GPX files whit the Groundspeak extension to store geocache descriptions. I could not find a library which is able to write such GPX files. Does any one know one?

 

Thank you!

 

A GPX file for a geocache is just an XML file which complies with the GPX schema with Groundspeak extensions.   A PHP library which converts structured data (an associative array, results of a relational database query) to XML would do the job.  

Link to comment
18 hours ago, Tungmar said:

Thank you for your answer. I know that is possible. I was hoping there is one which would ease the process. No need to reinvent the wheel :-)

Sorry that I can't help more.  Although I've done a fair amount of programming in PHP I'm primarily a Java and Ruby programmer.  How are you managing your data that you'll use to create a GPX file?  You might want to take a look at GPS Babel, which is what GSAK uses under the hood.  It supports a lot of different formats and could be used, for example, to transform a CSV file to GPX.   You could make a system call with PHP to invoke gpxbabel.exe (it only runs on windows) with the necessary parameters.

Link to comment

Good idea whit GPSbabel! And it ia available for all kinds of platforms.

However, it does not support the SQLite database where the data currently is stored. So I would need to export it any way (even to a simpler format). I probably will just write a export directly to GPX.

Tank you for your help.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...