Opened 15 years ago

Closed 12 years ago

#1096 closed defect (fixed)

<coordinates> tag in generated KML does not follow spec

Reported by: jcarranz Owned by:
Priority: medium Milestone: 2.2
Component: KML Service Version: 2.1.0
Severity: minor Keywords:
Cc: External ID:

Description

Generating KML of the Sheboygan parcels layer results in KML which resembles the following:

<LinearRing>
<coordinates>
-87.728935, 43.747964, 0.000000,
-87.728934, 43.748081, 0.000000,
-87.728159, 43.748827, 0.000000,
-87.728144, 43.748841, 0.000000,

KML spec states: Four or more tuples, each consisting of floating point values for longitude, latitude, and altitude. The altitude component is optional. Do not include spaces within a tuple. The last coordinate must be the same as the first coordinate. Coordinates are expressed in decimal degrees only.

XYZ values should not have a space trailing commas and coordinates should not be separated by commas. This behaves correctly in Google Earth but fails in other KML parsing libraries.

Attachments (1)

Point.kml (437 bytes ) - added by tomfukushima 15 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 by tomfukushima, 15 years ago

Milestone: 2.2
Resolution: fixed
Status: newclosed

r4232 for 2.2

Although this ticket is low priority I made the change because it is quite simple and innocuous.

Removed the spaces from all of the coordinates generated from the KML renderer.

Tested by viewing polygon, line and point data in Google Earth before the change and then viewing it again after the change.

comment:2 by jbirch, 15 years ago

Tom, do you have a copy of the post-change output from all three calls? I'd like to run it through a KML validator to make sure there's nothing else missing.

by tomfukushima, 15 years ago

Attachment: Point.kml added

comment:3 by tomfukushima, 15 years ago

Sure, I copied what Fiddler recorded and attached it.

comment:4 by tomfukushima, 15 years ago

Sorry, some of the data was not for redistribution so I have deleted it.

comment:5 by jbirch, 15 years ago

Resolution: fixed
Status: closedreopened

Before the examples had to be pulled, I think I saw coordinates that looked like:

x,y,z, x,y,z, x,y,z

Though this is not tightly defined for KML 2.1, this is not the format used in any of the official guides or best practices, and the 2.2 spec defined this more tightly as:


16.9 kml:coordinatesType

16.9.1 Description

String representing one or more coordinate tuples, with each tuple consisting of decimal values for geodetic longitude, geodetic latitude, and altitude. The altitude component is optional. The coordinate separator is a comma and the tuple separator is a whitespace. Longitude and latitude coordinates are expressed in decimal degrees only.


I think that this means that the coodinates should look like:

x,y,z x,y,z x,y,z

or

x,y,z x,y,z x,y,z

If it's easy to drop the trailing comma on each coordinate, I'd encourage this fix.

comment:6 by jng, 12 years ago

Resolution: fixed
Status: reopenedclosed

Fixed trunk (r6837) and 2.4 (r6836)

Note: See TracTickets for help on using tickets.