Quick How-To Guide for the Planet Earth sample
In this tutorial we'll assume that you've already studied and understood the tutorials about the Giglio sampleNow we'll examine the Planet Earth sample which will allow us to delve further into new details that we previously ignored.
The following table summarizes for quick reference all Coverages contained into the Planet Earth sample database:
| Coverage name | Type | Description |
|---|---|---|
| etopo1 | Raster | Global DEM - Digital Elevation Model |
| true_marble | Raster | Natural colors - RGB low-resolution mosaic of Landsat imagery |
| countries | Vector | 2D Polygons - National Boundaries |
| countries_vw | Vector | Spatial View derived from countries |
| topo_states | Vector | Topology derived from countries |
All datasets are based on open data available at the following URLs:
- ETOPO1: NOAA
- True Marble: Unearthed Outdoors
- Countries: Natural Earth
Step #1 - General Introduction | ||
|---|---|---|
Step #1.1 - Testing the ETOPO1 backgroundThe side figure shows how the Map will be when applying the following layers selection:
|
| |
Step #1.2 - Testing the True Marble backgroundThe side figure shows how the Map will be when applying the following layers selection:
|
| |
Step #1.3 - Testing the Political MapThe side figure shows how the Map will be when applying the following layers selection:
|
| |
Step #1.4 - Testing the TopologyThe side figure shows how the Map will be when applying the following layers selection:
|
| |
Step #2 - Preparing the Raster Coverages | ||
Step #2.1 - Creating the Raster Coverages | ||
Step #2.1.1 - Creating etopo_1
|
| |
Step #2.1.2 - Creating true_marble
|
| |
Step #2.2 - Populating the Raster Coverages | ||
On the dialog box:
|
| |
Step #2.3 - Styling the Raster Coverages | ||
|
etopo1 is Global DEM, presenting elevation values ranging between the ocean depths and the very high peaks of the Himalayas. The most appropriate choice for the Color Map Style could be either Etopo2 or SRTM or Terrain. Note: setting up a Style for true_marble is not required, because this one is a RGB Coverage, and the default Style will be perfectly adequate. |
| |
Step #3 - Preparing the Vector Coverages | ||
Step #3.1 - Styling countries (Spatial Table) | ||
Step #3.1.1 - Setting up the Polygon SymbolizerOn the QuickStyle Dialog Box:
|
| |
Step #3.1.2 - Setting up the Text SymbolizerOn the QuickStyle Dialog Box:
|
| |
Step #3.2 - Creating and styling a Vector Coverage based on a Spatial View | ||
Step #3.2.1 - Creating the Spatial ViewThere is very little to say about this; we simply have to execute a pair of SQL statements.What is decisely more interesting to be examined is the intended role of the CASE clause:
|
CREATE VIEW countries_vw AS
SELECT pk_uid AS rowid, name AS name,
CASE mapcolor7
WHEN 1 THEN '#FF0000'
WHEN 2 THEN '#00FF00'
WHEN 3 THEN '#0000FF'
WHEN 4 THEN '#FFFF00'
WHEN 5 THEN '#FF00FF'
WHEN 6 THEN '#00FFFF'
ELSE '#808080'
END color, geometry AS geom
FROM countries;
INSERT INTO views_geometry_columns VALUES
('countries_vw', 'geom', 'rowid', 'countries', 'geometry', 1);
| |
Step #3.2.2 - Transforming a Spatial View into a Vector CoverageFrom the Tree View expand the Spatial View node, then go to its Geometry node:
|
| |
Step #3.2.3 - Styling the countries_vw Vector CoverageHow to edit the XML template:
|
<?xml version="1.0" encoding="UTF-8"?>
<PolygonSymbolizer version="1.1.0"
xsi:schemaLocation="http://www.opengis.net/se http://schemas.opengis.net/se/1.1.0/Symbolizer.xsd"
xmlns="http://www.opengis.net/se" xmlns:ogc="http://www.opengis.net/ogc"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
uom="http://www.opengeospatial.org/se/units/pixel">
<Name>countries_col</Name>
<Description>
<Title>Countries - Political Map</Title>
<Abstract>A Style setting its Fill color from a Column Value</Abstract>
</Description>
<Fill>
<SvgParameter name="fill">@color@</SvgParameter>
<SvgParameter name="fill-opacity">1.00</SvgParameter>
</Fill>
<Stroke>
<SvgParameter name="stroke">#000000</SvgParameter>
<SvgParameter name="stroke-opacity">1.00</SvgParameter>
<SvgParameter name="stroke-width">1.00</SvgParameter>
<SvgParameter name="stroke-linejoin">round</SvgParameter>
<SvgParameter name="stroke-linecap">round</SvgParameter>
</Stroke>
</PolygonSymbolizer>
| |
Step #3.3 - Creating and styling a Vector Coverage based on a Topology | ||
Step #3.3.1 - How to create a TopologyFrom the Topology-Geometry node in the Tree View:
|
| |
Step #3.3.2 - Creating the TopologyOn the dialog box:
|
| |
Step #3.3.3 - Building the TopologyThere is very little to say, it just requires executing few SQL statements. |
SELECT TopoGeo_FromGeoTableNoFaceExt('topo_states', NULL, 'countries', NULL, 'dustbin', 'dustbin_view', 512);
SELECT TopoGeo_Polygonize('topo_states');
SELECT TopoGeo_UpdateSeeds('topo_states');
| |
Step #3.3.4 - Transforming a Topology into a Vector CoverageFrom the Topology-Geometry node in the Tree View:
|
| |
Step #3.3.5 - Handling a Topology-based Vector CoverageFrom the main.topo_states node in the Tree View:
|
| |
Step #3.3.6 - Handling the visibily of individual Topology PrimitivesOn the Configuration Dialog Box you can select / unselect the checkbox corresponding to each single PrimitiveAny disabled Privitive class will never be shown on the Map. Note: the Faces Primitive is usually kept disabled, because Topology Faces are simply virtual thus being very slow to be generated on the fly. If the current viewpoint of the Map contains a reasonable number of Faces showing them could be acceptable. But when the current viepoint contains a really huge number of Faces updating the Map will probably require an absolutely unacceptable time. You are warned, be very careful. |
| |
Step #3.3.7 - Styling a Topology-based Vector CoverageStyling a Topology-based Coverage isn't at all difficult, it's just a little bit more complex than usual because you are required to define 5 different Symbolizers, one for each Primitive. |
| |