Skip to content

Commit 68248dc

Browse files
committed
added wkt for CA and CO
1 parent 6bd249c commit 68248dc

File tree

135 files changed

+668
-543
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

135 files changed

+668
-543
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
scripts/node_modules/
1+
2+
scripts/package-lock.json
3+
scripts/package-lock.json
4+
*.json

README.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
# spatial-layers
2-
3-
Contained here are KMZ and JSON Files useful for Berkeleymapper and other mapping applications in use at the the Berkeley Natural History Museums.
4-
All data hosted here is understood to be publically available.
5-
6-
What is loaded currently:
7-
8-
| Data layer name | owner/agency | source | remarks |
9-
|---------- |:-------------: |:------: |---------- |
10-
| 7.5 min topoquads | USGS | [Downloaded from ArcGIS Online](http://www.arcgis.com/home/item.html?id=4bf2616d2f054fbe92eadcdc9582a765) | This layer presents the geographic extent of USGS 1:24,000 topographic maps (7.5- by 7.5-minute quadrangles) for the conterminous U.S. forty-eight states and District of Columbia. It provides quadrangle name, identification number, publication data, and map coverage by state for each quadrangle. This large-scale index grid is appropriate for display at more detailed scales. |
11-
| cpad layers | local, state, and federal | [Downloaded CPAD layers](http://www.calands.org/) | Contained in the CPAD directory are local, state, and federal layers automatically harvested from CPAD and converted to geoJSON using scripts/runCpad.sh |
12-
13-
What we're working on:
14-
15-
| Data layer name | owner/agency | source | remarks |
16-
|---------- |:-------------: |:------: |---------- |
17-
| California Subregional Hydrological Units (HUC) | NRCS (USDA) | [Available here at NRCS data](http://www.nrcs.usda.gov/wps/portal/nrcs/main/national/water/watersheds/dataset/) | Metadata: http://www.nrcs.usda.gov/Internet/FSE_DOCUMENTS/stelprdb1042207.pdf (subregional codes for California Province); Bezier smoothing applied to KMZ |
18-
| Terrestrial ecoregions (biome level?) | World Wildlife Fund | [Available here at WWF](http://www.worldwildlife.org/publications/terrestrial-ecoregions-of-the-world) | Assuming that Global Biomes will be useful; 15 biomes just for North America (versus 151 ecoregions at next resolution |
1+
# spatial-layers
2+
3+
Contained here are KMZ and JSON Files useful for Berkeleymapper and other mapping applications in use at the the Berkeley Natural History Museums.
4+
All data hosted here is understood to be publically available.
5+
6+
What is loaded currently:
7+
8+
| Data layer name | owner/agency | source | remarks |
9+
|---------- |:-------------: |:------: |---------- |
10+
| 7.5 min topoquads | USGS | [Downloaded from ArcGIS Online](http://www.arcgis.com/home/item.html?id=4bf2616d2f054fbe92eadcdc9582a765) | This layer presents the geographic extent of USGS 1:24,000 topographic maps (7.5- by 7.5-minute quadrangles) for the conterminous U.S. forty-eight states and District of Columbia. It provides quadrangle name, identification number, publication data, and map coverage by state for each quadrangle. This large-scale index grid is appropriate for display at more detailed scales. |
11+
| cpad layers | local, state, and federal | [Downloaded CPAD layers](http://www.calands.org/) | Contained in the CPAD directory are local, state, and federal layers automatically harvested from CPAD and converted to geoJSON using scripts/runCpad.sh |
12+
13+
What we're working on:
14+
15+
| Data layer name | owner/agency | source | remarks |
16+
|---------- |:-------------: |:------: |---------- |
17+
| California Subregional Hydrological Units (HUC) | NRCS (USDA) | [Available here at NRCS data](http://www.nrcs.usda.gov/wps/portal/nrcs/main/national/water/watersheds/dataset/) | Metadata: http://www.nrcs.usda.gov/Internet/FSE_DOCUMENTS/stelprdb1042207.pdf (subregional codes for California Province); Bezier smoothing applied to KMZ |
18+
| Terrestrial ecoregions (biome level?) | World Wildlife Fund | [Available here at WWF](http://www.worldwildlife.org/publications/terrestrial-ecoregions-of-the-world) | Assuming that Global Biomes will be useful; 15 biomes just for North America (versus 151 ecoregions at next resolution |

data/bedmaps.geojson

Lines changed: 309 additions & 309 deletions
Large diffs are not rendered by default.

data/json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1+

scripts/README.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
# Scripts
2-
3-
To run the scripts in this directory, first install the required node modules by calling npm
4-
which reads the contents of package.json
5-
6-
```
7-
npm install
8-
```
9-
10-
To run the runCpad.js script to harvest CPAD data as geojson, type the following to get command-line help.
11-
The output of this command will place data into a cpad directory off of root (../cpad/)
12-
13-
```
14-
% node runCpad.js
15-
Usage: node runCpad.js agency_name agency_type
16-
e.g. node runCpad.js State University+of+Caliifornia
17-
```
18-
19-
1+
# Scripts
2+
3+
To run the scripts in this directory, first install the required node modules by calling npm
4+
which reads the contents of package.json
5+
6+
```
7+
npm install
8+
```
9+
10+
To run the runCpad.js script to harvest CPAD data as geojson, type the following to get command-line help.
11+
The output of this command will place data into a cpad directory off of root (../cpad/)
12+
13+
```
14+
% node runCpad.js
15+
Usage: node runCpad.js agency_name agency_type
16+
e.g. node runCpad.js State University+of+Caliifornia
17+
```
18+
19+

scripts/catGeometries.js

Lines changed: 55 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,55 @@
1-
/**
2-
Handle multiple geometries that may be found in the CPAD return
3-
**/
4-
var Terraformer = require('terraformer');
5-
var WKT = require('terraformer-wkt-parser');
6-
7-
// packFeatures operates over a larger geoJsonObject and operates
8-
// row by row, replacing the array of temporary WKT geometries
9-
// that were inserted by the appender with a geometry collection
10-
// object. This effectively creates a proper GeoJSON object
11-
// During the operation the tempFeatures element is deleted and
12-
// replaced by the geometries element.
13-
exports.packFeatures = function (geoJsonObj) {
14-
for (var row in geoJsonObj) {
15-
var geoJsonRow = geoJsonObj[row]
16-
// array to hold all the possible multipolygons
17-
var geometries = []
18-
for (var feature in geoJsonRow.tempFeatures) {
19-
// convert the WKT to GeoJSON
20-
var polygon = WKT.parse(geoJsonRow.tempFeatures[feature])
21-
// push the polygon into the geometries array
22-
geometries.push(polygon)
23-
}
24-
// create the geometry collectioh
25-
var geometryCollection = new Terraformer.GeometryCollection(geometries)
26-
27-
// Remove the tempFeatures row now that we're done
28-
delete geoJsonRow.tempFeatures;
29-
// Combine the properties with the geometryCollection we created
30-
geoJsonObj[row] = Object.assign({},geoJsonRow,geometryCollection)
31-
}
32-
return geoJsonObj
33-
34-
},
35-
36-
// Append names and geometries to a geoJsonObject.
37-
// This function takes parameters geoJsonObj, name, geometry
38-
// Returns the geoJsonObj with name and a tempGeometry object apended
39-
exports.appender = function (geoJsonObj, name, geometry) {
40-
// Search for element in the geoJsonObj with a name value equal to the name parameter
41-
var found = geoJsonObj.find(value => value.properties.name === name)
42-
43-
// if found is not undefined we push the new geometry onto the geometries stack
44-
if (found) {
45-
found.tempFeatures.push(geometry)
46-
// If not found then we create a new object and push the new geometry onto the stack
47-
} else {
48-
var l = {}
49-
l.tempFeatures = [geometry]
50-
l.properties = {name:name}
51-
geoJsonObj.push(l)
52-
}
53-
return geoJsonObj;
54-
}
55-
1+
/**
2+
Handle multiple geometries that may be found in the CPAD return
3+
**/
4+
var Terraformer = require('terraformer');
5+
var WKT = require('terraformer-wkt-parser');
6+
7+
// packFeatures operates over a larger geoJsonObject and operates
8+
// row by row, replacing the array of temporary WKT geometries
9+
// that were inserted by the appender with a geometry collection
10+
// object. This effectively creates a proper GeoJSON object
11+
// During the operation the tempFeatures element is deleted and
12+
// replaced by the geometries element.
13+
exports.packFeatures = function (geoJsonObj) {
14+
for (var row in geoJsonObj) {
15+
var geoJsonRow = geoJsonObj[row]
16+
// array to hold all the possible multipolygons
17+
var geometries = []
18+
for (var feature in geoJsonRow.tempFeatures) {
19+
// convert the WKT to GeoJSON
20+
var polygon = WKT.parse(geoJsonRow.tempFeatures[feature])
21+
// push the polygon into the geometries array
22+
geometries.push(polygon)
23+
}
24+
// create the geometry collectioh
25+
var geometryCollection = new Terraformer.GeometryCollection(geometries)
26+
27+
// Remove the tempFeatures row now that we're done
28+
delete geoJsonRow.tempFeatures;
29+
// Combine the properties with the geometryCollection we created
30+
geoJsonObj[row] = Object.assign({},geoJsonRow,geometryCollection)
31+
}
32+
return geoJsonObj
33+
34+
},
35+
36+
// Append names and geometries to a geoJsonObject.
37+
// This function takes parameters geoJsonObj, name, geometry
38+
// Returns the geoJsonObj with name and a tempGeometry object apended
39+
exports.appender = function (geoJsonObj, name, geometry) {
40+
// Search for element in the geoJsonObj with a name value equal to the name parameter
41+
var found = geoJsonObj.find(value => value.properties.name === name)
42+
43+
// if found is not undefined we push the new geometry onto the geometries stack
44+
if (found) {
45+
found.tempFeatures.push(geometry)
46+
// If not found then we create a new object and push the new geometry onto the stack
47+
} else {
48+
var l = {}
49+
l.tempFeatures = [geometry]
50+
l.properties = {name:name}
51+
geoJsonObj.push(l)
52+
}
53+
return geoJsonObj;
54+
}
55+

scripts/package.json

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
{
2-
"name": "testhere",
3-
"version": "1.0.0",
4-
"description": "",
5-
"main": "testy.js",
6-
"scripts": {
7-
"test": "echo \"Error: no test specified\" && exit 1"
8-
},
9-
"keywords": [],
10-
"author": "",
11-
"license": "ISC",
12-
"dependencies": {
13-
"mkdirp": "^0.5.1",
14-
"request": "^2.83.0",
15-
"terraformer": "^1.0.8",
16-
"terraformer-wkt-parser": "^1.1.2",
17-
"unidecode": "^0.1.8",
18-
"util": "^0.10.3"
19-
}
20-
}
1+
{
2+
"name": "testhere",
3+
"version": "1.0.0",
4+
"description": "",
5+
"main": "testy.js",
6+
"scripts": {
7+
"test": "echo \"Error: no test specified\" && exit 1"
8+
},
9+
"keywords": [],
10+
"author": "",
11+
"license": "ISC",
12+
"dependencies": {
13+
"mkdirp": "^0.5.1",
14+
"request": "^2.83.0",
15+
"terraformer": "^1.0.8",
16+
"terraformer-wkt-parser": "^1.1.2",
17+
"unidecode": "^0.1.8",
18+
"util": "^0.10.3"
19+
}
20+
}

0 commit comments

Comments
 (0)