gml(geographical markup language)- by: muhammad haris

Upload: muhammadnassarahmad

Post on 12-Oct-2015

23 views

Category:

Documents


0 download

DESCRIPTION

For GIS Students

TRANSCRIPT

  • GMLMuhammad Haris Lecturer GIS Center PUCIT

  • What is GML ?Geographic Markup LanguageBased on XML Developed by OGC.Used to describe Geographics ObjectsUses schemas written in XML It is NOT intended for graphical display but for data storage and data transfer.

  • ClientWeb Mapping ServerDBWMSImage (GIF,JPEG)

  • ClientWeb Mapping ServerDBWFSXML/GMLWill Display Data from XML In HTML Using JavaScript

  • Usage

  • GML is XMLUses XML to define the building blocksDefined with standard XML SchemaConstraints and restrictions defined the same way in all XML SchemasGML document must validate against an XML Schema (GML Schema + domain specific Schema)

  • A SIMPLE GML Document

    ...

  • Basic Rules about GML Document1)Not case sensitive

    2) Starts with Tag

    3)Supports object Property Model

    (envelope)... (point, line, polygons)

  • Basic Rules about GML DocumentUses a FeatureCollection as the basis of its document A FeatureCollection is a collection of GML Features (objects) together with a bounding Box element (which bounds the set of Features)A FeatureCollection can also contain other FeatureCollections

    (envelope)... (point, line, polygons)

  • Bounded By This property intended to provide information about the extent of a featuresIt can be Null or an EnvelopeEnvelope provides upper and lower coordinates

  • GML Geometries(Point, LineString, Polygon)

    (envelope)... (point, line, polygons)

  • Points , Line and PolygonPOINT

    0 3

    LINE

    0 3 0 1 1 0 6 0

    POLYGON

    3 4 5 6 1 8 9 7

  • Multi Point

    4 3.

  • Multi Polyline

    0 3 0 1 1 0 6 0

  • MultiPolygon

    3 4 5 6 1 8 9 7..

  • GML Document Example

  • 30 48 40 70 1ALTAF HIGH SCHOOL {LAHORE}E34 67 32 45

  • GML Schemas and GML Instances

  • GML data instancesGML Application schemasGML Core schemasCreated and maintained by data collectors in different domainsCreated and maintained by data modelers in different domains, such as the transportation industry (Roads GML)Created and maintained by the OGCContains an instance of a geographic object, such as a Bridge feature.Contains the elements and types that define the framework for encoding GML instances.Contain GML core schema elements and types that are imported into the GML application schema.GML Schemas and Instances

  • GML instance and schemaTwo kinds of schema filesGML core SchemasCore part of GMLProvide necessary framework for creating GML application schemasGML Application schemasCan be viewed as an application-specific XML for transportation, natural resources etc.

  • GML Conceptual ModelGML is based on object-property modelGML object an object represents a real word entity. It is also called feature GML property an attribute of objects or relationships between entity objects.Objects are described by properties and property value.

    Ref: http://www.galdosinc.com/resource/open-standards/geography-markup-language Object with 3 PropertiesObject with 2 Properties

  • GML Conceptual Model

  • ObjectsObjects includeGeographic featuresGeometriesCoveragesTime objectsobservationsDefault stylesCoordinate reference systems and Topology

  • Rule for using properties in GMLProperty elements are always children of the object elementFirst letter of a property is usually lower case where as first letter of an object is in uppercaseThe values of objects property must beSimple data typeAnother GML object

    Object with 3 PropertiesHouseLocationCostOwner310000HarisPoint X Y73.3131.55ObjectObjectPropertyPropertyValues (of Property)

  • Rule 1Object with 3 PropertiesHouseLocationCostOwnerObjectPropertyParent Node is Object and child nodes are properties at siblings level

  • Rule 2Object with 3 PropertiesHouseLocationCostOwnerPointObjectObjectPropertyAn Object can indirectly contain another object not directly. Indirectly means that the second object should be inside some property of the first objects

  • Rule 3Object with 3 PropertiesHouseLocationCostOwner310000HarisPoint X Y73.3131.55ObjectObjectPropertyPropertyValues (of Property)Either Multiple Objects OR their Properties can come at same level but not Both at a time

  • Why this ALL conceptual Model of GML ???

    Why not Simple XML Syntax Rules???

  • Answer

    Conceptual Model of GML is introduced to achieve the Object Oriented approach or simply the Real World Approach.

  • RulesParent Node is Object and child nodes are properties at same levelAn Object can indirectly contain another object not directly. Indirectly means that the second object should be inside some property of the first objectsEither Multiple Objects OR their Properties can come at same level but not Both

    Object with 3 PropertiesHouseLocationCostOwner310000HarisPoint X Y73.3131.55ObjectObjectPropertyPropertyValues (of Property)

  • GML (Based on Conceptual Model)

    Haris 200000 73.12 31.32

  • Complete GML

    .

    Haris 200000 73.12 31.32

  • Use WFS Request to Get GMLhttp://localhost:8080/geoserver/wfs?request=GetFeature&typeName=topp:Name_of_Layer&outputFormat=GML3

    http://localhost:8080/geoserver/wfs?request=GetFeature&version=1.1.0&typeName=topp:Phases&outputFormat=GML3&Filter=topp:PhaseName + searchString +"

  • Filter=

    topp:PhaseNamePhase V "

  • Exercise :Use WFS request and Generate GML

    Create a shapefile and Convert it into GML using ArcCatalog and then Compare it with the GML returned from WFS request.

    Explore FILTERS of WFS request

  • Miscellaneous

    .

    Haris 200000 73.12 31.32

    XML and GML are CASE SENSITIVE i.e. their tags are case sensitive.

    GML Object Property Model (GML 3) vsFeature Property Model (GML 1 & 2)

    First Letter of Object is Capital First Letter of Property is Small

    Multiple layers can be retrieved using WFS

    http://localhost:8080/geoserver/wfs?request=GetFeature&typeName=topp:Roads,topp:Land

    **************************************