Improve KML Serialization
|Reported by:||jbronn||Owned by:||jbronn|
|Severity:||Normal||Keywords:||gis kml 3d style rhr|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Description (last modified by jbronn)
Currently, there are several problems with the way KML is generated inside GeoDjango:
- Now that 3D is supported, there is no way to specify the following element tags, which are important to displaying them in Google Earth: <altitudeMode>, <extrude>, and <tessellate>.
- A Z value of 0 needs to be omitted for geometries that are purely 2D (this primarily affects the GEOSGeometry.kml property)
- Allow specification of an id for geometries, so that styling rules may be easily applied by the user.
- For polygons: "the <coordinates> for polygons must be specified in counterclockwise order. Polygons follow the "right-hand rule," which states that if you place the fingers of your right hand in the direction in which the coordinates are specified, your thumb points in the general direction of the geometric normal for the polygon." KML Reference. I'm not sure about implementing this within the 'dumb' kml properties of GEOSGeometry and OGRGeometry, rather GeoQueryset.kml should wrap ST_AsKml in the necessary routines, e.g., ST_Reverse(ST_ForceRHR(ST_AsKml(the_geom))).
Attached is an initial idea for a write_kml routine.
Change History (11)
Changed 7 years ago by jbronn
comment:1 Changed 7 years ago by jbronn
- Description modified (diff)
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
comment:6 Changed 5 years ago by jbronn
- milestone changed from 1.3 to 1.4
- Status changed from new to assigned