I've prepared my GPS data from my Gramin Forerunner 301 according to the instructions at
http://codex.gallery2.org/index.php/Gallery2:Modules:Gps
For testing purposes, the GPS data is attached.
When pressing the export button on the "Export to Google Earth Page",
http://www.brics.dk/~chris/gallery2/main.php?g2_view=map.GoogleEarthAlbum&g2_itemId=14742
a file containing the following error message is downloaded:
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.0">
<Folder>
<name>gps test</name><br />
<b>Fatal error</b>: Call to undefined function curl_init() in <b>/web/chris/public_html/gallery2/modules/map/GoogleEarthAlbum.inc</b> on line <b>113</b><br />
The same error occurs when not using any GPS data at all.
Any help greatly appreciated!
Gallery version = 2.0.2+ core 1.0.10
PHP version = 4.3.11 apache2handler
Webserver = Apache
Database = mysql 4.1.10a-max
Toolkits = ArchiveUpload, Exif, NetPBM, Thumbnail, ImageMagick
Operating system = Linux gorm 2.6.9-22.0.2.ELsmp #1 SMP Thu Jan 5 17:13:01 EST 2006 i686
Browser = Mozilla/5.0 (X11; Linux i686; U; en) Opera 8.51
Google Map Module 0.5.0g 0.5.0g Show item on a Google Map Using the API
http://www.brics.dk/~chris/gallery2/phpinfo.php
Posts: 1894
I think there was a report that the curl_init() function ins't a very good choice as it's relying on some library to be installed on the Server. I also think that there was a solution for it.
I'll dig in a bit and let you know (unless someone else finds it faster) ;-)
See you !
-------------------------
The Termite
Posts: 364
Just comment out (put two slashes in front of each line '//') the curl
section from the GoogleEarthAlbum.inc file. Should be about line 109-120.
$u='http://pingomatic.com/ping/?title=' . urlencode($child->getTitle()) . '&blogurl=' . urlencode(str_replace('&', '&', $urlGenerator->generateUrl (array ( 'view' => 'core.ShowItem', 'itemId' => $child->getId()), false))) . '&chk_geourl=on&chk_a2b=on'; $ch = curl_init ($u); $devnull = fopen ('/dev/null', 'w'); curl_setopt ($ch, CURLOPT_FILE, $devnull); curl_exec ($ch); curl_close ($ch); fclose ($devnull);I think it will have no impact on the outcome... other than
gettin' rid of the error you are experiencing.
Posts: 11
I commented out these lines and indeed, an almost correct file is produced. The only problem is that the URL is not generated correctly. Here is an extract:
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.0">
<Folder>
<name>gps test</name><Placemark><name>SkanderborgTrip_151</name>
<description><![CDATA[<a href="main.php?g2_itemId=15563">
<img src="main.php?g2_view=core.DownloadItem&g2_itemId=15564&g2_serialNumber=2"></a>]]></description>
<LookAt><longitude>9.935349</longitude><latitude>56.046424</latitude><range>300</range><tilt>45</tilt><heading>47.796584629396</heading></LookAt>
<styleUrl>root://styleMaps#default+nicon=0x307+hicon=0x317</styleUrl><Style><IconStyle><Icon><href>root://icons/palette-4.png</href><x>192</x><y>96</y><w>32</w><h>32</h></Icon></IconStyle></Style>
<Point><extrude>0</extrude>
<tessellate>0</tessellate>
<altitudeMode>clampToGround</altitudeMode>
<coordinates>9.935349,56.046424,0</coordinates>
</Point>
</Placemark>
Instead of just "main.php?..." it should prodcue "http://www.brics.dk/~chris/gallery2/main.php?..."
I could resolve this by manually add the correct URL into the GoogleEarthAlbum.inc file, but I guess this is not the way it should be done in general...
Posts: 11
Hi Termite
I'd like to know what curl_init() is good for and am certaintly interested if there's a solution around.
Thx a lot!
Chris
Posts: 364
curl_init - probably something (I'm not sure); but, since this works
without it . . .
solution - get and install curl on your system
URL - try this change (I have not tried it on the original file that
you are probably using; but it might work):
current code (with line numbers that might be accurate):
125 echo $urlGenerator->generateUrl (array ( 126 'view' => 'core.ShowItem', 'itemId' => $child->getId()), false); 127 echo "\">\r\n<img src=\"" . str_replace('&', '&', $urlGenerator->generateUrl (array ( 128 'view' => 'core.DownloadItem', 'itemId' => $source[$child->getId()]->getId(), 129 'serialNumber' => $source[$child->getId()]->getSerialNumber()), 130 false));changed code:
125 echo $urlGenerator->generateUrl (array ( 126 'view' => 'core.ShowItem', 'itemId' => $child->getId()), array('forceFullUrl' => true)); 127 echo "\">\r\n<img src=\"" . str_replace('&', '&', $urlGenerator->generateUrl (array ( 128 'view' => 'core.DownloadItem', 'itemId' => $source[$child->getId()]->getId(), 129 'serialNumber' => $source[$child->getId()]->getSerialNumber()), 130 array('forceFullUrl' => true)));Posts: 1894
I have not created that code persoannly, it was a separate module at first and we decided to merge them both to propose a complete solution.
I have to say that the Google Earth part of the module has gotten a lot less attention and I can honestly say that I have not tested it and i'm not sure how it works
What I can say is that CURL (Client URL) is a php library that let you communicate with servers in different protocols ... other than that I would need to look at the code in more details to understand what's it trying to do
Galmoid seems to have a better grip than me....
Sorry about that !
-------------------------
The Termite
Posts: 11
Very nice! Thanks a lot for the support, Galmoid! Works perfectly now.
also to Termite: I hope these points will incorporated into the next release of the module.
Posts: 1894
They are not, but it's just a matter of minutes. I will add those changes before releasing tonight ;-)
Posts: 364
Termite,
Remove the curl stuff and we will no longer need to try and
explain anything about it (which we don't know anyway).
Posts: 1894
Well for some strange reason I already have Curl crap removed ....
I'm not gonna wonder and just go on with releasing

-------------------------
The Termite
Posts: 11
Just had a quick glance at the new new release 0.5.1a.
The GoogleEarthAlbum.inc changed quite a bit to the last version, but is, again, not working properly. The export-URLs are fixed to http://www.eansk.com/esgallery/
Probably someone else who hacked around the bug in the same way as I did.
I also experienced problems uploading the GPS data, the result is not satisfying, the coordinates are wrong.
I recommend using the GoogleEarthAlbum.inc from the last release with the changes indicated by galmoid in this thread.
Posts: 1894
I guess I should have looked further when I realized that the changes were already "done" ... as it turn out I had put a new file sent to me with corrections at the time but I still have no way to test this so I just "assume" it was correct ...
Well, it will be time for "b" versions
See you !
-------------------------
The Termite
Posts: 364
I am curious... did you try to upload a gpx file? Was the gpx file used?
Please answer that question if you can. I believe the gpx file might
match gpx timestamps to pic timestamps... so in the final kml file pics
that do not have coodinates assigned in the database but have matching
timestamps would be plotted.
I think a version of this file that was being attempted which would allow
for it's use without the need for a gpx file managed to find it's way
past our rigorous testing and release procedures. I assure you, our pre-release
manager will be... nevermind.
All, I think, pretty easy to deal with. I'll try.
Have you tried using the old file with the new release?
Posts: 11
just a quick answer before i do further tests tonight.
Using the old GoogleEarthAlbum.inc with the changes you suggested worked fine!
Posts: 364
I am still curious to know the answers to the question(s) I posed; but,
)
here is another GoogleEarthAlbum.inc file to try out (since you're in
a testing mood
EDIT: Deleted the attacment. See newer post below for this file.
Posts: 11
OK, I've tested three versions of GoogleEarthAlbum.inc, the outputs are attached.
1. the old version from release 0.5.0g with the changes you indicated above works fine.
2. the new version from release 0.5.1a produces incorrect urls, but seems to work fine combining the gps data with the time stamps of the pictures
3. the version you've send me corrects this problem but mixes up longitudes and latitudes. Exchanging the two variables on lines 88 and 89 solves this problems and makes this the preferable version of the file!
Thanks a lot, Galmoid and Termite!
Posts: 1894
So which version should be put in the module, I'm all confused
The version sent by Galmoid + change to invert the coordinates ?
-------------------------
The Termite
Posts: 11
Yes, if you ask me, but Galmoid should have the final word.
Posts: 364
OK. I made the correction for the reversed coordinates (Thank You).
New file attached here.
Huebli, please make sure it works for us before Termite goes ahead with it's incorporation. Thank You.
Posts: 11
seems to work fine with me!
Thank you all!
Posts: 1894
Great so that I will put the new files in the 0.5.1b & 0.4.11b

-------------------------
The Termite