Add US Public Land (national park/forest) layers
This commit is contained in:
parent
354d952567
commit
eed4688c3b
|
@ -9,6 +9,7 @@ import bikepackingLayer from './bikepacking/layer.js';
|
||||||
import chains from './chains/index.js';
|
import chains from './chains/index.js';
|
||||||
import census_bureau from './census-bureau/index.js';
|
import census_bureau from './census-bureau/index.js';
|
||||||
import states from './states/index.js';
|
import states from './states/index.js';
|
||||||
|
import national_land from './national-land/index.js';
|
||||||
|
|
||||||
const layerCategories = [
|
const layerCategories = [
|
||||||
{ // Base maps
|
{ // Base maps
|
||||||
|
@ -75,6 +76,7 @@ const layerCategories = [
|
||||||
chains,
|
chains,
|
||||||
census_bureau,
|
census_bureau,
|
||||||
states,
|
states,
|
||||||
|
national_land,
|
||||||
];
|
];
|
||||||
|
|
||||||
export default layerCategories;
|
export default layerCategories;
|
||||||
|
|
22
layers/national-land/get_data.sh
Executable file
22
layers/national-land/get_data.sh
Executable file
|
@ -0,0 +1,22 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
curl --silent --output nps_boundary_geojson.zip http://gstore.unm.edu/apps/rgisarchive/datasets/7bbe8af5-029b-4adf-b06c-134f0dd57226/nps_boundary.derived.geojson
|
||||||
|
unzip nps_boundary_geojson.zip nps_boundary.geojson
|
||||||
|
rm nps_boundary_geojson.zip
|
||||||
|
|
||||||
|
# for resolution in 20m 5m; do
|
||||||
|
# curl --silent --remote-name https://www2.census.gov/geo/tiger/GENZ2022/shp/cb_2022_us_county_${resolution}.zip
|
||||||
|
# unzip cb_2022_us_county_${resolution}.zip
|
||||||
|
# ogr2ogr -f GeoJSON us-counties-${resolution}.geojson cb_2022_us_county_${resolution}.shp
|
||||||
|
# sed -i '/^"crs":/d' us-counties-${resolution}.geojson # TODO: handle this projection properly
|
||||||
|
# rm cb_2022_us_county_${resolution}.*
|
||||||
|
# # python cleanup_data.py us-counties-${resolution}.geojson # Only needed for KML files
|
||||||
|
# done
|
||||||
|
|
||||||
|
# https://data.fs.usda.gov/geodata/edw/datasets.php?xmlKeyword=Original+Proclaimed+National+Forests
|
||||||
|
curl --silent --remote-name https://data.fs.usda.gov/geodata/edw/edw_resources/shp/S_USA.ProclaimedForest.zip
|
||||||
|
unzip S_USA.ProclaimedForest.zip
|
||||||
|
ogr2ogr -f GeoJSON us-national-forests.geojson S_USA.ProclaimedForest.shp
|
||||||
|
sed -i '/^"crs":/d' us-national-forests.geojson # TODO: handle this projection properly
|
||||||
|
rm S_USA.ProclaimedForest.*
|
||||||
|
# TODO: some kind of cleanup to save space?
|
51
layers/national-land/index.js
Normal file
51
layers/national-land/index.js
Normal file
|
@ -0,0 +1,51 @@
|
||||||
|
import GeoJSON from 'ol/format/GeoJSON.js';
|
||||||
|
import VectorLayer from 'ol/layer/Vector.js';
|
||||||
|
import VectorSource from 'ol/source/Vector.js';
|
||||||
|
|
||||||
|
import nationalParks from './nps_boundary.geojson?url';
|
||||||
|
import nationalForests from './us-national-forests.geojson?url';
|
||||||
|
|
||||||
|
import { Fill, Stroke, Style, Text } from 'ol/style.js';
|
||||||
|
|
||||||
|
function style(feature){
|
||||||
|
return new Style({
|
||||||
|
text: new Text({
|
||||||
|
text: feature.get('FORESTNAME') || (feature.get('UNIT_NAME') + " National Park"),
|
||||||
|
}),
|
||||||
|
fill: new Fill({
|
||||||
|
color: 'rgba(255,255,255,0.4)',
|
||||||
|
}),
|
||||||
|
stroke: new Stroke({
|
||||||
|
color: '#008800',
|
||||||
|
width: 1.25,
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const layers = {
|
||||||
|
name: "US Public Land",
|
||||||
|
layers: [
|
||||||
|
{
|
||||||
|
name: "National Parks",
|
||||||
|
layer: new VectorLayer({
|
||||||
|
source: new VectorSource({
|
||||||
|
url: nationalParks,
|
||||||
|
format: new GeoJSON(),
|
||||||
|
}),
|
||||||
|
style: style,
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "National Forests",
|
||||||
|
layer: new VectorLayer({
|
||||||
|
source: new VectorSource({
|
||||||
|
url: nationalForests,
|
||||||
|
format: new GeoJSON(),
|
||||||
|
}),
|
||||||
|
style: style,
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
export default layers;
|
Loading…
Reference in a new issue