CesiumGS / CesiumGS/cesium

KML Support

Open
#873 85 comments 0 reactions 0 assignees View on GitHub
category - kml type - roadmap
Dominant language
JavaScript
Stars
15.7k
Forks
3.9k
Avg merge
4d 6h
Merged PRs (30d)
34

Description

This issue has been heavily edited since Andre's original write-up and is now maintained by @mramato.

The initial KML implementation was started as part of the 2013 Google Summer of Code and resulted in many core features being implemented by @andre-nunes in his [branch](https://github.com/andre-nunes/cesium/tree/kml). Current work is taking place in the [kml branch](https://github.com/AnalyticalGraphicsInc/cesium/tree/kml) of the official Cesium repository. Since KML is a large specification, the plan is to implement what we see as the minimum viable product first and officially release that as part of Cesium. We will then continue to add additional functionality on a feature by feature basis with each Cesium release.

The below task list tries to capture everything at a fairly high level for each phase. There are many hidden features and requirements here and listing them all isn't useful. For example, we are going to need polygon and polyline draping on terrain as a core Cesium feature (#2172). We will add new tasks when we encounter an issue as we implement each of the high-level types. If you have a strong need for a feature that we haven't gotten to yet, or feel we're missing something in the below list; please don't hesitate to let us know.
#### Related Links

[Mailing-list topic](https://groups.google.com/d/msg/cesium-dev/xz2xwKogybY/jt8h174rknwJ)
[Google Documentation](https://developers.google.com/kml/documentation/)
[OGC Specification](http://www.opengeospatial.org/standards/kml)
- [x] KmlDataSource
- [x] KMZ support
- [x] Proxy support
- [x] [Folder](https://developers.google.com/kml/documentation/kmlreference#folder)
- [ ] [Placemark](https://developers.google.com/kml/documentation/kmlreference#placemark)
- [x] Geometry
- [x] [Point](https://developers.google.com/kml/documentation/kmlreference#point)
- [x] [LineString](https://developers.google.com/kml/documentation/kmlreference#linestring)
- [x] [LinearRing](https://developers.google.com/kml/documentation/kmlreference#linearring)
- [x] [Polygon](https://developers.google.com/kml/documentation/kmlreference#polygon)
- [x] [MultiGeometry](https://developers.google.com/kml/documentation/kmlreference#multigeometry)
- [x] [gx:MultiTrack](https://developers.google.com/kml/documentation/kmlreference#gxmultitrack)
- [x] [gx:Track](https://developers.google.com/kml/documentation/kmlreference#gxtrack)
- [ ] [Model](https://developers.google.com/kml/documentation/kmlreference#model)
- [ ] [Overlay](https://developers.google.com/kml/documentation/kmlreference#overlay)
- [x] [GroundOverlay](https://developers.google.com/kml/documentation/kmlreference#groundoverlay)
- [x] [ScreenOverlay](https://developers.google.com/kml/documentation/kmlreference#screenoverlay)
- [ ] [Super Overlays](https://developers.google.com/kml/documentation/kml_21tutorial#superoverlays)
- [ ] [PhotoOverlay](https://developers.google.com/kml/documentation/kmlreference#photooverlay)
- [x] [NetworkLink](https://developers.google.com/kml/documentation/kmlreference#networklink)
- [x] `onExpire`, `onInterval`, `onStop`
- [ ] `onRegion`, `onChange`, `onRequest`
- [ ] [NetworkLinkControl]
(https://developers.google.com/kml/documentation/kmlreference#networklinkcontrol)
- [x] Everything except updates
- [ ] Updates
- [ ] Styles
- [x] [LineStyle](https://developers.google.com/kml/documentation/kmlreference#linestyle)
- [x] [PolyStyle](https://developers.google.com/kml/documentation/kmlreference#polystyle)
- [x] [IconStyle](https://developers.google.com/kml/documentation/kmlreference#iconstyle)
- [x] [LabelStyle](https://developers.google.com/kml/documentation/kmlreference#labelstyle)
- [x] [BalloonStyle](https://developers.google.com/kml/documentation/kmlreference#balloonstyle)
- [x] [styleUrl](https://developers.google.com/kml/documentation/kmlreference#styleurl)
- [ ] [StyleMap](https://developers.google.com/kml/documentation/kmlreference#stylemap)
- [x] normal
- [ ] highlight - https://github.com/CesiumGS/cesium/issues/6059
- [x] locally defined
- [ ] [ListStyle](https://developers.google.com/kml/documentation/kmlreference#liststyle) (requires `DataSourceBrowser` for full implementation)
- [x] Additional `` features
- [x] ``
- [x] ``
- [x] ``
- [x] ``
- [x] ``
- [x] ``
- [x] ``
- [ ] Same `` features for ``
- [ ] [LookAt](https://developers.google.com/kml/documentation/kmlreference#lookat)
- [ ] [Camera](https://developers.google.com/kml/documentation/kmlreference#camera)
- [ ] [ExtendedData](https://developers.google.com/kml/documentation/kmlreference#extendeddata)
- [x] ``
- [ ] `` and ``- https://github.com/CesiumGS/cesium/issues/8931
- [ ] Arbitrary XML data
- [x] Resolve KMZ links inside of an entity description.
- [x] Turn plain text urls in descriptions into links.
- [x] [gx:LatLonQuad](https://developers.google.com/kml/documentation/kmlreference#gxlatlonquad)
- [ ] Trapezoidal Texture Projection
- [ ] [Region](https://developers.google.com/kml/documentation/kmlreference#region)
- [x] root:// notation for older KML documents
- [ ] [gx:Tour](https://developers.google.com/kml/documentation/kmlreference#gxtour)
- [ ] [gx:drawOrder](https://developers.google.com/kml/documentation/kmlreference#gxdraworder)
- [ ] `` for LinearRing and LineString
- [ ] `` for Track and MultiTrack (applies to both model and billboard).
- [ ] `` gx extensions `x`, `y`, `w`, and `h` for `GroundOverlay`
- [ ] gx extensions for `LineStyle`
- [ ] `xal:AddressDetails`
- [x] `altitudeMode`
- [x] `absolute`
- [x] `clampToGround`
- [ ] `relativeToGround` (doesn't work on terrain).
- [ ] `gx:altitudeMode`
- [x] visibility
- [ ] `ge:Track` gets billboard heading from angles or direction of travel.
- [ ] Support for TIFF images. [forum discussion](https://groups.google.com/d/msg/cesium-dev/_MoqjO-PgcE/pPOZLwvZ15oJ)
- [ ] Password protected kmz files.
- [ ] Password protected network links.
- [ ] Ability to specify default icon when load fails.

**Random notes**
- We need to match handling of missing x/y/w/h values when using Placemark gx sub-region
- All billboards KML produces are currently square, Google Earth instead scales the longer edge to 32 while maintaining aspect ratio. This can be seen in the KMZ Sandcastle demo, which has squate flags in Cesium and rectangular flags in GE.
- Cesium doesn't have any way to support `BalloonStyle:displayMode`. I'm not sure we care.
- We currently replace BalloonStyle text `$[geDirections]` with nothing. If we ever provide out of the box routing, we can use that instead.
(https://github.com/gregjacobs/Autolinker.js) can be used to do this.
- We may be able to use `createObjectURL` for loading data from a zip file (which is currently using data uris). The problem here is that you need to call `revokeObjectURL` in order to clean things up when you're done.
- We need to support passing an ellipsoid to `KmlDataSource` to support other planets.
- We may want to expose some way to customize default values, either by exposing default entity graphics directly, or exposing a limited set of options (like GeoJSONDataSource does)
- Clicking on a link in a balloon description that returns KML has special behavior in GE. While we probably won't mirror that directly in Cesium, we should provide a mechanism to be able to do so (maybe through events).
- `zip.js` has the ability to report progress which we currently don't utilize. `loadXmlFromZip` and `loadDataUriFromZip` in KmlDataSource.js would be the place to start if we ever want to add it. We just need to pass a `onprogress` callback as the third parameter to `entry.getData`
- It would be nice to have a KML animation demo that uses TimeSpan, similar to the US states formation demo in Google's own documentation.
- Google Earth silently ignores errors with invalid dates (such as having garbage in a `when` block). If we want to match Google Earth, we should too. Rather than try/catching JulianDate.fromIso8601, we should add a exceptionless version that returns undefined.

Contributor guide

Open the contributing guide

Research direction

This is a broad KML roadmap rather than a single task. Start with KmlDataSource.js and choose one unchecked item from the list, then read the linked Google or OGC KML specification for that feature. Done means implementing and validating one clearly scoped checklist item without taking on the remaining roadmap.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.