GeoMashup CodeCamp 2011University of Helsinki
Department of Computer Science
A crash course to
Coordinate Systems, Map Projections and Data Formats
Ilkka RinneFounder & CTO, Spatineo Oy
21. lokakuuta 11
Startup software companyfounded in 2011
Geospatial Data in the Web
Software-as-a-Service (SaaS)
21. lokakuuta 11
Geo App Developer Community
Data Providers
Better access &powerful tools
EncourageEmpower
Knowledge &Technical support
21. lokakuuta 11
Geo App Developer Community
Data Providers
Better access &powerful tools
EncourageEmpower
Knowledge &Technical support
Better, more productive
communication
21. lokakuuta 11
In This Presentation
Full material at the course web site:http://codecamp11.spatineo.com/lecture-material
21. lokakuuta 11
In This PresentationCoordinates & Coordinate Systems
Full material at the course web site:http://codecamp11.spatineo.com/lecture-material
21. lokakuuta 11
In This PresentationCoordinates & Coordinate Systems
(Map Projections)
Full material at the course web site:http://codecamp11.spatineo.com/lecture-material
21. lokakuuta 11
In This PresentationCoordinates & Coordinate Systems
(Map Projections)
Geospatial Data Formats in the Web
Full material at the course web site:http://codecamp11.spatineo.com/lecture-material
21. lokakuuta 11
In This PresentationCoordinates & Coordinate Systems
(Map Projections)
Geospatial Data Formats in the Web
Open Standards forWeb GeoData Access
Full material at the course web site:http://codecamp11.spatineo.com/lecture-material
21. lokakuuta 11
Coordinates(0,0)
Same Coordinate System, different coordinates for different places
(-1,1) (1,1)
21. lokakuuta 11
Some Terminology
Geodetic Coordinate System (GCS)“Geodeettinen koordinaatisto”
Coordinate System, where the location is defined by geodetic longitude, geodetic latitude and height from an agreed height reference.
Coordinate System (CS)“Koordinaatisto” in Finnish
Set of mathematical rules for giving locations to places as set of coordinates. Number of axes defines the number of coordinates.
21. lokakuuta 11
A Side Note:Latitude & Longitude
Image from Wikimedia Commons, http://commons.wikimedia.org/wiki/File:Latitude_and_Longitude_of_the_Earth.svgOriginally by Djexplo, in public domain
21. lokakuuta 11
More TerminologyGeodetic Datum“Datuumi” in Finnish
Set of parameters for relating a Geodetic Coordinate System to the Earth by setting it’s origin, scale and orientation. Typically has a Reference Ellipsoid approximating the shape of the actual Earth’s surface.
(Geodetic) Coordinate Reference System (CRS)“Koordinaattijärjestelmä”
A Geodetic Coordinate System fixed to the Earth using some Geodetic Datum.
21. lokakuuta 11
Earth is not a sphere
Image from Wikimedia Commons, http://commons.wikimedia.org/wiki/File:Earth_Western_Hemisphere_transparent_background.pngOriginally by NASA, in public domain
21. lokakuuta 11
Earth is not a sphere
Image from Wikimedia Commons, http://commons.wikimedia.org/wiki/File:Earth_Western_Hemisphere_transparent_background.pngOriginally by NASA, in public domain
21. lokakuuta 11
Earth is not a sphere
Image from Wikimedia Commons, http://commons.wikimedia.org/wiki/File:Earth_Western_Hemisphere_transparent_background.pngOriginally by NASA, in public domain
It’s more like an ellipsoid
21. lokakuuta 11
Actually, it’s not an ellipsoid either
Image by NASA, http://earthobservatory.nasa.gov/Features/GRACE/page3.php
21. lokakuuta 11
Actually, it’s not an ellipsoid either
Image by NASA, http://earthobservatory.nasa.gov/Features/GRACE/page3.php
Gravity anomalies make even the “sea only”shape of the Earth’s surface slightly “bumpy” = Geoid
21. lokakuuta 11
Actually, it’s not an ellipsoid either
Image by NASA, http://earthobservatory.nasa.gov/Features/GRACE/page3.php
Gravity anomalies make even the “sea only”shape of the Earth’s surface slightly “bumpy” = Geoid
Choose and orient an ellipsoid wisely — get a fit that’s “good enough”
21. lokakuuta 11
Altitude Coordinates
Surface of the Earth
Surface of the ellipsoid
Geoid (mean sea level)
Ellipsoidal height
Height from sea level
(geoid)
Geoid height
Geoid: surface where the oceans would settle only based Earth’s gravitational force. On continents, the
fictional continuum of this “mean sea level”
8,848 m
21. lokakuuta 11
Altitude Coordinates
Surface of the Earth
Surface of the ellipsoid
Geoid (mean sea level)
Ellipsoidal height
Height from sea level
(geoid)
Geoid height
Geoid: surface where the oceans would settle only based Earth’s gravitational force. On continents, the
fictional continuum of this “mean sea level”
8,848 m
21. lokakuuta 11
Common Geodetic CRSs
WGS84 (global, used by the GPS system)
ETRS89 (For Europe, Eurasian plate isstatic)
NAD83 (For US, Canada & Mexico, North American plate is static)
All three use the same ellipsoid, but with a bit different parameters: more precise at the most
important regions
21. lokakuuta 11
CRS Realization
Coordinate Reference System + set of precisely measured positions on Earth.
Makes it possible to define coordinatesfor new locations by measuring distances
to the known reference positions.
21. lokakuuta 11
CRS Realization Example:EUREF-FIN
In Finland the practical realization of ETRS89 CRS is
called EUREF-FIN.
Precise locations of the reference points measured by the Finnish Geodetic Institute using satellite measurement networks and triangulation
21. lokakuuta 11
Confusing Naming!
CRS realization is also called a Coordinate System (“Koordinaatisto”).
Datum can also mean CRS in English sometimes.
21. lokakuuta 11
Limited Area CRS
Coordinate Reference System may only be valid at certain parts of the world (where it’s accurate enough)
21. lokakuuta 11
Interpreting Coordinates
<gml:boundedBy> <gml:Envelope srsName="EPSG:4326"> <gml:lowerCorner>63.1945 -7.6639</gml:lowerCorner> <gml:upperCorner>69.6897 11.3687</gml:upperCorner> </gml:Envelope></gml:boundedBy>
21. lokakuuta 11
Interpreting Coordinates
<gml:boundedBy> <gml:Envelope srsName="EPSG:4326"> <gml:lowerCorner>63.1945 -7.6639</gml:lowerCorner> <gml:upperCorner>69.6897 11.3687</gml:upperCorner> </gml:Envelope></gml:boundedBy>
Spatial Reference System
Read:“CRS is WGS84 (2D),
axis order: latitude, longitude”
21. lokakuuta 11
Interpreting Coordinates
<gml:boundedBy> <gml:Envelope srsName="EPSG:4326"> <gml:lowerCorner>63.1945 -7.6639</gml:lowerCorner> <gml:upperCorner>69.6897 11.3687</gml:upperCorner> </gml:Envelope></gml:boundedBy>
The “EPSG:4326” is also known as“urn:ogc:def:crs:EPSG::4326” and“http://www.opengis.net/def/crs/EPSG/0/4326”
Spatial Reference System
Read:“CRS is WGS84 (2D),
axis order: latitude, longitude”
21. lokakuuta 11
Interpreting Coordinates
<gml:boundedBy> <gml:Envelope srsName="EPSG:4326"> <gml:lowerCorner>63.1945 -7.6639</gml:lowerCorner> <gml:upperCorner>69.6897 11.3687</gml:upperCorner> </gml:Envelope></gml:boundedBy>
The “EPSG:4326” is also known as“urn:ogc:def:crs:EPSG::4326” and“http://www.opengis.net/def/crs/EPSG/0/4326”
Spatial Reference System
Read:“CRS is WGS84 (2D),
axis order: latitude, longitude”
When in doubt: http://spatialreference.org/
21. lokakuuta 11
EPSG Codes European Petroleum Survey Group, currently part of the
International Association of Oil & Gas Producers
EPSG Geodetic Parameter Set: code names for a multitude of different CRSes, map projections, reference ellipsoids, datums etc., see EPSG Online Registryhttp://www.epsg-registry.org/
Some often needed EPSG Codes:4326: WGS84 (2D) CRS, coordinates: lat, lon4979.:WGS84 (3D) CRS, coordinates: lat, lon, ellipsoidal height4258: ETRS89 (2D) CRS, coordinates: lat, lon4258: ETRS89 (3D) CRS, coordinates: lat, lon, ellipsoidal height5048: ETRS89-TM35FIN(N,E) CRS, coordinates: N, E4123: KKJ (deprecated Finnish system), lat, lon2393: YKJ (deprecated Finnish system), northing, easting5717: N60 Vertical datum, mean sea level at Helsinki in 19603902: ETRS89-TM35FIN(N,E) + N60 vertical datum
More at: http://www.maanmittauslaitos.fi/sites/default/files/tiedostolataukset/kartat/koordinaatit/epsg_koodit.pdf
You need these for identifying in which CRS the given coordinates
are, and when transforming coordinates (or points) from one
CRS to another.
Codes used widely in GIS software.
21. lokakuuta 11
Map Projections
Coordinate transformation from geodetic coordinates to planar coordinates
21. lokakuuta 11
Map Projections
Coordinate transformation from geodetic coordinates to planar coordinates
21. lokakuuta 11
Map Projections
All projections distort the surface somehow. Select the least harmful way
for each mapping task.
21. lokakuuta 11
Common Map ProjectionsGeneral Perspective Projection“as seen from space”•Only one half of the globe can be seen•Ok if you can change the center point (rotate)
Google Earth
21. lokakuuta 11
Common Map ProjectionsStereographic•Shapes are preserved locally•Can be used for maps over the poles
21. lokakuuta 11
Common Map ProjectionsMercator•Google, Bing Maps, Ovi (Nokia)?•Good for areas near the Equator, not suitable for polar regions
21. lokakuuta 11
Common Map ProjectionsTransverse Mercator• The cylinder is rotated 90º•Accurate near the chosen central meridian
21. lokakuuta 11
Common Map ProjectionsUniversal Transverse Mercator (UTM)
Earth divided into 6º wide zones, separate Transverse Mercator projection defined for each.
Images: Wikimedia Commons, http://en.wikipedia.org/wiki/File:Utm-zones.jpgCarlos Furuti, http://www.progonos.com/furuti/MapProj/Normal/ProjNav/Img/utm1.jpg
21. lokakuuta 11
Common Map ProjectionsUniversal Transverse Mercator (UTM)
Earth divided into 6º wide zones, separate Transverse Mercator projection defined for each.
Images: Wikimedia Commons, http://en.wikipedia.org/wiki/File:Utm-zones.jpgCarlos Furuti, http://www.progonos.com/furuti/MapProj/Normal/ProjNav/Img/utm1.jpg
21. lokakuuta 11
Finnish Map Projections(ETRS-)TM35FIN
UTM based, the whole Finland in one, widened
zone, central meridian is 27ºE
Projection zone
Equator
Ellipsoid Cylinder
Central meridian
Projection zone
Central meridian
Equator
(0,0 m)
Make coordinates positive:move the origin (false easting).
In TM35FIN the point where the Equator and the central meridian (27º)
cross has coordinate N:0 E:500 000
Central meridian
Surface of the cylinder
Surface of the ellipsoid
Scale (Mk) = 1.0
Images: Maanmittauslaitoshttp://www.maanmittauslaitos.fi/kartat/koordinaatit/
27ºE
21. lokakuuta 11
Some Geometry TypesPoint - a single position
Line - two positions connected to each other
LineString - multiple lines connected to each other
Polygon - a closed LineString (can have holes!)
MultiPolygon - multiple polygons in one (ex. the islands of a lake)
(types slightly differ from data format to another)
21. lokakuuta 11
Geospatial Data Formats: GML
Extensive “toolbox” for building languages for geospatial data, or “GML Application Profiles”
Standard by Open Geospatial Consortium (OGC).
Geospatial objects and especially their geometries as XML structures.
Geography Markup Language
Very complex geometry types available.
21. lokakuuta 11
Geospatial Data Formats: GML
Extensive “toolbox” for building languages for geospatial data, or “GML Application Profiles”
Standard by Open Geospatial Consortium (OGC).
Geospatial objects and especially their geometries as XML structures.
Geography Markup Language
Very complex geometry types available.
21. lokakuuta 11
GML Simple Features Profile
Restricted set of GML geometry property types and simplified CRS handling:
“This profile defines a restricted but useful subset of XML-Schema and GML to lower the “implementation bar” of time and resources required for an organization to commit for developing software that supports GML.”
GML simple features profile, OGC-05-033r9, 05-July-2005
Powerful enough for most use cases, geometry types can be stored as geospatial objects in geo-enabled databases, like PostGIS & Oracle Spatial
21. lokakuuta 11
Geospatial Data Formats: GeoJSON
“GML Simple Features for JSON”
Supports the following geometry types: Point, LineString, Polygon, MultiPoint, MultiLineString,
MultiPolygon, and GeometryCollection
Geo-enabled object encoded in JavaScript Object Notation (JSON)
21. lokakuuta 11
Geospatial Data Formats: GeoJSON
“GML Simple Features for JSON”
Supports the following geometry types: Point, LineString, Polygon, MultiPoint, MultiLineString,
MultiPolygon, and GeometryCollection
Geo-enabled object encoded in JavaScript Object Notation (JSON)
21. lokakuuta 11
Geospatial Data Formats: KML
Formerly Keyhole Markup Language
Developed for Google Earth (was: Keyhole Earth Viewer)
Standardized by Open Geospatial Consortium in 2008
In addition to defining geometries & their visualization, also offers some GUI and data linking features.
WGS84 CRS only: latitude, longitude(, altitude).
21. lokakuuta 11
Geospatial Data Formats: KML
Formerly Keyhole Markup Language
Developed for Google Earth (was: Keyhole Earth Viewer)
Standardized by Open Geospatial Consortium in 2008
In addition to defining geometries & their visualization, also offers some GUI and data linking features.
WGS84 CRS only: latitude, longitude(, altitude).
21. lokakuuta 11
Geospatial Data Formats: (Geo)RSS
Two profiles, GeoRSS Simple and GeoRSS GML
Basic idea: location & geometry info embedded into an Atom or RSS feed entries.
GeoRSS Simple is very straightforward: elements for point, line, polygon, box and circle.
GeoRSS GML is a subset of GML geometry properties (a profile)
21. lokakuuta 11
Open StandardGeo Web Services
• Standardized by the Open Geospatial Consortium (OGC):
• Web Map Service (WMS)
• Web Feature Service (WFS)
• HTTP-based to access spatial information as pre-rendered maps (WMS) or GML objects (WFS)
21. lokakuuta 11
OGC Web Map Service (WMS)
• Retrieve pre-rendered images of selected map layers
• for the given geographic bounding box,
• in the wanted map projection,
• using standard HTTP requests.
• Offered layers & available options as an XML document (GetCapabilities).
21. lokakuuta 11
OGC Web Feature Service (WFS)
• Retrieve objects with geospatial properties
• filtered by custom queries,
• encoded as GML Features (XML),
• using standard HTTP requests.
• Also advertises the service offerings and options using GetCapabilities documents.
21. lokakuuta 11
WMS & WFSAdoption
• OGC & ISO Standards, wide support in both Commercial & Open Source software.
• Huge boost for adoption in Europe: EU INSPIRE Directive requires that public sector agencies open a lot of their geospatial databases as WMS & WFS services.
• Gradual implementation 2010 - 2019.
21. lokakuuta 11
Team Up Now• Some of you probably like playing solo, but
this is a teamwork course.
• Meet with your team before Monday to brainstorm about your app ideas and which data resources you’re going to use.
• Come back here on Monday 24th at 14 -16 to announce your selection of data resources (minimum of two), and to learn about the Google Web Toolkit demo application.
21. lokakuuta 11