6.1 Standards 6.2 XML
6.3 GML 6.4 XSLT 6.5 SVG
6.6 Summary
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 494
6 Spatial Data and XML
• Collection of spatial data is particularly expensive
• Spatial data is durable, must be updated nevertheless
• Geoservices are increasingly offered by the internet
• Spatial data should be capable of being integrated and easily interchangeable
• Unified visualization of spatial data is desirable
• Preferably do not use individual formats but common standards
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 495
6 Spatial Data and XML
http://picture.yatego.com/
• De facto standards emerge over time through frequent use
• De facto standards are standardized by institutions
• In the area of standards for spatial data the following institutions are important
– International Organization for Standardization (ISO) – Open Geospatial Consortium (OGC)
– Working Committee of the Surveying Authorities of the States of the Federal Republic of Germany
(Arbeitsgemeinschaft der Vermessungsverwaltungen der Länder der Bundesrepublik Deutschland (AdV))
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 496
6.1 Standards
• International Organization for Standardization (ISO)
– International association of
standardization bodies from approx. 150 countries – Develops international standards in many technical
areas
– Serves the exchange of goods and services and the mutual cooperation
– In the area of spatial information 5 working groups (in ISO/TC 211)
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 497
6.1 Standards
• National standardization bodies and ISO
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 498
6.1 Standards
http://www.geoinformation.net/
• ISO/TC 211 geographic information/geomatics
– Approx. 60 members
– Edits the standard series ISO 19100
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 499
6.1 Standards
http://www.geoinformation.net/
• ISO 19107 Spatial Schema
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 500
6.1 Standards
http://www.geoinformation.net/
• Geometry classes in the spatial schema
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 501
6.1 Standards
http://www.geoinformation.net/
• Open Geospatial Consortium (OGC)
– International consortium of approx. 440 members (industry, administration, research)
– Develops fundamentals for standardized access
methods for spatial
information
– Member of W3C
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 502
6.1 Standards
http://www.geoinformation.net/
– Products of the OGC are specifications
• Basic models, abstract specifications, implementation specifications
– Overview of abstract specifications
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 503
6.1 Standards
http://www.geoinformation.net/
http://www.geoinformation.net/
– Particularly important: Simple Features
• Standard for modeling the geometry of spatial objects
• 0-, 1-, 2-dimensional, straight lines, no topology
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 504
6.1 Standards
• SQL/MM spatial vs.
Simple Features geometry
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 505
6.1 Standards
• Cooperation between ISO/TC 211 and OGC
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 506
6.1 Standards
http://www.geoinformation.net/
• Working Committee of the
Surveying Authorities of the States of the Federal Republic of Germany (AdV)
– Coordination of the German cadastral surveying – Development of recommendations for
• Authoritative topographic cartographic information system (amtliches topographisch-kartographisches
Informationssystem (ATKIS))
• Authoritative real estate cadastre information system (amtliches Liegenschafts-Kataster-Informationssystem (ALKIS))
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 507
6.1 Standards
– Representation of the official German surveying in international institutions (see section 2.6 AAA-Project)
– Provide ISO/OGC-compliant components for spatial data infrastructure
– Example: AFIS-ALKIS-ATKIS specialized technical
schema with 226 object types, including
• Buildings
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 508
6.1 Standards
• Object class: AX_Gebaeude with definition:
“A permanent building, whose documentation is required because of its importance as a property and which serves the purpose of the basic information of real estate cadastre”
• With 20 attributes, including:
• Function of building with approx. 200 values, including:
• 2000 (business/industry), 2056 (pharmacy), 2081 (restaurant), 3071 (police)
– Provide the technical schemas (and all object copies) in ISO/OGC-compliant formats
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 509
6.1 Standards
• Example: a single building
<AX_Gebaeude gml:id="DEHHSERV00001FN1">
...
<position>
<gml:Polygon>
<gml:exterior>
<gml:Ring>
...
<gml:pos>3567807.047 5930017.550</gml:pos>
<gml:pos>3567810.850 5930024.755</gml:pos>
...
<gml:pos>3567807.047 5930017.550</gml:pos>
...
</gml:Ring>
</gml:exterior>
</gml:Polygon>
</position>
<gebaeudefunktion>2000</gebaeudefunktion>
<weitereGebaeudefunktion>1170</weitereGebaeudefunktion>
<bauweise>2100</bauweise>
<anzahlDerOberirdischenGeschosse>1</anzahlDerOberirdischenGeschosse>
<anzahlDerUnterirdischenGeschosse>1</anzahlDerUnterirdischenGeschosse>
<dachform>3100</dachform>
</AX_Gebaeude>
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 510
6.1 Standards
• Extensible Markup Language
• Representation of hierarchically structured data in the format of text files
• Metalanguage for the description
and generation of markup languages
• "Standard for exchanging data on the web"
• "Special context-free grammar for defining specific context-free grammars"
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 511
6.2 XML
• A (formal) grammar G = (N, , P, S) consists of
– A finite set N of nonterminal symbols
– A finite set of terminal symbols, with N =
– A finite set P of production rules,
each rule of the form ( N)* N ( N)* ( N)*
– A distinguished symbol S N, the start symbol
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 512
6.2 Context-free Grammar
http://www.willamette.edu/~fruehr/
• Example G = ({A,B,C,st},
{a,b,c,x},
{st ABc, A aAb, A x,
B BCc, bbB ,
xCc }, st)
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 513
6.2 Context-free Grammar
• A context-free grammar (CFG) is a grammar G = (N, , P, S)
where all pP have the form
n ( N)*
with nN
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 514
6.2 Context-free Grammar
• A CFG generating n-tupels Gntup = ({S, name, n-tuple, element, chars, letter, digit},
{[, ], 0, 1, …, 9. a, b, …, z, A, B. …, Z}, {S [ name n-tuple ],
n-tuple element n-tuple, n-tuple , element [ name chars ],
name letter chars, chars ,
chars letter chars, chars digit chars, letter a, … z, A, …, Z, digit 0, …, 9 },
S)
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 515
6.2 Context-free Grammar
• By applying some pP and reducing N and P
Gntup defines another CFG Gaddr =
({S, chars, letter, digit}
{[, ], 0, 1, …, 9. a, b, …, z, A, B. …, Z}, {S [ address [ street letter chars ] [ houseNumber digit chars]
[ postalCode digit digit digit digit digit]
[city letter chars ] ] , chars ,
chars letter chars, chars digit chars,
letter a, … z, A, …, Z, digit 0, …, 9 }, S)
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 516
6.2 Context-free Grammar
• Some wL(Gntup)
– [ n2 [ e1 28Xtw2a ] [ e2 why ] ]
– [ LX31a [ nb4d 46376233bstadwBGaC ]
[ jffd34gv FsL23rgJ ] [ ml22 Kernel ]
[ dd 35Tmndsl ] [ st st ] [ XTc noise7 ] ]
• Some wL(Gaddr)
– [address [street Fischteichweg] [houseNumber 42A]
[postalCode 26603] [city Aurich] ]
– [address [street tc8] [houseNumber 35stg]
[postalCode 37240] [city groM2] ]
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 517
6.2 Context-free Grammar
• A (concrete) class of XML-based applications is also called document class
• An extension of such a class is called a document (or an application)
• The structure of
document classes can be specified by means of a
document type definition (DTD)
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 518
6.2 XML
http://www.swisseduc.ch/informatik/
• Main components of the DTDs are
– Elements – Attributes – Entities
• Elements are the basic modules of XML documents
– Consist of a start and an end tag – May be empty
– May be nested (hierarchical structure of XML documents)
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 519
6.2 XML
• Example: a DTD of a city
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 520
6.2 XML
classes city, name, inhabitants, area, polygon, point, x, y;
aggregations (city, name) (1), (city, inhabitants) (0..1), (city, area) (1),
(area, polygon) (1..n), (polygon, point) (4..n), (point, x) (1),
(point, y) (1);
<!ELEMENT city(name, inhabitants?, area)>
<!ELEMENT name (#PCDATA)>
<!ELEMENT inhabitants(#PCDATA)>
<!ELEMENT area(polygon+)>
<!ELEMENT polygon (point, point, point, point, point*)>
<!ELEMENT point(x, y)>
<!ELEMENT x (#PCDATA)>
<!ELEMENT y (#PCDATA)>
– A well-formed instance:
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 521
6.2 XML
<?xml version="1.0" standalone="yes"?>
<!DOCTYPE city SYSTEM "city.dtd">
<city><name>Braunschweig</name>
<inhabitants>248000</inhabitants>
<area>
<polygon>
<point><x>10323</x><y>2294</y></point>
<point><x>10708</x><y>2429</y></point>
<point><x>11148</x><y>2594</y></point>
<point><x>10353</x><y>2484</y></point> ...
</polygon>
</area>
</city>
– Another well-formed instance:
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 522
6.2 XML
<?xml version="1.0" standalone="yes"?>
<!DOCTYPE city SYSTEM "city.dtd">
<city><name>Ausschnitt</name>
<inhabitants>aus</inhabitants>
<area>
<polygon>
<point><x>welchem</x><y>Text</y></point>
<point><x>Du</x><y>gleichst</y></point>
<point><x>dem</x><y>Geist</y></point>
...
<point><x>nicht</x><y>mir</y></point>
</polygon>
</area>
</city>
• Attributes specify additional properties of elements
– Example:
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 523
6.2 XML
[EE04]
<text font-family= "Arial" font-weight= "bold" font-size= "350"
stroke= "#FFFFFF" fill= "#FFFFFF" x= "-130.0" y="115.0"> U
</text>
• Entities
– Placeholder for content
– Will be declared once and can be used repeatedly – At each place of use the parser replaces reference by
appropriate value – Example:
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 524
6.2 XML
<!ENTITY baumgrün "#00ff00">
<!ENTITY grenzviolett "#9900ff">
<path id="SN4100_einzelsignaturNadelholz"
d="M 130 0 L -50 0 0 -180 50 0"
fill="none" stroke-miterlimit="20"
stroke-linejoin="miter"
stroke-width="12" stroke="&baumgrün;"/>
• A central XML concept is integration of data and meta-data (XML documents include complete
self-descriptions)
• Therefore, removal of DTDs is obvious (for reuse)
• Large-scale projects may have several DTDs (possible name conflicts)
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 525
6.2 XML
http://www.xmlgrrl.com/publications/
• For combining XML documents multiple concepts exist
– Namespaces – XPath
– XPointer – XLink
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 526
6.2 XML
http://www.jeckle.de/
• Namespaces
– Are declared as attribute (of an element) and apply to all sub-trees of that element
– Include a Uniform Resource Identifier (URI) as address
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 527
6.2 XML
[EE04]
<AX_Bestandsdatenauszug
xmlns:gml="http://www.opengis.net/gml"...>
...<gml:featureMember>...
...</gml:featureMember>...
</AX_Bestandsdatenauszug>
• XML Path Language (XPath)
– Addressing within XML documents
– Basis of XSL Transformations (XSLT) and XPointer
– Navigation in XML documents (trees) with address paths
• Address paths
– Absolute (begin with '/' for root node) or – Relative (to the current context node)
– Contain axis information, node tests, predicates
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 528
6.2 XML
[EE04]
• XML Pointer Language (XPointer)
– Addressing parts of XML documents – Extension of XPath
– Simple references refer to XML elements which are identified by an ID
– Complex references with specifications of blocks (start-point, end-point, range)
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 529
6.2 XML
<g id="SN3316SymbolKirche">
<path fill="none" stroke= "#000000" ... d="M0.0 -500.0 L 0.0 500.0"/>
<path fill="none" stroke= "#000000" ... d="M-275.0 -200.0 L 275.0 -200.0"/>
</g>
<use transform="translate(120515.9,152201.3) rotate(136)"
xlink:href="#SN3316SymbolKirche"/>
• XML Linking Language (XLink)
– Syntax for defining links within XML documents
– XLinks are linking XML elements with other XML elements
– Declaration by xlink:href="URI"
– URI information may contain XPointer expressions
– There are simple (xlink: type = "simple") and extended (xlink: type = "extended") XLinks
– Extended XLinks are linking more than two sources
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 530
6.2 XML
http://graphics.cs.uni- sbxlink:href="URI".de/
• Structure of XML documents can be defined by DTDs
• However, expressiveness of DTDs is restricted
– No specific data
types (only CDATA) – Only few structuring
options by sub-elements
– Integrity constraints hardly definable
<!ELEMENT city(name, inhabitants?, area)>
<!ELEMENT name (#PCDATA)>
<!ELEMENT inhabitants(#PCDATA)>
<!ELEMENT area(polygon+)>
<!ELEMENT polygon
(point, point, point, point, point*)>
<!ELEMENT point(x, y)>
<!ELEMENT x (#PCDATA)>
<!ELEMENT y (#PCDATA)>
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 531
6.2 XML
• XML-Schema
– Language for modeling structured information – Describes by schema language
• Data types
• Documents
• Document Groups
– Alternative to DTDs
– Element contents can be typed and reused
– Allows limitations of value ranges and specifications of cardinalities
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 532
6.2 XML-Schema
<simpleType name="PriorityType">
<restriction base="positiveInteger">
<minInclusive value="100"/>
<maxInclusive value="999"/>
</restriction>
</simpleType>
• Numerous data types are provided, including
– xsd:string, xsd:boolean, xsd:decimal, xsd:float, xsd:time, xsd:date, xsd:integer (xsd: namespace of XML-Schema)
• Construction of data types with
– Base type with restrictions
• Length specifications, patterns, ranges, enumerations
• List types and union types
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 533
6.2 XML-Schema
<!-- names of some ALKIS object classes -->
<!-- may only contain certain characters -->
<xsd:simpleType name="ObjektartName">
<xsd:restriction base="xsd:string">
<xsd:pattern value="A[XP]_[a-zA-Z0-9_]+"/>
</xsd:restriction>
</xsd:simpleType>
• Complex element declarations are possible
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 534
6.2 XML-Schema
[EE04]
• Example of a complex element declaration
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 535
6.2 XML-Schema
<element name="Signaturen">
<complexType>
<sequence>
<element name="Signatur" minOccurs="1" maxOccurs="unbounded">
<complexType>
<choice>
<element name="FlaechenSignatur" type="loc:SigFlaeche"/>
<element name="LinienSignatur" type="loc:SigLinie"/>
<element name="SymbolSignatur" type="loc:SigSymbol"/>
<element name="SchriftSignatur" type="loc:SigSchrift"/>
</choice>
<attribute name="Nr" type="loc:SigNrType" use="required"/>
<attribute name="Typ" type="loc:SigTypType" use="required"/>
<attribute name="Darstellungsprioritaet" type="loc:PrioType"use="required"/>
<unique name="uniqueSigNr"><selector xpath="."/><field xpath="@Nr"/></unique>
</complexType>
</element>
</sequence>
</complexType>
</element>
<element name="Signaturen">
<complexType>
<sequence>
<element name="Signatur" minOccurs="1" maxOccurs="unbounded">
<complexType>
<choice>
<element name="FlaechenSignatur" type="loc:SigFlaeche"/>
<element name="LinienSignatur" type="loc:SigLinie"/>
<element name="SymbolSignatur" type="loc:SigSymbol"/>
<element name="SchriftSignatur" type="loc:SigSchrift"/>
</choice>
<attribute name="Nr" type="loc:SigNrType" use="required"/>
<attribute name="Typ" type="loc:SigTypType" use="required"/>
<attribute name="Darstellungsprioritaet" type="loc:PrioType"use="required"/>
<unique name="uniqueSigNr"><selector xpath="."/>
<field xpath="@Nr"/></unique>
</complexType>
</element>
</sequence>
</complexType>
</element>
• Example of an element instance
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 536
6.2 XML-Schema
<Signaturen>
...
<Signatur Nr="4286" Typ="Schrift" Darstellungsprioritaet="380">
<SchriftSignatur>
<Bezeichnung>Schriftformat F K 28 blau</Bezeichnung>
<SchriftStyle>
<Schriftart>Arial</Schriftart>
<Schriftstil>Fett, Kursiv</Schriftstil>
<Schriftgrad>28 pt</Schriftgrad>
<Schriftfarbe><Farbgrundton>Blau</Farbgrundton>
<Cyan>100</Cyan> <Magenta>0</Magenta>
<Yellow>0</Yellow><Black>20</Black>
</Schriftfarbe>
</SchriftStyle>
<Effekt>Grossbuchstaben</Effekt>
</SchriftSignatur>
</Signatur>
...
</Signaturen>
• Definition of keys and foreign keys
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 537
6.2 XML-Schema
[EE04]
• Geography Markup Language
• Markup Language generated by the use of XML (and XML-Schema); XML application
• To exchange spatial objects (in the OGC context: "features")
• Defined by the Open Geospatial Consortium with the ISO TC 211
• Defines numerous constructs for modelling own spatial applications, including
– Objects (features) and geometries
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 538
6.3 GML
• The basic elements and data types are defined in 33 XML-Schema documents (base schemas)
• A concrete application has to be derived from the given schemas
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 539
6.3 GML
[SX08]
• The central class is the abstract feature type
• “All specific feature types defined in application
schemas must be derived from AbstractFeatureType”
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 540
6.3 GML
<complexType name="AbstractFeatureType" abstract="true">
<complexContent>
<extension base="gml:AbstractGMLType">
<sequence>
<element ref="gml:boundedBy" minOccurs="0"/>
<element ref="gml:location" minOccurs="0"/>
<!-- additional properties must be specified in an application schema -->
</sequence>
<attribute name="fid" type="string"></attribute>
</extension>
</complexContent>
</complexType>
• Among others the geometries of the “Simple Features” are provided
– Typically 2-dimensional geometries with straight lines – Including points, lines, polygons
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 541
6.3 GML
• Definition of the polygon type
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 542
6.3 GML
<complexType name="PolygonType">
<complexContent>
<extension base="gml:AbstractGeometryType">
<sequence>
<element name="outerBoundaryIs">
<complexType>
<sequence><element ref="gml:LinearRing"/></sequence>
</complexType>
</element>
<element name="innerBoundaryIs" minOccurs="0" maxOccurs="unbounded">
<complexType>
<sequence><element ref="gml:LinearRing"/></sequence>
</complexType>
</element>
</sequence>
</extension>
</complexContent>
</complexType>
• Definition of an own feature type
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 543
6.3 GML
<complexType name="lakeType">
<complexContent>
<extension base="gml:AbstractFeatureType">
<sequence>
<element name="lakeName" type="string"/>
<element name="maxDepth" type="integer"/>
<element name="area" type="decimal"/>
</sequence>
</extension>
</complexContent>
</complexType>
• AFIS ALKIS ATKIS schema of the AdV is a (very large) example of a GML-
compliant modeling of a spatial application
• Consists of a base schema (contains common base classes for spatial objects)
• And of technical schemas (containing all object classes needed for representing the information occurring in cadastral surveying)
• For ALKIS there exist more than 220 object types including numerous types of relationships
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 544
6.3 GML
http://www.adv-online.de/
• Here only a very small example is presented:
the schema of a single object class
"AX_Gebaeude" (simplified)
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 545
6.3 GML
<element name="AX_Gebaeude"/>
<complexType name="AX_GebaeudeType">
<complexContent>
<extension base="adv:AG_ObjektType">
<sequence>
<element name="gebaeudefunktion"
type="adv:AX_GebaeudefunktionType"/>
<element maxOccurs="unbounded" minOccurs="0"
name="weitereGebaeudefunktion"
type="adv:AX_Weitere_GebaeudefunktionType"/>
<element maxOccurs="unbounded" minOccurs="0"
name="name" type="string"/>
<element maxOccurs="unbounded" minOccurs="0" name="nutzung"
type="adv:AX_Nutzung_GebaeudePropertyType"/>
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 546
6.3 GML
<element minOccurs="0" name="bauweise"
type="adv:AX_Bauweise_GebaeudeType"/>
<element minOccurs="0" name="anzahlDerOberirdischenGeschosse"
type="integer"/>
<element minOccurs="0" name="anzahlDerUnterirdischenGeschosse"
type="integer"/>
<element minOccurs="0" name="hochhaus" type="boolean"/>
<element minOccurs="0" name="objekthoehe" type="gml:LengthType"/>
<element minOccurs="0" name="dachform"
type="adv:AX_DachformType"/>
<element minOccurs="0" name="zustand"
type="adv: AX_Zustand_GebaeudeType"/>
<element minOccurs="0" name="geschossflaeche" type="gml:AreaType"/>
<element minOccurs="0" name="grundflaeche" type="gml:AreaType"/>
<element minOccurs="0" name="umbauterRaum" type="gml:VolumeType"/>
<element maxOccurs="unbounded" minOccurs="0"
name="baujahr" type="integer"/>
<element minOccurs="0" name="lageZurErdoberflaeche"
type="adv:AX_LageZurErdoberflaeche_GebaeudeType"/>
<element minOccurs="0" name="dachart" type="string"/>
<element minOccurs="0" name="dachgeschossausbau"
type="adv:AX_Dachgeschossausbau_GebaeudeType"/>
<element minOccurs="0" name="gebaeudekennzeichen" type="string"/>
<element maxOccurs="unbounded" minOccurs="0"
name="zeigtAuf" type="gml:ReferenceType">
</element>
<element maxOccurs="unbounded" minOccurs="0"
name="gehoert" type="gml:ReferenceType">
</element>
<element minOccurs="0" name="gehoertZu“ type="gml:ReferenceType">
</element>
<element maxOccurs="unbounded" minOccurs="0"
name="haengtZusammenMit" type="gml:ReferenceType">
</element>
</sequence>
</extension>
</complexContent>
</complexType>
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 547
6.3 GML
<AX_Gebaeude gml:id="DEHHSERV00001FN1">
...
<position>
<gml:Polygon>
<gml:exterior>
<gml:Ring>
<gml:pos>3567807.047 5930017.550</gml:pos>
<gml:pos>3567810.850 5930024.755</gml:pos>
...
<gml:pos>3567807.047 5930017.550</gml:pos>
</gml:Ring>
</gml:exterior>
</gml:Polygon>
</position>
<gebaeudefunktion>2000</gebaeudefunktion>
<weitereGebaeudefunktion>1170</weitereGebaeudefunktion>
<bauweise>2100</bauweise>
<anzahlDerOberirdischenGeschosse>1</anzahlDerOberirdischenGeschosse>
<dachform>3100</dachform>
</AX_Gebaeude>
– An instance of "AX_Gebaeude" (simplified)
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 548
6.3 GML
"position":
inherited of class
AG_ObjektType
• GML serves (also) for the exchange of spatial objects
• Therefor the Web Feature Service (WFS) was defined
– Web-based access to data "of a distributed GIS"
– Only vector data are exchanged
– Requests are sent as a HTTP request from a client to the WFS
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 549
6.3 GML
http://workshops.opengeo.org/
– WFS offers the following operations
• GetCapabilities
• GetFeature
• DescribeFeatureType
• Transaction
• LockFeature
• GetCapabilities
– Describes which WFS services are available
– Gives the names of the available feature types
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 550
6.3 GML
http://www.htw-dresden.de/
• DescribeFeatureType
– Describes the schema of a feature type
• GetFeature
– Delivers an instance of a feature
– Supports spatial and non-spatial selections
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 551
6.3 GML
<wfs:Query typeName="AX_Gebaeude">
<ogc:Filter>
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>weitereGebaeudefunktion</ogc:PropertyName>
<ogc:Literal>1170</ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:Filter>
</wfs:Query>
• Extensible Stylesheet Language for Transformation
• Programming language to transform XML documents
• Computational complete
• Based on tree structure of XML documents
• Used to define transformation rules
• Is a declarative and functional programming language
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 552
6.4 XSLT
• XSLT programs (XSLT stylesheets) are XML documents themselves
• Stylesheets are read by XSLT processors; based on the stylesheets' rules the XSLT processors then transforms input documents into output documents
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 553
6.4 XSLT
• A transformation consists of transformation rules (templates) with the following structure
– An XPath-based pattern
– Instructions for constructing the target tree
• Patterns select nodes of the source tree
• From these nodes the instructions generate parts of the target tree
• Frame of a transformation (XSLT stylesheet):
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 554
6.4 XSLT
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet xmlns:xsl=http://www.w3.org/1999/XSL/Transform version="1.0">
<xsl:output method="xml" />
<!– rules -->
</xsl:stylesheet>
• Main construct is the template
– If several transformation rules are applicable, the most specific one is
applied
– Within a template
numerous instructions may occur
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 555
6.4 XSLT
http://data2type.de/xml/
<xsl:template match="...">
...instructions...
</ xsl: template>
• <xsl:apply-templates select = ... mode = ...>
... parameters may occur...
</xsl:apply-templates>
– Explicit call of templates
– In the select attribute specification of an XPath expression
– With it selection of the nodes to be processed
– If no select element is present, all direct child nodes are processed
– With the mode parameters further node selection can be performed
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 556
6.4 XSLT
• <xsl:value-of select = .../>
– Generates a string at the current position in the output tree
– String can be the value of a node or of a defined variable
– Select attribute selects node, variable, or parameter whose value is to be used
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 557
6.4 XSLT
• <xsl:for-each select = ...>
...instructions...
</xsl:for-each>
– Iteration instructions within a template definition
– All instructions within this statement are applied to all specified nodes
– Select attribute selects nodes
• <xsl:text>
– Generates static text in the result tree
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 558
6.4 XSLT
• <xsl:choose>
– Frame for sequence of queries – <xsl:when test = ...>
...instructions... </xsl:when>
– Queries are finished with <xsl:otherwise>
– Those query is selected whose condition as first yields true
• <xsl:if test = ...> ...instructions... </xsl:if>
– Conditional execution of instructions – Test attribute contains condition
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 559
6.4 XSLT
• Example for the use of XSLT
– Transformation of XML-compliant extracts of the digital landscape model (DLM25)
into TK25-like graphics (see section 3.2) – Here: derivation rule for local roads
(are drawn as white lines with a narrow purple boundary)
– Template scans data for local roads and generates drawing commands
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 560
6.4 XSLT Example
• A (fairly short) road in the given landscape dataset
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 561
6.4 XSLT Example
<AtkisMember>
<Strasse>
<gml:name>Badstrasse</gml:name>
<AtkisOID>86118065</AtkisOID>
<gml:centerLineOf>
<gml:coord>
<gml:X>4437952.980</gml:X>
<gml:Y>5331812.550</gml:Y>
</gml:coord>
<gml:coord>
<gml:X>4437960.070</gml:X>
<gml:Y>5331818.450</gml:Y>
</gml:coord>
<gml:coord>
<gml:X>4437967.200</gml:X>
<gml:Y>5331825.410</gml:Y>
</gml:coord>
</gml:centerLineOf>
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 562
6.4 XSLT Example
<Attribute>
<Zustand>in Betrieb</Zustand>
<AnzahlDerFahrstreifen
Bedeutung="tatsaechliche Anzahl"> 2 </AnzahlDerFahrstreifen>
<Funktion>Strassenverkehr</Funktion>
<VerkehrsbedeutungInneroertlich>
Anliegerverkehr
</VerkehrsbedeutungInneroertlich>
<BreiteDerFahrbahn>Keine Zuweisung </BreiteDerFahrbahn>
<Widmung>Gemeindestrasse</Widmung>
<InternationaleBedeutung>
Attribut trifft nicht zu </InternationaleBedeutung>
<VerkehrsbedeutungUeberoertlich>
Attribut trifft nicht zu
</VerkehrsbedeutungUeberuertlich>
</Attribute>
</Strasse>
</AtkisMember>
• Search for local roads
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 563
6.4 XSLT Example
<xsl:template
match="/dlm:AtkisModell/dlm:AtkisMember/dlm:Strasse">
<xsl:if test="contains(dlm:Attribute/dlm:Widmung,’Gemeindestrasse’) or contains(dlm:Attribute/dlm:Widmung,’Sonstiges’)">
<xsl:call-template name="DrawPath">
<xsl:with-param name="styleclass"
select="linieNebenstrasseNahverkehrVordergrund">
</xsl:call-template>
</xsl:if>
</xsl:template> <AtkisMember>
<Strasse>
<gml:name>Badstrasse</gml:name>
<AtkisOID>86118065</AtkisOID>
<gml:centerLineOf>
<gml:coord>
<gml:X>4437952.980</gml:X>
<gml:Y>5331812.550</gml:Y>
</gml:coord>
• Generating line signatures
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 564
6.4 XSLT Example
<xsl:template name="DrawPath">
<xsl:param name="styleclass"/>
<svg:path>
<xsl:attribute name="class"><xsl:value-of select="$styleclass"/></xsl:attribute>
<xsl:attribute name="d">
<xsl:for-each select="gml:centerLineOf/gml:coord">
<xsl:choose>
<xsl:when test="position() = 1">
<xsl:text>M </xsl:text><xsl:call-template name="getX"/>
<xsl:text> </xsl:text><xsl:call-template name="getY"/>
<xsl:text> L </xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="getX"/>
<xsl:text> </xsl:text><xsl:call-template name="getY"/>
<xsl:if test="position() != last()"><xsl:text> </xsl:text></xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:attribute>
</svg:path>
</xsl:template>
• Templates "getX" and "getY" read x and y
coordinates, transform the coordinates into map coordinates, and write it to the current position in the output tree
• Style class
“linieNebenstrasseNahverkehrVordergrund”:
• Line which is generated in the example (SVG statement):
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 565
6.4 XSLT Example
.linieNebenstrasseNahverkehrVordergrund
{ fill: none; stroke-width: 8.5px; stroke: snow; stroke-linejoin: round}
<path class="linieNebenstrasseNahverkehrVordergrund"
d="M 8245.97 -2142.98 L 8253.65 -2146.15 8259.83 -2151.12"/>
• Scalable Vector Graphics (SVG)
• XML-based language for
describing two-dimensional, freely scalable vector graphics
• Standard of the W3C
• Beside static graphics also interactions, animation, and filter applications are provided
• SVG files are relatively small and are editable with any text editor
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 566
6.5 SVG
• SVG documents are structured like XML documents
– Prolog with XML declaration and document type declaration
– Root element, including
• Declaration of namespaces and
• Definition area (also for non-SVG code)
– Attributes "width" and "height" specify the width and the height of the entire graphic
– Optional attribute "viewBox" defines reference frame, specified are its left lower point and its width
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 567
6.5 SVG
– Example, declares a frame for a real estate map in the context of an A3 landscape format and a scale of
1:1000
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 568
6.5 SVG
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width= "42.0cm" height= "29.7cm
viewBox= "99269.744 150779.44 42000.0 29700.0"
xmlns:xlink= "http://www.w3.org/1999/xlink">
<defs>
<style type="text/css">
.SN2028LinieFlurstueck{fill: none; stroke-width: 35; stroke-linecap: butt;
stroke-linejoin: miter; stroke: #000000;}
...
</style>
...
</defs>
...
</svg>
• Several SVG elements and attributes, including
– Line between 2 points (line)
– Line connecting several points (polyline) – Rectangle (rect)
– Circle – Ellipse – Polygon – Path
– Text
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 569
6.5 SVG
<svg width="70" height="40">
<rect x="5" y="5"
width="50" height="25"
style="stroke: blue; fill: none;">
</svg>