Add state land layer
This commit is contained in:
parent
69d567d13c
commit
8017e4d88b
5 changed files with 101 additions and 3 deletions
|
|
@ -12,6 +12,7 @@ import states from './states/index.js';
|
|||
import national_land from './national-land/index.js';
|
||||
import cellular from './cellular.js';
|
||||
import light_pollution from './light_pollution.js';
|
||||
import state_land from './state-land/index.js';
|
||||
|
||||
const layerCategories = [
|
||||
{ // Base maps
|
||||
|
|
@ -79,6 +80,7 @@ const layerCategories = [
|
|||
census_bureau,
|
||||
states,
|
||||
national_land,
|
||||
state_land,
|
||||
cellular,
|
||||
light_pollution,
|
||||
];
|
||||
|
|
|
|||
8
layers/state-land/get_data.sh
Executable file
8
layers/state-land/get_data.sh
Executable file
|
|
@ -0,0 +1,8 @@
|
|||
#!/bin/sh
|
||||
|
||||
# https://gisdata.mn.gov/dataset/bdry-dnr-lrs-prk
|
||||
curl --silent --remote-name https://resources.gisdata.mn.gov/pub/gdrs/data/pub/us_mn_state_dnr/bdry_dnr_lrs_prk/shp_bdry_dnr_lrs_prk.zip
|
||||
unzip shp_bdry_dnr_lrs_prk.zip
|
||||
ogr2ogr -f GeoJSON mn-state-parks.geojson dnr_stat_plan_areas_prk.shp
|
||||
# sed -i '/^"crs":/d' mn-state-parks.geojson # TODO: handle this projection properly
|
||||
rm -r dnr_* metadata shp_bdry_dnr_lrs_prk.zip
|
||||
48
layers/state-land/index.js
Normal file
48
layers/state-land/index.js
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
import GeoJSON from 'ol/format/GeoJSON.js';
|
||||
import VectorLayer from 'ol/layer/Vector.js';
|
||||
import VectorSource from 'ol/source/Vector.js';
|
||||
|
||||
import stateParks from './mn-state-parks.geojson?url';
|
||||
|
||||
import { Fill, Stroke, Style, Text } from 'ol/style.js';
|
||||
|
||||
// Projection stuff
|
||||
import proj4 from 'proj4';
|
||||
import {register} from 'ol/proj/proj4.js';
|
||||
// https://epsg.io/26915.proj4js
|
||||
proj4.defs("EPSG:26915","+proj=utm +zone=15 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs +type=crs");
|
||||
register(proj4);
|
||||
|
||||
|
||||
function style(feature){
|
||||
return new Style({
|
||||
text: new Text({
|
||||
text: feature.get('AREA_NAME') + ' ' + feature.get('AREA_TYPE'),
|
||||
}),
|
||||
fill: new Fill({
|
||||
color: 'rgba(255,255,255,0.4)',
|
||||
}),
|
||||
stroke: new Stroke({
|
||||
color: '#008800',
|
||||
width: 1.25,
|
||||
}),
|
||||
});
|
||||
}
|
||||
|
||||
const layers = {
|
||||
name: "MN State Parks",
|
||||
layers: [
|
||||
{
|
||||
name: "State Parks",
|
||||
layer: new VectorLayer({
|
||||
source: new VectorSource({
|
||||
url: stateParks,
|
||||
format: new GeoJSON(),
|
||||
}),
|
||||
style: style,
|
||||
}),
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default layers;
|
||||
Loading…
Add table
Add a link
Reference in a new issue