Opened 7 years ago

Last modified 5 years ago

#12416 assigned New feature

Improve KML Serialization

Reported by: jbronn Owned by: jbronn
Component: GIS Version: master
Severity: Normal Keywords: gis kml 3d style rhr
Cc: tylere Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by jbronn)

Currently, there are several problems with the way KML is generated inside GeoDjango:

  1. 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>.
  1. A Z value of 0 needs to be omitted for geometries that are purely 2D (this primarily affects the GEOSGeometry.kml property)
  1. Allow specification of an id for geometries, so that styling rules may be easily applied by the user.
  1. 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.

Attachments (1)

write_kml.diff (2.1 KB) - added by jbronn 7 years ago.

Download all attachments as: .zip

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:2 Changed 7 years ago by tylere

  • Cc tylere added

comment:3 Changed 7 years ago by jbronn

(In [12349]) Added reverse and force_rhr methods to GeoQuerySet. Refs #12416.

comment:4 Changed 7 years ago by russellm

  • Triage Stage changed from Unreviewed to Accepted

comment:5 Changed 6 years ago by ubernostrum

  • milestone changed from 1.2 to 1.3

This doesn't seem to be an actual bug, so I'm punting it off the milestone.

comment:6 Changed 5 years ago by jbronn

  • milestone changed from 1.3 to 1.4
  • Status changed from new to assigned

Punting again.

comment:7 Changed 5 years ago by mattmcc

  • Severity set to Normal
  • Type set to New feature

comment:8 Changed 5 years ago by jacob

  • milestone 1.4 deleted

Milestone 1.4 deleted

comment:2 Changed 5 years ago by aaugustin

  • UI/UX unset

Change UI/UX from NULL to False.

comment:3 Changed 5 years ago by aaugustin

  • Easy pickings unset

Change Easy pickings from NULL to False.

Note: See TracTickets for help on using tickets.
Back to Top