6.1 Standards
6.2 XML
6.3 GML
6.4 SVG
6.5 Summary
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 490
6 Spatial Data and XML
• Collection of spatial data is particularly expensive
• 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 491
6 Spatial Data and XML
http://www.lgmv.de/
• 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 492
6.1 Standards
• International Organization for
Standardization (ISO)
– International association of
standardization bodies from approx. 160 countries
– Founded in 1947
– Develops 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 493
6.1 Standards
• National standardization bodies and ISO
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 494
6.1 Standards
http://www.geoinformation.net/
• ISO/TC 211 geographic information/geomatics
– Approx. 65 members
– Edits the standard series ISO 19100
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 495
6.1 Standards
http://www.geoinformation.net/
• ISO 19107 Spatial Schema
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 496
6.1 Standards
http://www.geoinformation.net/
• Geometry classes in the spatial schema
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 497
6.1 Standards
http://www.geoinformation.net/
• Open Geospatial Consortium (OGC)
– International consortium of approx. 510 members
(industry, administration, research), founded 1994
– Develops fundamentals for standardized access
methods
for spatial
information
– Member
of W3C
(since 2007)
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 498
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 499
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 500
6.1 Standards
• SQL/MM spatial
vs.
Simple Features
geometry
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 501
6.1 Standards
• 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 502
6.1 Standards
– Representation of the official German surveying in
international institutions
(see chapter 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 503
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 504
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 505
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 506
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 507
6.2 Context-free Grammar
Phrase structure
Turing machine
Context-sensitive
Linear-bounded automata
Context-free
Push-down automata
Regular Finite-state automata
• 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 508
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 509
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 510
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 511
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 512
6.2 Context-free Grammar
• Document class: a concrete class of XML-based
applications
• Document: extension of a document class
• 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 513
6.2 XML
http://image.slidesharecdn.com/
• 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 514
6.2 XML
• Example: a DTD of a city
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 515
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 516
6.2 XML
<?xml version="1.0" standalone="yes"?> <!DOCTYPE city SYSTEM "city.dtd"> <city><name>Braunschweig</name> <inhabitants>251000</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 517
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 518
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 519
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;"/>
• To model non-hierachical structures and for
modularization of XML documents multiple
concepts exist
– Namespaces
– XPath
– XPointer
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 520
6.2 XML
• 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 521
6.2 XML
[EE04]
<AX_Bestandsdatenauszug xmlns:gml="http://www.opengis.net/gml"> … <gml:featureMember> … <gml:pos>3540437.686 5804332.854</gml:pos> … </gml:featureMember> … </AX_Bestandsdatenauszug>
• XML Path Language (XPath)
– Addressing within XML documents (trees)
– Basis of XPointer
• 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 522
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
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 523
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"/>
• 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 524
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 525
6.2 XML-Schema
<simpleType name="PrioType"> <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 526
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>
AX_Bestandsdatenauszug
• Complex element declarations are possible
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 527
6.2 XML-Schema
[EE04]
• Example of a complex element declaration
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 528
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 529
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 530
6.2 XML-Schema
[EE04]
• Geography Markup Language, generated by the
use of XML (and XML-Schema); XML application
• Version 3.2 identical with ISO 19136
• To exchange spatial objects
(in the OGC context: "features")
• Defined by OGC and 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 531
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 532
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 533
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 534
6.3 GML
• Definition of the polygon type
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 535
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 536
6.3 GML
<complexType name="lakeType"> <complexContent> <extension base="gml:AbstractFeatureType"> <sequence> <element ref="gml:extentOf"/> <element name="lakeName" type="string"/> <element name="maxDepth" type="integer"/> <element name="area" type="decimal"/> </sequence> </extension> </complexContent> </complexType>
– Own feature type "lakeType" in the context of
GML types
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 537
6.3 GML
• 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 538
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 539
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 540
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 541
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 542
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 543
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 544
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 545
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>
• 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 546
6.4 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, its width and height
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 547
6.4 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 548
6.4 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 549
6.4 SVG
<svg width="70" height="40"> <rect x="5" y="5" width="50" height="25" style="stroke: blue; fill: none;"> </svg>
• Circle example (with instruction for grouping and
transformation)
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 550
6.4 SVG
<g style="fill-opacity:0.3; stroke:black; stroke-width:0.1cm;"> <circle cx="6cm" cy="2cm" r="100" style="fill:maroon;" transform="translate(0,50)"/> <circle cx="6cm" cy="2cm" r="100" style="fill:deepskyblue;" transform="translate(70,150)"/> <circle cx="6cm" cy="2cm" r="100" style="fill: limegreen;" transform="translate(-70,150)"/> </g>
• Path instruction for complex shapes, lines and areas
– Element’s attributes include the attribute "d" for specifying the points of the path
– Attribute "d" contains further commands for the interpretation of the points
– E.g. a point may be the begin or the end of a curve or of a line
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 551
6.4 SVG
<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;"/>
• Commands of the path instruction
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 552
6.4 SVG
command description example
M (MoveTo) specifies the starting point of a path M20 50
Z (ClosePath) generates a closed shape Z
L (LineTo) draws a line from the current point to the specified point
L50 100
H (Horizontal LineTo)
draws a horizontal line from the current point
H75
V (Vertical LineTo) draws a vertical line from the current point V40
C (CurveTo) draws a Bézier curve from the current point
C30 0 50 20 60 15
Q (Quadratic Bézier CurveTo)
draws a quadratic Bézier curve from the current point
Q40 0 60 20
A (Elliptical Arc) draws an elliptic arc from the current point A25 25 -30 0 1 50 -25
<path fill="none" stroke-width="3" stroke="green" d="M 20 20 l 0 -13 M 16 20 q 0 -10 -5 -10 M 12 20 q 0 -6 -4 -6 M 24 20 q 0 -10 5 -10 M 28 20 q 0 -6 4 -6" id="Pflanzensymbol"/>
• Path example (with quadratic Bezier curve)
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 553
6.4 SVG
• Path example (with grouping command and filled
areas)
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 554
6.4 SVG
<g id="SN3338SymbolApotheke"> <!-- Priority 350 --> <path d="M -250.0 250.0 L -250.0 -250.0 250.0 -250.0 250.0 250.0 Z“ fill= "#FFFFFF"/> <path d="M -200.0 145.0 L -118.0 88.0 -94.0 97.0 -94.0 72.0 -148.0 72.0 -148.0 -27.0 -94.0 -27.0 -94.0 -152.0 33.0 -200.0 161.0 -134.0 161.0 80.0 200.0 115.0 132.0 200.0 62.0 150.0 62.0 72.0 0.0 72.0 0.0 150.0 -73.0 200.0 Z“ fill= "#FF0000"/> <path d="M 0.0 -27.0 L 0.0 -119.0 62.0 -95.0 62.0 -27.0 Z" fill= "#FFFFFF"/> </g>
• Text instruction for text placement – Beside being a graphic
element, in SVG text is also available as a text element
– Several attributes, including “x” and “y” for positioning
– Texts can be translated and turned
– Orientation, alignment, font stretch may be specified among others
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 555
6.4 SVG
[SX08]
• Grouping instruction "g" to group elements
– Attributes of grouped elements can be specified
altogether, e.g. style attributes
– Groups can be named
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 556
6.4 SVG
<g id="SN3338SymbolApotheke"> <path d="M -250.0 250.0 L -250.0 ... Z" fill= "#FFFFFF"/> <path d="M -200.0 145.0 L -118.0 ... Z" fill= "#FF0000"/> <path d="M 0.0 -27.0 L 0.0 ... Z" fill= "#FFFFFF"/></g>
<g style="fill-opacity:0.3; stroke:black; stroke-width:0.1cm;"> <circle cx="6cm" cy="2cm" r="100" style="fill:maroon;" transform="translate(0,50)"/> <circle cx="6cm" cy="2cm" r="100" style="fill:deepskyblue;" transform="translate(70,150)"/> <circle cx="6cm" cy="2cm" r="100" style="fill:limegreen;" transform="translate(-70,150)"/></g>
– Also different elements may be grouped
• With the "use" element an
instance of a named element
(e.g. of a group) is created
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 557
6.4 SVG
<g id="SN3309SymbolParkhausParkdeck"> <path d="M-250.0 310.0 L -250.0 -190.0 0.0 -310.0 250.0 -190.0 250.0 310.0 Z" fill= "#00FFFF"/> <text font-family= "Arial" font-weight= "bold" font-size= "420" stroke= "#FFFFFF" fill= "#FFFFFF" x= "-130.0" y="150.0"> P </text> </g>
<use transform="translate(135463.0,173871.7)" xlink:href="#SN3309SymbolParkhausParkdeck"/>
• SVG can be combined with the
language
Cascading Style Sheets (CSS)
• CSS is a declarative
"style sheet language" for
structured documents
– Known essentially from the html environment
– A non XML based language for specifying format
instructions for document browsers
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 558
6.4 CSS
• A CSS style sheet consists of rules with the following structure
– Selector {property: value; ... property: value;}
– Selector specifies an element; values are assigned to the elements properties
– Selection criteria are properties of the elements (type, class, id, attribute values)
– Selection criteria can be combined
– Usually a simple selection with element names and user defined style classes is sufficient
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 559
6.4 CSS
htt
p:/
/lea
rnw
ebco
de.
com
/
– Example for selecting with element name
– Examples for user defined style classes
".name" shorthand for "*[class ~= name]"
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 560
6.4 CSS
.SN2505LinieGebaeude {fill: none; stroke-width: 18; stroke-linecap: butt; stroke-linejoin: miter; stroke: #000000;}
.SN1309FlaecheGebaeude {fill: #FF7F7F;}
text {font-family:verdana,sans-serif; font-size:40px; font-weight:bold;}
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 561
6.4 CSS
<path class="SN1309FlaecheGebaeude" d="M 109255.8 170060.4 109825.8 170177.9 109867.8 170186.6 109777.9 170628.6 110164.4 170713.6 110179.5 170683.1 111105.2 170903.4 110966.5 171523.6 110750.0 172482.6 109803.6 172264.3 110023.8 171309.5 109642.7 171223.0 109627.7 171289.0 109048.0 171164.0 109255.8 170060.4" /> . . . <path class="SN2505LinieGebaeude" d="M 109255.8 170060.4 109825.8 170177.9 109867.8 170186.6 109777.9 170628.6 110164.4 170713.6 110179.5 170683.1 111105.2 170903.4 110966.5 171523.6 110750.0 172482.6 109803.6 172264.3 110023.8 171309.5 109642.7 171223.0 109627.7 171289.0 109048.0 171164.0 109255.8 170060.4" />
• Overall the structure of a typical SVG document representing a map is as follows – Prolog with XML declaration and
document type definition
– Root element with • Declaration of name spaces
• Domain with Style classes
Named elements
• Elements for the actual drawing of the map with usage of user defined style classes and user defined elements
• Style classes and named elements represent the converted signatures of the respective map series
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 562
6.4 SVG
• Example (drastically shortened)
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 563
6.4 SVG Example
<?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"> .SN1301FlaecheWohnenallgemein {fill: #999999;} .SN1309FlaecheGemeinwesenallgemein {fill: #FF7F7F;} .SN1409FlaecheAckerland {fill: #FFF7BF;} .SN2028LinieFlurstueck {fill: none; stroke-width: 35; stroke-linecap: butt; stroke-linejoin: miter; stroke: #000000;} ... </style>
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 564
6.4 SVG Example
<g id="SN3020SymbolGrenzpunktmitAbmarkungMarke"> <circle cx="0" cy="0" r="75" fill= "#FFFFFF" stroke-width= "18" stroke-linecap= "round" stroke-linejoin= "round" stroke= "#000000"/> </g>
<g id="SN3309SymbolParkhausParkdeck"> <path d="M-250.0 310.0 L -250.0 -190.0 0.0 -310.0 250.0 -190.0 250.0 310.0 Z" fill= "#00FFFF"/> <text font-family= "Arial" font-weight= "bold" font-size= "420" stroke= "#FFFFFF" fill= "#FFFFFF" x= "-130.0" y="150.0">P</text> </g>
<g id="SN3316SymbolKirche"> <path fill="none" stroke= "#000000" stroke-width= "70" stroke-linecap= "butt" d="M0.0 -500.0 L 0.0 500.0"/> <path fill="none" stroke= "#000000" stroke-width= "70" stroke-linecap= "butt" d="M-275.0 -200.0 L 275.0 -200.0"/> </g> ... </defs>
<g id="SN3020SymbolGrenzpunktmitAbmarkungMarke"> <circle cx="0" cy="0" r="75" fill= "#FFFFFF" stroke-width= "18" stroke-linecap= "round" stroke-linejoin= "round" stroke= "#000000"/> </g> <g id="SN3309SymbolParkhausParkdeck"> <path d="M-250.0 310.0 L -250.0 -190.0 0.0 -310.0 250.0 -190.0 250.0 310.0 Z" fill= "#00FFFF"/> <text font-family= "Arial" font-weight= "bold" font-size= "420" stroke= "#FFFFFF" fill= "#FFFFFF" x= "-130.0" y="150.0">P</text> </g> <g id="SN3316SymbolKirche"> <path fill="none" stroke= "#000000" stroke-width= "70" stroke-linecap= "butt" d="M0.0 -500.0 L 0.0 500.0"/> <path fill="none" stroke= "#000000" stroke-width= "70" stroke-linecap= "butt" d="M-275.0 -200.0 L 275.0 -200.0"/> </g> ... </defs>
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 565
6.4 SVG Example
<path class="SN1409FlaecheAckerland" d="M 163075.2 162043.4 193983.3 169300.5 196449.4 173480.0 201844.9 171788.3 200268.2 167276.0 196772.8 167241.7 193983.3 169300.5 193983.3 169300.5 163075.2 162043.4 180931.8 156813.0 198895.6 151572.3 205497.2 173730.9 190894.4 178027.0 169761.8 184244.2 161165.2 186773.1 154540.8 164531.3 163075.2 162043.4 "/> <path class="SN1301FlaecheWohnenallgemein" d="M 123960.0 147432.9 123875.2 147163.4 122999.8 147406.8 122680.8 146334.3 122686.9 146332.5 122616.2 146075.2 122926.8 145975.6 123002.2 146237.2 123310.1 146144.1 123237.3 145886.1 123471.4 145816.4 123542.1 146074.0 124228.2 145866.6 124631.9 147223.8 123960.0 147432.9 "/> <path class="SN1301FlaecheWohnenallgemein" d="M 111499.7 163673.7 111580.0 163524.5 111707.0 163590.7 111631.4 163745.8 111905.0 163895.8 111655.2 164349.4 111873.9 164464.9 111710.9 164754.3 111500.5 164630.4 111191.9 165190.8 110611.5 166280.3 109119.7 165473.0 109718.5 164381.2 110533.8 164829.2 111254.6 163539.4 111499.7 163673.7 "/>
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 566
6.4 SVG Example
<text class="SN4070SchriftSchriftformatN7380" x="101771.7" y="152661.6" transform="rotate(298, 101771.7, 152661.6)" style="text-anchor:middle"> 7</text> <path class="SN2028LinieFlurstueck" d="M 97500.0 134345.8 95762.3 131470.5 92887.4 126769.8 90013.4 121943.5 89040.0 120309.0 88213.4 119028.2 87314.6 117817.5 86282.6 116686.2 85167.5 115675.6 83887.6 114900.7 82581.0 114250.4 81131.0 113720.8 79689.9 113374.2 78183.7 113099.9 65450.8 111336.0 61192.8 110781.8 61420.6 109817.6 61513.5 109503.0 78351.9 111810.4 80055.0 112168.3 81678.6 112597.7 83280.9 113148.8 84486.0 113778.0 86267.9 114767.4 88137.0 116437.9 90324.1 120113.6 97702.1 132411.4 98275.1 133309.0 98637.4 133876.7 102813.9 140923.9 102996.0 141231.1 103646.0 142327.2 103810.2 142604.2 104510.2 143777.2 106326.4 146820.5 106914.1 147108.1 105217.3 147925.1 105352.9 147327.1 105247.1 147169.2 105188.5 146773.1 103512.5 144002.9 103400.2 144083.4 102172.1 142076.9 97500.0 134345.8"/> <text class="SN4111SchriftSchriftformatK10700" x="89451.7" y="78291.6"> 44/1</text>
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 567
6.4 SVG Example
<use transform="translate(44745.6,213153.9)" xlink:href="#SN3020SymbolGrenzpunktmitAbmarkungMarke"/> <use transform="translate(42021.4,192419.5)" xlink:href="#SN3020SymbolGrenzpunktmitAbmarkungMarke"/> ... </svg>
• Standards
– International Organization for Standardization (ISO)
– Open Geospatial Consortium (OGC)
– Working Committee of the Surveying Authorities of
the States of the Federal Republic of Germany (AdV)
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 568
6.5 Summary
• XML
– Standard for exchanging data on the web
– Elements, attributes, entities
– Name spaces, XPath, XPointer
– XML Schema
– Data types, elements
• GML
– Abstract feature type
– Definition of an own feature type
– AFIS ALKIS ATKIS schema of the AdV
– Web Feature Service
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 569
6.5 Summary
• SVG
– Rectangle
– Circle
– Path
– Text
– Grouping
– CSS
– Example "SVG map"
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 570
6.5 Summary
Spatial Databases and GIS – Karl Neumann, Sarah Tauscher– Ifis – TU Braunschweig 571
6.5 Summary
GIS
objects
thematic geometry
vector
collect
manage analyse
display
SVG
GML
XML