[postgis-users] Write out KML for each database record?

Jason Birch Jason.Birch at nanaimo.ca
Wed Oct 24 16:52:39 PDT 2007


Hi Dane,
 
That's pretty cool stuff.  You can even paste your KML right into Google Maps and display it in 2D fairly easily.  You can create links to this from your page with a simple:
 
http://maps.google.com/?q=http://dev.riverchange.org/kml/457.kml  (for instance)
 
There are lots of cool things you could do with PostGIS on the back end, like set up a network link to a PHP script that does a bounds request and returns all of the features from within those bounds when the width/height are within a certain tolerance.  This works well-enough in Google Earth and also in Maps.  For better performance in Google Earth, you could create a "master" kml file, which has network links to each of the polygons with Regions associated with them so that they are only fetched when in close-proximity.  If you returned the bounding coordinates for each geometry in your query, you could actually be generating this at the same time as you are generating your individual files, building it up one-link for each iteration through the record set.
 
Couple things:
 
- doesn't look like names are showing up correctly yet...
 
- your server doesn't appear to be configured with the correct MIME-type for KML files.  Without this in place, many browsers (OK, well at least IE) will just display the XML
 
Jason

________________________________

From: Dane Blakely Springmeyer
Subject: Re: [postgis-users] Write out KML for each database record?

I've now written a SQL query that creates a relative http link within 
respective database rows that points to those kml files.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: winmail.dat
Type: application/ms-tnef
Size: 5332 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20071024/44d349b5/attachment.bin>


More information about the postgis-users mailing list