Opened 15 years ago
Last modified 4 years ago
#12416 new New feature
Improve KML Serialization
Reported by: | jbronn | Owned by: | |
---|---|---|---|
Component: | GIS | Version: | dev |
Severity: | Normal | Keywords: | gis kml 3d style rhr |
Cc: | Tyler Erickson | Triage Stage: | Accepted |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Pull Requests: | How to create a pull request | ||
Description (last modified by ) ¶
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 ofGEOSGeometry
andOGRGeometry
, ratherGeoQueryset.kml
should wrapST_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.
According to the ticket's flags, the next step(s) to move this issue forward are:
- To provide a patch by sending a pull request. Claim the ticket when you start working so that someone else doesn't duplicate effort. Before sending a pull request, review your work against the patch review checklist. Check the "Has patch" flag on the ticket after sending a pull request and include a link to the pull request in the ticket comment when making that update. The usual format is:
[https://github.com/django/django/pull/#### PR]
.
Change History (12)
by , 15 years ago
Attachment: | write_kml.diff added |
---|
comment:1 by , 15 years ago
Description: | modified (diff) |
---|
comment:2 by , 15 years ago
Cc: | added |
---|
comment:3 by , 15 years ago
comment:4 by , 15 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:5 by , 15 years ago
milestone: | 1.2 → 1.3 |
---|
This doesn't seem to be an actual bug, so I'm punting it off the milestone.
comment:7 by , 14 years ago
Severity: | → Normal |
---|---|
Type: | → New feature |
comment:4 by , 4 years ago
Owner: | removed |
---|---|
Status: | assigned → new |
Note:
See TracTickets
for help on using tickets.
(In [12349]) Added
reverse
andforce_rhr
methods toGeoQuerySet
. Refs #12416.