Google
Official Google Earth Download Site

Google Earth Community System Reliability: MEDIUM

Support and Answers >> KML Discussions (read only)

Jump to first unread post. Pages: 1
Kaaosa
Tourist


Reged: 01/19/06
Posts: 4
PHP KML generator
      #279744 - 01/19/06 08:50 AM

So, I downloaded GE last night, and I'm in love with it. So, I stayed up an extra two hours to build a PHP KML generator. It's a simple bit of PHP code that parses like a KML file and contains a function for generating placemarks. I have a little demo on my site at http://kaaosa.com/google. With the form, you can add a location to a MySQL database, which the KML generator (which you load into GE) reads. If you guys like it, I'll post a link to the PHP code.

Hope this sort of thing hasn't been posted a million times before.


Post Extras: Print Post   Remind Me!   Report this Post  
kaprchal
Tourist


Reged: 12/13/05
Posts: 19
Loc: Chicago/Austin TX
Re: PHP KML generator [Re: Kaaosa]
      #279797 - 01/19/06 09:50 AM

Thanks.

I would like to see the code, but where is this KML generator? Are you just referring to a network link?


Ken


Post Extras: Print Post   Remind Me!   Report this Post  
Kaaosa
Tourist


Reged: 01/19/06
Posts: 4
Re: PHP KML generator [Re: kaprchal]
      #279852 - 01/19/06 10:43 AM

The generator is located at http://kaaosa.com/google/gearth.php

The network link (http://kaaosa.com/google/gearth.kml) is used because that's the only way I know of to get the thing to refresh over time.

Source attached to post.


Post Extras: Print Post   Remind Me!   Report this Post  
Kaaosa
Tourist


Reged: 01/19/06
Posts: 4
Re: PHP KML generator [Re: Kaaosa]
      #279854 - 01/19/06 10:44 AM

Err, here's the source: http://kaaosa.com/google/gearth.txt

Post Extras: Print Post   Remind Me!   Report this Post  
vlex
First Post


Reged: 01/19/06
Posts: 1
Loc: eldritch, new england
Re: PHP KML generator [Re: Kaaosa]
      #279903 - 01/19/06 11:30 AM

hi there,

i saw that your submit form accepts input, but is there some way to jump to the results?

in other words, where is the resulting KML file?

Also, can you supply the PHP code? the link to the .txt file:
<http://kaaosa.com/google/gearth.txt> is NOT FOUND on your server.

I think it would be great if we could query MySQL and bundle the output into KML format...

I'd love to see your code, meanwhile, I might have to work on that idea!

regards, vlex


Post Extras: Print Post   Remind Me!   Report this Post  
Kaaosa
Tourist


Reged: 01/19/06
Posts: 4
Re: PHP KML generator [Re: vlex]
      #279978 - 01/19/06 12:59 PM

Yeah, I messed up the filename on the source code. It's fixed now and that link should work. The generated KML file is located at http://kaaosa.com/google/gearth.php

Post Extras: Print Post   Remind Me!   Report this Post  
BrianT
Tourist


Reged: 05/14/05
Posts: 104
Re: PHP KML generator [Re: Kaaosa]
      #280351 - 01/19/06 07:11 PM

Before pressing on with your project, check out the considerable work TJ's done in this realm--

http://kml.tjworld.net/


BT


Post Extras: Print Post   Remind Me!   Report this Post  
a666
Tourist


Reged: 02/01/06
Posts: 2
Loc: Tyrol
Re: PHP KML generator [Re: BrianT]
      #296298 - 02/01/06 01:31 AM

hi,

i am experiencing with PHP generated KML as well. for texting purposes i digitize points in Google Maps, send the result as a query string to a php file that translates this in KML. in Firefox anything works fine, but in MSIE 6 the file doesn't open in GE. note that i do not dump a file to the server in order to call it from there but i wriite it straight to the client.

i am doint this like that:

Code:
 <?php
header("Pragma: public"); // required
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private",false);
header("Content-Type: application/vnd.google-earth.kml+xml kml; charset=utf8");
echo <<<EOD
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.0">
<Document>
<name>some title</name>
<StyleMap id="MYGT_R

# ETC...



Firefox opens this directly in GE, MSIE recognizes this as XXXX.php and opens it in ... GoLive :-(

when i add another header line like

Code:
 header("Content-disposition: attachment; filename=geotraceSample.kml"); 



all i get in MSIE is the XML code displayed. adding a trailing URL string like &MSIE=.kml doesn't help either. (mime-types on the server ar set.)

i saw that the http://bbs.keyhole.com/ubb/download.php?Number=345 works fine, can someone point me to what's in there to make it work in MSIE?

thx, andré


Post Extras: Print Post   Remind Me!   Report this Post  
a666
Tourist


Reged: 02/01/06
Posts: 2
Loc: Tyrol
Re: PHP KML generator [Re: a666]
      #296331 - 02/01/06 02:11 AM

okay, i found a way (see below). but the "download/open/cancel" question from MSIE remains. the dowwnload.php from bbs.keyhole.com doesn't have this, what's the trick here?

Code:
# set $myKMLCode together as a string
$downloadfile="myKml.kml"; # give a name to appear at the client
header("Content-disposition: attachment; filename=$downloadfile");
header("Content-Type: application/vnd.google-earth.kml+xml kml; charset=utf8");
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".strlen($myKMLCode));
header("Pragma: no-cache");
header("Expires: 0");
echo $myKMLCode;
?>



Post Extras: Print Post   Remind Me!   Report this Post  
Pages: 1




Extra information
0 registered and 15 anonymous users are browsing this forum.

Moderator:  Hill, Jumble, jrohlf, Kempster, mcshea98, jeffryv, dulce, esterrett, regionator, NormB, Frank_McVey, geus, ZeroDeeFeX, LaBelleTerre, vagabondsailor, SupersonicBuddha, DWebb, BeadieJay, TheLedge, Cyclonic, no_stranger, LuciaM, tekgergedan, ManoM, cantarell, toponym2006, Noisette, danescombe, Michal_Drewniak, mutex, marinerfan, Delta102, bebop, MarkAubin 

Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled

Rating:
Topic views: 7417

Rate this topic

Jump to

earth.google.com    bbs.keyhole.com

*
UBB.threads™ 6.5.1.1