topo-tuscany
Not logged in

Back to Map tool page



Creating the topo-tuscany.sqlite sample database

This quick tutorial explains by practical step by step examples how the topo-tuscany.sqlite sample database was actually created.
It's mainly intended for didactic purposes: you are expected to replicate all single steps, and at the end of the process you'll surely master the new tools and wizards supported by spatialite_gui 2.1.0.

This last sample will just contain two Vector Coverages based on the same datasets we've alredy used when building the tuscany.sqlite sample.
  1. topogeo: a Topology (ISO TopoGeo) based on Municipalities administrative boundaries.
  2. toponet: a Network (ISO Spatial TopoNet) based on Railways.

Step #1: populating the database by creating both the Topology and the Network

You'll start first by creating and populating the Topology.
ATTACH DATABASE "C:/sviluppo64-benchmark//tuscany.sqlite" AS "ext";

SELECT CreateTopology('topogeo', 3003);
SELECT TopoGeo_FromGeoTable('topogeo', 'ext', 'comuni', 'geometry', 512);
SELECT ST_ValidateTopoGeo('topogeo');
SELECT * FROM topogeo_validate_topogeo;
SELECT TopoGeo_DisambiguateSegmentEdges('topogeo');
SELECT TopoGeo_UpdateSeeds('topogeo');
Then you'll complete this step by creating and populating the Network.
SELECT CreateNetwork('toponet', 1, 3003);
SELECT TopoNet_FromGeoTable('toponet', 'ext', 'elem_ferr', 'geometry');
SELECT ST_ValidSpatialNet('toponet');
SELECT * FROM toponet_valid_spatialnet;
SELECT TopoNet_DisambiguateSegmentLinks('toponet');
SELECT TopoNet_UpdateSeeds('toponet');

DETACH DATABASE "ext";


Step #2: creating the two Vector Coverages based on TopoGeo and TopoNet.

You can easily create the first Vector Coverage based on the Topology. topo1
Just select a Topology from the list, then fill all dialog fields and finally confirm. topo2
Now you can easily create the second Vector Coverage based on the Metwork. topo3
Just select a Network from the list, then fill all dialog fields and finally confirm. topo4
Final step: you have to compute the full Extent (BBOX) for all Vector Coverages.

Warning

all Vectorr Coverages missing a valid Extent declaration will always be silently ignored and will never be published.

All right; both the TopoGeo and the TopoNet Vector Coverages are now ready to be published !

topo5



Back to Map tool page