Mapping API for the https://classroom.zooniverse.org service. Built using https://datasette.io/ to provide a JSON API over SQLite databases with custom project CSV data.
MIT License
2
stars
0
forks
source link
GeoJSON formatter should include "properties" for FeaturesCollections #9
When the Classroom Maps API outputs GeoJSON data (example) with a FeaturesCollection, this data should include the properties of said Features, in addition to the Features' coordinates & geometries.
Context / Use Case
Compare Darien's flat grey overlay...
...with Gorongosa's colourful biomes.
WildCam Darien stores its biome layer on the API, and the API isn't returning the "what biome is here? Forest? Desert? Tundra? etc" associated with each shape (Feature). WCGorongosa doesn't have an issue since the GeoJSON is hardcoded into the front end code. (It's old fashioned that way.)
Notes:
Note that Darien and Gorongosa both have coloured legend keys to denote biomes in the lower-left corner of the map
The issue of the missing "properties" data actually isn't relevant to anything OTHER than colouring biomes, so this is pretty low priority.
The JSON format of the same returns all the necessary info, so it's not as if the database is missing information, it's just not translating to GeoJSON.
The "properties" of a Feature is basically every data column except the coordinates/shape column of the corresponding data row.
Potential Solution
We just need to change the GeoJSON results from this...
elif 'the_geom' in row.keys():
# ...this section should be improved so the 'feature' object is a wee bit more complex
feature = Geometry(row['the_geom'])
# ...I guess the only challenge is to somehow list all key-value pairs of the 'row' object except for the_geom, then chuck it into a new 'properties' object.
feature_list.append(feature)
Do Darien biomes show up on the map correctly, and in colour?
Do the cameras for all programs show up fine?
Are response sizes not TOO adversely affected by the addition of the 'properties' data? Remember, every other map function does NOT care about the Feature.properties value except for biome colouring.
Map Enhancement
When the Classroom Maps API outputs GeoJSON data (example) with a FeaturesCollection, this data should include the properties of said Features, in addition to the Features' coordinates & geometries.
Context / Use Case
Compare Darien's flat grey overlay...![image](https://user-images.githubusercontent.com/13952701/120399398-d50bc980-c333-11eb-9b9c-35a049cc9180.png)
...with Gorongosa's colourful biomes.![image](https://user-images.githubusercontent.com/13952701/120399342-b73e6480-c333-11eb-85bb-4055fa1a9a16.png)
WildCam Darien stores its biome layer on the API, and the API isn't returning the "what biome is here? Forest? Desert? Tundra? etc" associated with each shape (Feature). WCGorongosa doesn't have an issue since the GeoJSON is hardcoded into the front end code. (It's old fashioned that way.)
Notes:
Potential Solution
We just need to change the GeoJSON results from this...
...to this.
Should be fairly simple(??) to do. In https://github.com/zooniverse/classroom-maps-api/blob/main/plugins/geo_json_renderer.py...
The main things to test:
Status
Low priority, visual fix