Fix `ProtomapsImageryProvider` feature picking for time-series (GeoJson) lines and polygons
nf-s opened this issue · comments
Example JSON (click to expand)
{
"id": "time-based-automatic-styles",
"type": "geojson",
"geoJsonData": {
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
"date": 2018,
"someProperty": 3,
"featureid": 0
},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[145.0130295753479, -37.77042639061412],
[145.0200891494751, -37.77042639061412],
[145.0200891494751, -37.76543949054887],
[145.0130295753479, -37.76543949054887],
[145.0130295753479, -37.77042639061412]
]
]
}
},
{
"type": "Feature",
"properties": {
"date": 2019,
"someProperty": 6,
"featureid": 0
},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[145.0130295753479, -37.77042639061412],
[145.0200891494751, -37.77042639061412],
[145.0200891494751, -37.76543949054887],
[145.0130295753479, -37.76543949054887],
[145.0130295753479, -37.77042639061412]
]
]
}
},
{
"type": "Feature",
"properties": {
"date": 2020,
"someProperty": 10,
"featureid": 0
},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[145.0130295753479, -37.77042639061412],
[145.0200891494751, -37.77042639061412],
[145.0200891494751, -37.76543949054887],
[145.0130295753479, -37.76543949054887],
[145.0130295753479, -37.77042639061412]
]
]
}
},
{
"type": "Feature",
"properties": {
"date": 2021,
"someProperty": 0,
"featureid": 0
},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[145.0130295753479, -37.77042639061412],
[145.0200891494751, -37.77042639061412],
[145.0200891494751, -37.76543949054887],
[145.0130295753479, -37.76543949054887],
[145.0130295753479, -37.77042639061412]
]
]
}
},
{
"type": "Feature",
"properties": {
"date": 2018,
"someProperty": 3,
"featureid": 1
},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[145.0100040435791, -37.76080849651723],
[145.00873804092407, -37.76342088777352],
[145.0157332420349, -37.76292895101701],
[145.0100040435791, -37.76080849651723]
]
]
}
},
{
"type": "Feature",
"properties": {
"date": 2019,
"someProperty": 4,
"featureid": 1
},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[145.0100040435791, -37.76080849651723],
[145.00873804092407, -37.76342088777352],
[145.0157332420349, -37.76292895101701],
[145.0100040435791, -37.76080849651723]
]
]
}
},
{
"type": "Feature",
"properties": {
"date": 2020,
"someProperty": 1,
"featureid": 1
},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[145.0100040435791, -37.76080849651723],
[145.00873804092407, -37.76342088777352],
[145.0157332420349, -37.76292895101701],
[145.0100040435791, -37.76080849651723]
]
]
}
},
{
"type": "Feature",
"properties": {
"date": 2021,
"someProperty": 10,
"featureid": 1
},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[145.0100040435791, -37.76080849651723],
[145.00873804092407, -37.76342088777352],
[145.0157332420349, -37.76292895101701],
[145.0100040435791, -37.76080849651723]
]
]
}
},
{
"type": "Feature",
"properties": {
"date": 2022,
"someProperty": 7,
"featureid": 1
},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[145.0100040435791, -37.76080849651723],
[145.00873804092407, -37.76342088777352],
[145.0157332420349, -37.76292895101701],
[145.0100040435791, -37.76080849651723]
]
]
}
}
]
},
"styles": [
{
"id": "someProperty",
"color": { "colorPalette": "Reds" },
"time": { "timeColumn": "date", "idColumns": ["featureid"] },
"hidden": false
}
],
"activeStyle": "someProperty"
}
- Test link
- Click through time-steps - styling is correct
- Click on feature - you get feature info for all timesteps
- This is because
ProtomapsImageryProvider.pickFeatures
isn't time aware - it will return all features at a given point - In
GeoJsonMixin
, time is handled by not "painting" features (see here)
- This is because
There is also an issue when playing the timeline - there is no smooth transition between time-steps.
We should also add _nextImageryProvider
- like WMS - where the time-steps are generated ahead of time