#12416: Improve KML Serialization
---------------------------------+------------------------------------------
Reporter: jbronn | Owner: jbronn
Status: new | Milestone: 1.2
Component: GIS | Version: SVN
Resolution: | Keywords: gis kml 3d style rhr
Stage: Unreviewed | Has_patch: 0
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
---------------------------------+------------------------------------------
Changes (by jbronn):
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Old description:
> 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>`.
>
> 2. A Z value of 0 needs to be omitted for geometries that are purely 2D
> (this primarily affects the `GEOSGeometry.kml` property)
>
> 3. Allow specification of an `id` for geometries, so that styling rules
> may be easily applied by the user.
>
> 4. 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."
> [http://code.google.com/apis/kml/documentation/kmlreference.html#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.
New description:
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>`.
2. A Z value of 0 needs to be omitted for geometries that are purely 2D
(this primarily affects the `GEOSGeometry.kml` property)
3. Allow specification of an `id` for geometries, so that styling rules
may be easily applied by the user.
4. 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."
[http://code.google.com/apis/kml/documentation/kmlreference.html#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.
--
Ticket URL: <http://code.djangoproject.com/ticket/12416#comment:1>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.