User Tools

Site Tools


geosketch_data_extraction

This is an old revision of the document!


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 <lowmountains.sql >lowmountains.js
psql -t -d voyc -U jhagstrand <highmountains.sql >highmountains.js
psql -t -d voyc -U jhagstrand <mediummountains.sql >mediummountains.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 voyc -U jhagstrand <river1.sql >../../html/data/river1.js
psql -t -d voyc -U jhagstrand <river2.sql >../../html/data/river2.js
psql -t -d voyc -U jhagstrand <river3.sql >../../html/data/river3.js
psql -t -d voyc -U jhagstrand <river4.sql >../../html/data/river4.js
psql -t -d voyc -U jhagstrand <river5.sql >../../html/data/river5.js
psql -t -d voyc -U jhagstrand <river6.sql >../../html/data/river6.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.

scale = the number of pixels in the radius of the globe, used for realtime map drawing

scalerank = a number from 1 to 6, indicating the relative magnitude of the feature

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
geosketch_data_extraction.1670203774.txt.gz ยท Last modified: 2022/12/04 20:29 by jhagstrand

Except where otherwise noted, content on this wiki is licensed under the following license: Public Domain
Public Domain Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki