projects:voyc:data_extraction
Table of Contents
Geosketch Data Extraction
Plunder loads its data from static js files.
Those files are generated from the plunder database using the sql files in the geosketch/sql folder.
psql -t -d voyc -U jhagstrand <deserts.sql >deserts.js psql -t -d voyc -U jhagstrand <mountains.sql >mountains.js psql -t -d voyc -U jhagstrand <plateaux.sql >plateaux.js psql -t -d voyc -U jhagstrand <plains.sql >plains.js psql -t -d voyc -U jhagstrand <swamps.sql >swamps.js psql -t -d voyc -U jhagstrand <tundras.sql >tundras.js psql -t -d voyc -U jhagstrand <foothills.sql >foothills.js psql -t -d voyc -U jhagstrand <valleys.sql >valleys.js psql -t -d voyccom_plunder -U voyccom_jhagstrand <rivers.sql >../../html/data/rivers.js psql -t -d voyccom_plunder -U voyccom_jhagstrand <lakes.sql >../../html/data/lakes.js psql -t -d voyc -U jhagstrand <empire.sql >empire.js psql -t -d voyc -U jhagstrand <treasure.sql >treasure.js
Originally mountains were broken into three js files by scalerank.
- high scalerank 1,2
- medium scalerank 3,4
- low scalerank 4,5
And rivers were broken into six js files by scalerank, 1 thru 6.
OGR
OGR can be used to generate geojson files directly from shapefiles, but we found it more convenient to use a sql database as an interim.
Create one large geojson file from the shapefile.
ogr2ogr -f GeoJSON georegions.js 10m_geography_regions_polys.shp
Never figured out how to create multiple geojson files, one for each featurecla.
ogr2ogr -f GeoJSON -clipsrcwhere "FeatureCla='foothills'" foothills.geojson 10m_geography_regions_polys.shp
Feature Class
| alkaline lake | 40 |
| basin | 9 |
| canal | 4 |
| coast | 36 |
| continent | 7 |
| delta | 12 |
| depression | 2 |
| desert | 58 |
| drangons-be-here | 1 |
| empire | 427 |
| foothills | 3 |
| geoarea | 44 |
| gorge | 3 |
| island | 295 |
| island group | 167 |
| isthmus | 4 |
| lake | 320 |
| lake centerline | 113 |
| lowland | 5 |
| pen/cape | 55 |
| peninsula | 11 |
| plain | 30 |
| plateau | 71 |
| range/mtn | 222 |
| reservoir | 52 |
| river | 361 |
| treasure | 67 |
| tundra | 4 |
| valley | 6 |
| wetlands | 3 |
| layer | featureclass | rowcount |
|---|---|---|
| terrain | ||
| basin | 9 | |
| desert | 58 | |
| plain | 30 | |
| plateau | 71 | |
| tundra | 4 | |
| mountains | ||
| range/mtn | 222 | |
| foothills | 3 | |
| lakes | ||
| lake | 320 | |
| reservoir | 52 | |
| delta | 12 | |
| rivers | ||
| river | 361 | |
| historical | ||
| empire | 427 | |
| treasure | 67 |
projects/voyc/data_extraction.txt · Last modified: 2023/01/12 03:08 by jhagstrand