[Gdal-dev] (no subject)
bryan at geomega.com
Wed Apr 25 12:35:10 EDT 2007
I did something like this recently but did not find a way to do it
without writing a short script or two. Here's what I did.
I put the polygons in a postgis database (which I needed to do anyway to
do some overlay operations). I output the polygons and their centroids
(for the labels) as separate kml files using ogr2ogr, and I wrote a
short script to combine those two kml files into one kml with the style
and labels set up the way I wanted.
In the end it might have been easier to script the whole thing (skipping
the ogr2ogr part) from one postgis sql that output the polygon and
centroid in the same record as kml. Were I starting from scratch I'd
try this approach, but I already had a script written to combine
multiple kml files into one.
Hope that helps.
Moskovitz, Bob wrote:
> Hello All,
> I have a quad map of California that is in a Shapefile. I converted
> this file into a KML file with ogr2ogr and displayed it in Google
> Earth. The quads are filled with white which blocks out the layers
> below. So after changing the style, I got a nice black grid and was
> able to view the other layers. What I want to do now is have the
> quad names display at the center of the quad. Reading the KML specs
> tells me that I have to add a POINT feature within the PLACEMARK tag.
> Rather then manually editing thousands of PLACEMARKs, I am hoping
> that there is an easier way to do it.
> Does anybody have any suggestions? Maybe in the future there can be
> a creation option for the KML format that would solve this problem :)
> CONFIDENTIALITY NOTICE: This communication is intended only for the
> use of the individual or entity to which it is addressed. This
> message contains information from the State of California, California
> Geological Survey, which may be privileged, confidential and exempt
> from disclosure under applicable law, including the Electronic
> Communications Privacy Act. If the reader of this communication is
> not the intended recipient, you are hereby notified that any
> dissemination, distribution, or copying of this communication is
> strictly prohibited.
> _______________________________________________ Gdal-dev mailing list
> Gdal-dev at lists.maptools.org
More information about the Gdal-dev