brujug presentation 2011-12-15

Upload: oleg-tcaci

Post on 05-Apr-2018

215 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/31/2019 Brujug Presentation 2011-12-15

    1/53

    Spatial Data in the

    Enterprise

    Thursday 5 January 12

  • 7/31/2019 Brujug Presentation 2011-12-15

    2/53

    2

    Used to be a GIS-expert/consultant

    Works as software architect for Enterprise Systems(Vlaamse Overheid)

    Works on the intersection of JEE and spatial datatechnology

    Committer for Hibernate Spatial, Geolatte

    Thursday 5 January 12

  • 7/31/2019 Brujug Presentation 2011-12-15

    3/53

    3

    Spatial data for Java programmers

    Persisting spatial data with Hibernate Spatial

    Spatial data processing with Geolatte (+ tutorial)

    Thursday 5 January 12

  • 7/31/2019 Brujug Presentation 2011-12-15

    4/53

    4

    Thursday 5 January 12

  • 7/31/2019 Brujug Presentation 2011-12-15

    5/53

    5

    Thursday 5 January 12

  • 7/31/2019 Brujug Presentation 2011-12-15

    6/53

    6

    Locations are defined w.r.t. a spatial reference system

    geographic terms or identifiers (names, addresses, postalcodes)

    coordinates of a coordinate reference system

    Thursday 5 January 12

  • 7/31/2019 Brujug Presentation 2011-12-15

    7/53

    Geographic coordinatesLatitude = angle w.r.t.equatorial plan

    Longitude = angle w.r.t. prime

    meridian

    Ellipsoid approximates Geoid

    Geoid is equipotential surfaceat mean sealevel

    7

    Thursday 5 January 12

  • 7/31/2019 Brujug Presentation 2011-12-15

    8/53

    Geodetic Datum

    Fixes ellipsoid to geoid

    WGS84World geodetic datum

    Used for GPS

    Wrong datum =>

    Errors of 50 - 500m. !!

    8

    Thursday 5 January 12

  • 7/31/2019 Brujug Presentation 2011-12-15

    9/53

    Projected coordinate system

    Chose so as to preserves some aspectsEqual-AreaEqui-DistantConformal

    Valid locally

    Examples

    Lambert 72

    LAEA 3035

    UTM

    9

    Thursday 5 January 12

  • 7/31/2019 Brujug Presentation 2011-12-15

    10/53

    Coordinate Reference Systems in practice

    Identified by EPSG identifier or SRID

    See: http://spatialreference.org/ or http://www.epsg-registry.org/

    Gotchas:

    Calculating with geographic coordinates

    Lat/Long or Long/Lat ?

    Google Maps -- EPSG:90093

    10

    Thursday 5 January 12

    http://www.epsg-registry.org/http://www.epsg-registry.org/http://www.epsg-registry.org/http://www.epsg-registry.org/http://www.epsg-registry.org/http://spatialreference.org/http://spatialreference.org/
  • 7/31/2019 Brujug Presentation 2011-12-15

    11/53

  • 7/31/2019 Brujug Presentation 2011-12-15

    12/53

    Rectangular grid(usually)

    One data value per cell

    Related to graphics

    12

    Thursday 5 January 12

  • 7/31/2019 Brujug Presentation 2011-12-15

    13/53

    Geometry = coordinate geometry + a coordinatereference system

    Coordinate geometry = Lists (of lists) of coordinates

    describing the boundaries of the geometry

    13

    Thursday 5 January 12

  • 7/31/2019 Brujug Presentation 2011-12-15

    14/53

    14

    Thursday 5 January 12

  • 7/31/2019 Brujug Presentation 2011-12-15

    15/53

    Named topological relationships

    Disjoint

    Intersects

    Touches

    CrossesOverlaps

    Within

    Contains

    15

    Thursday 5 January 12

  • 7/31/2019 Brujug Presentation 2011-12-15

    16/53

    16

    Thursday 5 January 12

  • 7/31/2019 Brujug Presentation 2011-12-15

    17/53

    17

    Thursday 5 January 12

  • 7/31/2019 Brujug Presentation 2011-12-15

    18/53

    18

    GIS for spatial analysis systems for research ordecision-support

    e.g. ESRI Arc/Info (later ArcGIS)

    No standardisation, limited interoperabilitye.g. Understanding GIS the Arc/Info way

    Exotic: i.e. non-native to common IT-ecosystems

    Thursday 5 January 12

  • 7/31/2019 Brujug Presentation 2011-12-15

    19/53

    19

    Emergence of open standards

    Free/Open source software

    FOSS4G

    2005: Google Maps showed the future

    Abundant spatial data

    GPS, OpenStreetMap

    Thursday 5 January 12

  • 7/31/2019 Brujug Presentation 2011-12-15

    20/53

    20

    Standard-compliant service componentse.g. Web Mapping Service (ESRI, Geoserver, Deegree, Autodesk)

    Spatial data capability in commodity software

    Postgresql (postgis), Hibernate Spatial, JTS/Geotools/Geolatte

    Cheap desktop mapping

    e.g. Quantum GIS, uDIG, MapInfo

    Professional GIS on the desktop

    e.g. ESRI ArcGIS, GRASS (F/OSS)

    Thursday 5 January 12

  • 7/31/2019 Brujug Presentation 2011-12-15

    21/53

    21

    Thursday 5 January 12

  • 7/31/2019 Brujug Presentation 2011-12-15

    22/53

    [A]ims to establish a structured set of standards for information concerningobjects or phenomena that are directly or indirectly associated with a locatiorelative to the Earth.

    ISO 19100 series standards

    /

    22

    Thursday 5 January 12

    http://www.isotc211.org/http://www.isotc211.org/http://www.isotc211.org/
  • 7/31/2019 Brujug Presentation 2011-12-15

    23/53

    The Open Geospatial Consortium (OGC) is an international industryconsortium of 440 companies, government agencies and universitiesparticipating in a consensus process to develop publicly available interfacstandards. OGC Standards support interoperable solutions that "geo-enable" the Web, wireless and location-based services and mainstream ITThe standards empower technology developers to make complex spatial

    information and services accessible and useful with all kinds of applications

    Collaborates closely with TC211

    23

    Thursday 5 January 12

    http://www.opengeospatial.org/http://www.opengeospatial.org/http://www.opengeospatial.org/http://www.opengeospatial.org/standards/http://www.opengeospatial.org/standards/
  • 7/31/2019 Brujug Presentation 2011-12-15

    24/53

    ISO 19107 - Spatial schema

    Geometries in 3-dimensional space

    A.k.a OGC Topic 1: Feature Geometry (ISO 19107 SpatialSchema)

    24

    Thursday 5 January 12

  • 7/31/2019 Brujug Presentation 2011-12-15

    25/53

    Thursday 5 January 12

  • 7/31/2019 Brujug Presentation 2011-12-15

    26/53

    OGC Simple Features Specification for SQL (SFS)

    Geometry by linear interpolation between (2D-)coordinates

    Widely supported in databases, libraries

    ISO 19125 Simple features access (SFA)Successor to SFS

    A.k.a OGC Simple Feature Access

    26

    Thursday 5 January 12

  • 7/31/2019 Brujug Presentation 2011-12-15

    27/53

    27

    Thursday 5 January 12

  • 7/31/2019 Brujug Presentation 2011-12-15

    28/53

    28

    Geometry methods:

    Basicdimension(), SRID(), envelope(), geometryType(), ...

    Querydisjoint(), within(), overlaps(), relate(), ...

    Analysisdistance(), bufer(), union(), ...

    Thursday 5 January 12

  • 7/31/2019 Brujug Presentation 2011-12-15

    29/53

    29

    Coordinates in 2-, 3- or 4 dimensions

    X-, Y-coordinates for location in 2D

    Z-coordinate, typically for elevation

    M-coordinate for measures (SFA only)

    Not real 3D, but 2.5D

    Spatial operations work in the "map geometry" of the data and will therefornot reflect z or m values in calculations (e.g., Equals, Length) or in generatioof new geometry values (e.g., Bufer, ConvexHull, Intersection).

    Thursday 5 January 12

  • 7/31/2019 Brujug Presentation 2011-12-15

    30/53

    30

    (x1,y1,m=0)

    (x2,y2,m=1.3)

    (x3,y3,m=2.5)

    (x4,y4,m=3.2)

    (x5,y5,m=4.1)

    (x2,y2,m=2.1)

    Thursday 5 January 12

  • 7/31/2019 Brujug Presentation 2011-12-15

    31/53

    ISO 13249-3: SQL/MM - Part 3: Spatial Data

    Originally based on the OGC Simple Features Specification forSQL, v1.1 (SFS)

    Defines non-simple geometries: ST_CircularString

    All types and methods prefixed with ST_

    Also defines advanced structures: Topologies, Network

    31

    Thursday 5 January 12

  • 7/31/2019 Brujug Presentation 2011-12-15

    32/53

    ava interfaces for ISO 19100 series specifications

    Proposed OGC standard

    Very literal translation: complicated, verbose

    Not widely used

    /

    32

    Thursday 5 January 12

    http://www.geoapi.org/http://www.geoapi.org/
  • 7/31/2019 Brujug Presentation 2011-12-15

    33/53

    33

    WKT: Well-known Text Representations for Geometry

    POINT(0 1), LineString ( 10 10, 20 20, 30 40),Polygon ((10 10, 10 20, 20 20, 20 15, 10 10))

    WKB: Well-known Binary Representations for Geometry

    ! WKT/WKB do not contain SRID, Z- or M-coordinates !

    Several Extended variants

    Postgis EWKT/EWKB, Sql Server

    Thursday 5 January 12

  • 7/31/2019 Brujug Presentation 2011-12-15

    34/53

    Geographic Markup Language (GML)

    ISO 19136 == OGC GML (currently v3.2.1)

    Large, complex specification==> implementations are often incomplete, inconsistent

    SFGML: Simple Features profile, a sane subsetMore information: http://www.ogcnetwork.net/gml

    34

    Thursday 5 January 12

    http://www.ogcnetwork.net/gmlhttp://www.ogcnetwork.net/gml
  • 7/31/2019 Brujug Presentation 2011-12-15

    35/53

    ESRI Shapefile format

    Open industry standard

    Same scope as SFA/SFS

    Widely used, supported by most systems

    35

    Thursday 5 January 12

  • 7/31/2019 Brujug Presentation 2011-12-15

    36/53

    WMS: Web Map Service (OGC)

    Dynamic mapping

    TMS: Tile Map Serve (informal)

    Static tile maps

    WFS: Web Feature Service (OGC)

    Serves vector data

    36

    Thursday 5 January 12

  • 7/31/2019 Brujug Presentation 2011-12-15

    37/53

    Postgresql / Postgis

    Postgis extension

    Originally based on Simple features Spec.

    Increasingly compliant with SQL/MM

    Very good implementation, well-documented

    MySQL

    Partially compliant with SFS

    Spatial relations based on bounding box ! (incorrect)

    Read the documentation!!

    37

    Thursday 5 January 12

  • 7/31/2019 Brujug Presentation 2011-12-15

    38/53

    Oracle 10g

    SDOGEOMETRY type: proprietary, non-standard model

    Undocumented OGC compliance functions!

    Oracle 11gAdds ST_GEOMETRY type

    SQL/MM compliantInteroperable with SDOGEOMTRY

    38

    Thursday 5 January 12

  • 7/31/2019 Brujug Presentation 2011-12-15

    39/53

    Microsoft SQL Servers

    Excellent SFS-compliant implementation

    Storage format publicly documented

    IBM InformixExcellent SFS-compliant implementation

    Storage format not publicly documented

    GeoDB (H2 based)

    https://github.com/jdeolive/geodb/wiki

    39

    Thursday 5 January 12

    https://github.com/jdeolive/geodb/wikihttps://github.com/jdeolive/geodb/wiki
  • 7/31/2019 Brujug Presentation 2011-12-15

    40/53

    The problem

    SFS was intended for planar 2D geometries (projected mapcoordinates)

    What about geodetic data such as WGS84?

    Geography

    Like a geometry, but assumes geodetic coordinates

    ST_Length(), ST_Area(), ST_Distance() return meters

    Available in Postgis (WGS84 only) and SQL Server

    40

    Thursday 5 January 12

  • 7/31/2019 Brujug Presentation 2011-12-15

    41/53

    ava Topology Suite

    Implements Simple Features Specification for SQLLimited to 2D (but can store Z-coordinates)Problematic with geodetic data (long/lat)

    Many computational geometry algorithms

    Good quality, simple to use, very stableGEOS: port to C, used in Postgis

    /

    41

    Thursday 5 January 12

    http://tsusiatsoftware.net/http://tsusiatsoftware.net/http://tsusiatsoftware.net/http://tsusiatsoftware.net/
  • 7/31/2019 Brujug Presentation 2011-12-15

    42/53

    GeoTools

    Framework for creating GIS-applicationsReferencing, Rendering, Data access, ...

    Fully interoperable with JTS & versions of GeoAPI

    Large (sprawling) set of libraries

    Code of variable quality

    /

    42

    Thursday 5 January 12

    http://www.geotools.org/http://www.geotools.org/http://www.geotools.org/http://www.geotools.org/
  • 7/31/2019 Brujug Presentation 2011-12-15

    43/53

    Geotoolkit.org (Geotk)

    GeoTools fork

    Implements parts of GeoAPI

    Started as clean up and harmonization of GeoTools

    43

    Thursday 5 January 12

    http://www.geotoolkit.org/http://www.geotoolkit.org/
  • 7/31/2019 Brujug Presentation 2011-12-15

    44/53

    Sextante

    Spatial data analysis library

    300+ algorithms for vecor- and raster-data

    Interoperable with JTS

    44

    Thursday 5 January 12

    http://sextante.forge.osor.eu/http://sextante.forge.osor.eu/
  • 7/31/2019 Brujug Presentation 2011-12-15

    45/53

    GeoServer

    Most widely used WMS/WFS/WCS server

    Very active community

    DeegreeSupports WMS, WFS, WCS, WPSSmaller community

    /

    /

    45

    Thursday 5 January 12

    http://www.deegree.org/http://www.deegree.org/http://www.geoserver.org/http://www.deegree.org/http://www.deegree.org/http://www.geoserver.org/http://www.geoserver.org/
  • 7/31/2019 Brujug Presentation 2011-12-15

    46/53

    OpenLayers

    Most commonly used JavaScript client-framework

    /

    GeoMajas

    Integrated application framework (back- & front-end)

    Uses GWT for client UI

    /

    46

    Thursday 5 January 12

    http://www.geomajas.org/http://www.openlayers.org/http://www.geomajas.org/http://www.geomajas.org/http://www.openlayers.org/http://www.openlayers.org/
  • 7/31/2019 Brujug Presentation 2011-12-15

    47/53

    Leaflet

    Mobile web apps (esp. iOS)

    /

    47

    Thursday 5 January 12

    http://leaflet.cloudmade.com/http://leaflet.cloudmade.com/
  • 7/31/2019 Brujug Presentation 2011-12-15

    48/53

    OSGEOOSGeo was created to support the collaborative development of open sourcgeospatial software, and promote its widespread use

    Projects: GeoTools, GeoServer, ....

    FOSS4G: global conference focused on F/OSS for Geospatial

    48

    Thursday 5 January 12

    http://www.osgeo.org/http://www.osgeo.org/
  • 7/31/2019 Brujug Presentation 2011-12-15

    49/53

    OpenStreetMap (OSM)

    Global dataset (roads, admin. boundaries, rivers, ...)

    Community-created

    Creative Commons Attribution-ShareAlike 2.0 license

    Variable quality

    49

    Thursday 5 January 12

    http://creativecommons.org/licenses/by-sa/2.0/http://creativecommons.org/licenses/by-sa/2.0/
  • 7/31/2019 Brujug Presentation 2011-12-15

    50/53

    GeometryUserType for JTS Geometry

    SpatialRestrictions API

    HQL Spatial Functions

    Marshalling/unmarshalling to DB-specific formats

    Service Provider Interface for SpatialDialectProviders

    50

    Thursday 5 January 12

  • 7/31/2019 Brujug Presentation 2011-12-15

    51/53

    51

    Thursday 5 January 12

  • 7/31/2019 Brujug Presentation 2011-12-15

    52/53

    Oracle Spatial (SDOGEOMETRY)

    Postgresql/Postgis

    MySQL

    Microsoft SQL Server 2008

    GeoDB (H2)

    52

    Thursday 5 January 12

  • 7/31/2019 Brujug Presentation 2011-12-15

    53/53

    HS 1.1.x

    Supports Hibernate 3.6

    Adds dwithin(), transform() methods

    HS 4

    Module of Hibernate Core (4.1 probably)

    JTS and Geolatte-geom

    53

    Thursday 5 January 12