Opened 9 years ago

Closed 9 years ago

#2481 closed enhancement (fixed)

support OGC KML 2.2.0 namespace

Reported by: tomkralidis Owned by: condit
Priority: normal Milestone: 1.6.0
Component: OGR_SF Version: svn-trunk
Severity: normal Keywords: ogc kml
Cc:

Description

Since KML was adopted by OGC (see http://www.opengeospatial.org/standards/kml), it would be valuable to support the OGC:KML 2.2.0 namespace, which is:

http://www.opengis.net/kml/2.2

...on both read and write operations.

Change History (5)

comment:1 Changed 9 years ago by tomkralidis

Type: defectenhancement

comment:2 Changed 9 years ago by tomkralidis

Further thoughts:

  • The following patch would appear (at least in namespace processing) to cover OGC:KML 2.2.0:
Index: kml.cpp
===================================================================
--- kml.cpp     (revision 14945)
+++ kml.cpp     (working copy)
@@ -251,6 +251,11 @@
                     ((KML *)pUserData)->validity = KML_VALIDITY_VALID;
                     ((KML *)pUserData)->sVersion_ = "2.2 (beta)";
                 }
+                else if(strcmp(ppszAttr[i + 1], "http://www.opengis.net/kml/2.2") == 0)
+                {
+                    ((KML *)pUserData)->validity = KML_VALIDITY_VALID;
+                    ((KML *)pUserData)->sVersion_ = "2.2";
+                }
                 else if(strcmp(ppszAttr[i + 1], "http://earth.google.com/kml/2.1") == 0)
                 {
                     ((KML *)pUserData)->validity = KML_VALIDITY_VALID;

comment:3 Changed 9 years ago by Even Rouault

Owner: changed from warmerdam to condit

Turning ticket to Chris, as it has apparently done most of the job (support for reading the Opengis NS and make it a default for output) in r14947.

Some remarks about the DSCO flag (nothing very clever !, but just to write a few things down) : The DSCO flag to control the NS output is interesting if we know that some existing common KML readers (older versions of GE for example ?) not to be able to the opengis NS. If we provide that DSCO flag it also means that we must be sure that the output we produce will also consistant with the KML version.

comment:4 Changed 9 years ago by condit

Status: newassigned

As Frank says, your patch proposition is now implemented in the trunk. *) On reading the KML driver treats the old Google Earth NS and the new OGC NS as valid. *) On writing the KML driver writes out the OGC NS (as this is now correct).

I'd be surprised if there are tools that are rigorously checking the ns attribute that aren't savvy enough to update to deal with the new namespace. If this becomes a problem we _could_ add a flag to omit the namespace, but I'm rather against that.

comment:5 Changed 9 years ago by Even Rouault

Milestone: 1.6.0
Resolution: fixed
Status: assignedclosed

Let's close the bug now. If the new OGC NS being the default is a problem for some tools, that will be worth a new ticket.

Note: See TracTickets for help on using tickets.