Adding a Cesium.GeoJsonDataSource.readFeature method
- Dominant language
- JavaScript
- Stars
- 15.7k
- Forks
- 3.9k
- Avg merge
- 4d 6h
- Merged PRs (30d)
- 34
Description
In some cases I would like to process GeoJSON feature by feature and create Cesium entities from them, similar to how readFeature works in Open Layers.
http://openlayers.org/en/latest/apidoc/ol.format.GeoJSON.html#readFeature
Today this is not possible, what you can do is to load GeoJSON data and receive a promise, but that will be hard to handle when you want to loop through all your features and handle them one by one. (What I want to do is to process each feature to an entity and apply a visualization based on a lot of the feature attirbutes.)
If I read the code it would be possible to do this is parts of the load function in the load method for GeoJsonDataSource was broken out as a pure feature parser and added as a method to GeoJsonDataSource. The readFeature method would return a entity or an array of entities based on what kind of feature that was parsed.
https://github.com/AnalyticalGraphicsInc/cesium/blob/1.31/Source/DataSources/GeoJsonDataSource.js#L857
If this was done I would not have to write my own feature parser for creating entities.
Contributor guide
Research direction
Start in Source/DataSources/GeoJsonDataSource.js around the load method at line 857, and trace how GeoJSON features become Cesium entities. Determine how a public readFeature method should expose that parsing for individual features, including cases that produce multiple entities; done means callers can process features individually without writing a separate parser.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- data, frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100