Fly around the World

Introduction to how it works

We use "well known" OpenSource tools to do these translations, i.e. to read VMAP0 data, write to a PostGIS database and create shapefiles from such a PostGIS-DB. Please see the Tools section for further information. The difficult part was to deal with VMAP0 filenames, automatically handle VMAP0 layer names as well as attributes and create a wrapper around these tools that _really_ allows for unattended data processing .... well, this includes getting the Perl DBD driver for PostgreSQL _not_ to dump cores on Solaris ....

The shapefiles that reside at the mentioned location contain nothing but the already known VMAP and GSHHS data, stuffed into a different distribution format. Please remember that one of our primary goals is to _ease_ the use and development of TerraGear by offering data from many different sources in a unified and less error-prone format: Shapefiles.

I've 'simply' extracted the layer info from the shell script "TerraGear/src/Prep/TGVPF/process.sh", as to my knowledge it is the only complete resource of information regarding use of VMAP0 layers and attributes in TerraGear. I converted this into layer and attribute names that conform to usual (VMAP0-) naming conventions and finally I casted all this into a scriptable shape. I'm using a config file to control everything from creation of the database tables to the processing of layers and attributes; the file looks like this:

 

Source-Layer (VMAP0/1, GSHHS)

Source-Attributes

TerraGear-Layer

ALKIS-OK

Geom-Type

Attributes

'watrcrsl@hydro(*)_line'

hyc=8

v0_stream

5101

LINESTRING

nam

'watrcrsl@hydro(*)_line'

hyc=6

v0_intermittentstream

5101

LINESTRING

nam

'aquecanl@hydro(*)_line'

exs=1:loc=8

v0_canal

5102

LINESTRING

nam:loc

'inwatera@hydro(*)_area'

f_code=BH000:hyc=8

v0_lake

POLYGON

nam

'inwatera@hydro(*)_area'

f_code=BH000:hyc=6

v0_intermittentlake

POLYGON

nam

'inwatera@hydro(*)_area'

f_code=BH090

v0_floodland

POLYGON

nam

'roadl@trans(*)_line'

'med!=1'

v0_road

LINESTRING

'roadl@trans(*)_line'

med=1

v0_freeway

LINESTRING

'railrdl@trans(*)_line'

'fco!=2'

v0_railroad1

LINESTRING

'railrdl@trans(*)_line'

fco=2

v0_railroad2

LINESTRING

'builtupa@pop(*)_area'

v0_urban

POLYGON

geonameid:nam

'builtupp@pop(*)_point'

v0_town

POINT

geonameid:nam

'treesa@veg(*)_area'

veg=24

v0_deciduousbroadcover

4107:VEG:1100

POLYGON

nam

'treesa@veg(*)_area'

veg=25

v0_evergreenbroadcover

4107:VEG:1200

POLYGON

nam

'treesa@veg(*)_area'

veg=50

v0_mixedforestcover

4107:VEG:1300

POLYGON

nam

'grounda@phys(*)_area'

smc=88:swc=0

v0_sand

POLYGON

'grounda@phys(*)_area'

smc=88:swc=3

v0_littoral

POLYGON

'grounda@phys(*)_area'

smc=52

v0_lava

POLYGON

'grounda@phys(*)_area'

smc=119

v0_barrencover

POLYGON

'grassa@veg(*)_area'

f_code=EB010

v0_grasscover

POLYGON

'grassa@veg(*)_area'

f_code=EB020

v0_scrubcover

POLYGON

dmb

'tundraa@veg(*)_area'

v0_herbtundracover

POLYGON

'landicea@phys(*)_area'

v0_glacier

POLYGON

'seaicea@phys(*)_area'

f_code=BJ070

v0_packice

POLYGON

nam

'seaicea@phys(*)_area'

f_code=BJ080

v0_polarice

POLYGON

nam

'swampa@veg(*)_area'

f_code=BH095

v0_marsh

POLYGON

'swampa@veg(*)_area'

f_code=BH015

v0_bog

POLYGON

'cropa@veg(*)_area'

veg=0

v0_mixedcroppasturecover

POLYGON

'cropa@veg(*)_area'

veg=1

v0_drycroppasturecover

POLYGON

'cropa@veg(*)_area'

veg=999

v0_irrcroppasturecover

POLYGON

'polbnda@bnd(*)_area'

v0_landmass

POLYGON

nam:na2:na3

gshhs_land

gshhs_coastline

LINESTRING:

hshhs_lake

gshhs_lakes

LINESTRING:

gshhs_isle

gshhs_islands

LINESTRING:

gshhs_pond

gshhs_ponds

LINESTRING:

swbd

LINESTRING:

airfield

POINT:


I've made sure that every layer is present that has been used with the forementioned scipt and I loaded every shapefile with a viewer to ensure that the result is consistent and plausible. The current state is to be considered as a proof that a PostGIS-DB and shapefiles for handling this data are appropriate tools for use with TerraGear.

Later on we'll be able to distribute ready-to-use TerraGear work-diretories. Users will be able to get the most current version by simply pulling/updating the directories from SVN as I'm currently building a tool that creates these work-directories directly from the PostGIS-DB. In the meantime we always have the opportunity to pull an update from the PostGIS-DB and create new shapefiles.

Finally we intend to prepare a finer-grained set of landover data. When David Megginson started with using VMAP0 he simply took the layers and attributes that VMAP0 offers. In the long run we'll propose a more differenciated schema that allows for finer distinction between different landcover types.

 

Martin Spott; 20061222