[gdal-dev] KML 2.2 in SVN Trunk
Dane Springmeyer
blake at hailmail.net
Fri Mar 7 16:19:13 EST 2008
Hi Chris,
Nice job on the update. I rebuilt from svn and have tested the kml
driver with several shapefiles sitting around.
I wonder if the -dsco NameField=RegionName switch should be made
mandatory now? If it is not specified the KML driver could return an
error prompting for -dsco NameField=RegionName or -dsco NameField=NO.
This seems relevant now that you've got the attributes in extended
data tags. The first shapefile I grabbed to test the driver did not
have a field called "Name" and I forgot to specify the correct field
to use with the -dsco switch. The impact of this is when the data was
opened in google earth and each placemark was without name tags the
extended data was unavailable. Essentially a double-click on the
feature in the "Places" view returned nothing, whereas once I
corrected my mistake, used the NameField switch, and re exported
everything worked as expected: Each KML feature had the value from my
field called "Road_Name" beside its icon a double-click on the
hyperlinked name revealed the extended data in a table within the GE
Balloon popup.
An alternative approach might be to simply have the driver fill the
name tag with something arbitrary like the schemaURL:
<name>OgrFilename</name> (if the NameField switch is not specified)
which would be placed just before <ExtendedData>. That way if a
feature really does not have a name it will still allow the feature
data to be available.
Thoughts?
Cheers,
Dane
On Mar 7, 2008, at 10:44 AM, Christopher Condit wrote:
> Hi All-
> I've checked in updates to the KML writing code to support KML 2.2 and
> enhancements. The most important change is that OGR will no longer
> create HTML CDATA for feature attributes. Instead, OGR writes out a
> layer schema for each layer (see
> http://code.google.com/apis/kml/documentation/kml_tags_beta1.html#schema
> ) and then references this schema when writing feature attributes (see
> http://code.google.com/apis/kml/documentation/kml_tags_beta1.html#schema
> data). The feature attributes appear as an HTML table in the info
> window. This is the correct way to carry type information for features
> in the KML 2.2 format.
> Next I'll have a look at updating the KML reader code to exploit the
> new
> schema elements in 2.2 and see what can be done about supporting OGR's
> feature style specification.
>
> Please let me know if you encounter any problems with the KML driver
> via
> trac...
> -Chris
>
> Christopher Condit
> condit at sdsc.edu
> 858-822-5483
> San Diego Supercomputer Center
> 9500 Gilman Drive
> La Jolla, CA 92093-0505
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
More information about the gdal-dev
mailing list