This PR solves #47, but using GeoJSON files + Turf.js instead of BBOXes to determine if a lat/lon point or community falls within the data extent. This approach is much more accurate because the extent of our data tends to be very irregular, not rectangular.
Currently, the five possible GeoJSON files used for validation and their corresponding ARDAC datasets are:
Alaska GeoJSON
All Permafrost items
"Blocky Alaska" GeoJSON (includes more panhandle communities, including Juneau)
Flammability
Vegetation Type
Climate Protection from Spruce Beetles
Wet Days Per Year
"Mizukami" GeoJSON (named after the primary author of the citation from which these datasets were derived)
All Degree Days items
All Hydrology items
All non-CMIP6 indicators
Elevation GeoJSON
Elevation
Ocean GeoJSON
Landfast Sea Ice
Sea Ice Concentration
CMIP6 indicator items do not use GeoJSON point validation since these datasets can cover both land & sea and are not confined to political boundaries.
An additional extent Gimme component prop and Extent TypeScript type have been implemented, and the Gimme component uses these to load the corresponding GeoJSON file dynamically.
To test, load the app and view any map+chart/table ARDAC item. Try typing a community name into the Gimme widget and observe that only communities that fall within the data footprint are autocompleted. Also, if you happen to enter a lat/lon point that is within the BBOX but outside the irregularly-shaped data extent, it will show you a new error under the input box:
Closes #47.
This PR solves #47, but using GeoJSON files + Turf.js instead of BBOXes to determine if a lat/lon point or community falls within the data extent. This approach is much more accurate because the extent of our data tends to be very irregular, not rectangular.
Currently, the five possible GeoJSON files used for validation and their corresponding ARDAC datasets are:
Alaska GeoJSON
"Blocky Alaska" GeoJSON (includes more panhandle communities, including Juneau)
"Mizukami" GeoJSON (named after the primary author of the citation from which these datasets were derived)
Elevation GeoJSON
Ocean GeoJSON
CMIP6 indicator items do not use GeoJSON point validation since these datasets can cover both land & sea and are not confined to political boundaries.
An additional
extent
Gimme component prop andExtent
TypeScript type have been implemented, and the Gimme component uses these to load the corresponding GeoJSON file dynamically.To test, load the app and view any map+chart/table ARDAC item. Try typing a community name into the Gimme widget and observe that only communities that fall within the data footprint are autocompleted. Also, if you happen to enter a lat/lon point that is within the BBOX but outside the irregularly-shaped data extent, it will show you a new error under the input box: