Mapping, GIS and geolocating data in Java <ul>Using Open Source software </ul><ul>Joachim Van der Auwera Geosparc 348 </ul>
<ul>AGENDA </ul><ul><ul><li>GIS basics
Data and data formats
Database options
Java libraries
Java servers and frameworks </li></ul></ul><ul></ul>
<ul>GIS basics </ul><ul><ul><li>Maps, layers, tiles and features </li></ul></ul><ul><ul><li>Geometries
Spatial operations and queries
Projections and Coordinate Reference Systems </li></ul></ul><ul><ul><li>Location? </li></ul></ul><ul></ul>
<ul>Layers </ul><ul><ul><li>Handling complexity
Data is split
Overlays
Transparency </li></ul></ul><ul></ul>
<ul>Tiles </ul><ul><ul><li>Handling size
Data is split
Stitched together at joins
Fixed size
WMTS
Eases cacheability </li></ul></ul><ul></ul>
<ul>Features </ul><ul><ul><li>Represents a real-world phenomenon
Has geometry, linking to location on earth
Has attributes, e.g. “maximum depth” for a lake </li></ul></ul><ul></ul>
<ul>Geometry </ul><ul><ul><li>Point, multi-
Linestring, multi-
Linear ring, multi-
Polygon, multi- </li></ul></ul><ul><ul><li>Usually only one type per layer </li></ul></ul><ul></ul>
<ul>Geometry limitations </ul><ul><ul><li>Constraints on allowed linestring and polygons </li></ul></ul><ul></ul>
<ul>Spatial queries </ul><ul><ul><li>Distance, buffers, joins, intersections
CQL, ECQL </li></ul></ul><ul></ul>
<ul>Coordinate Reference Systems </ul><ul><ul><li>Coordinate notation
Spherical or ellipsoid approximation </li><ul><li>Which ellipsoid </li></ul><li>Origin: (Meridian, Greenwich)?
Unit: degrees, meters,...
Influence of time
WGS84 : global, used by GPS </li><ul><li>(lat,lon) or (lon,lat) </li></ul><li>Many local variants </li></ul></ul><ul></ul>
<ul>Projections </ul><ul><ul><li>The world is not flat
But a screen/paper is
Approximate using a sphere
Approximate using an ellipsoid
Some options </li><ul><li>Cylindrical
Start from a point (azimuthal)
Conical </li></ul></ul></ul><ul></ul>
<ul>Projections, always a compromise </ul><ul><ul><li>Conformal
Equal-area
Equidistant
e.g </li><ul><li>Mercator </li></ul></ul></ul><ul><ul><ul><li>Winkel Tripel
Lambert cyl </li></ul></ul></ul><ul><ul><ul><li>Equirectangular
Sinusoidal </li></ul></ul></ul><ul><ul><ul><li>Molleweide </li></ul></ul></ul><ul></ul>
<ul>Waterman to the rescue? </ul><ul></ul>
<ul>Coordinate Reference Systems </ul><ul><ul><li>EPSG database </li></ul></ul><ul><ul><ul><li>http://www.epsg-registry.or...
Google Mercator (originally 900913, then 3785, now gone?) </li></ul></ul></ul><ul><ul><li>Duplicates </li><ul><li>EPSG:432...
WG:84 </li></ul></ul></ul><ul></ul>
<ul>CRS, SRS, SRID </ul><ul><ul><li>Coordinate Reference System (CRS)
often expressed as Well Known Text (WKT)
SRS, Spatial Reference Code </li><ul><li>EPSG:54019 </li></ul><li>SRID, Spatial Reference ID </li><ul><li>54019
Depends on authority!
Usually EPSG </li></ul></ul></ul><ul></ul>
<ul>Projecting raster images? </ul><ul><ul><li>Aereal images need corrections
Image affected by </li><ul><li>Height of camera
Projection + location (e.g. Mercator!)
Angle of photo + height of surface  </li></ul></ul></ul><ul></ul>
<ul>Precision  </ul><ul><ul><li>Precision allows aligning coordinates on a grid </li><ul><li>Can skew results on spatial o...
<ul>CRS transformations </ul><ul><ul><li>Transformations can be inaccurate as lines turn into curves </li></ul></ul><ul></ul>
Upcoming SlideShare
Loading in...5
×

Mapping, GIS and geolocating data in Java

6,748

Published on

Published in: Economy & Finance
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
6,748
On Slideshare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
313
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Mapping, GIS and geolocating data in Java

  1. 1. Mapping, GIS and geolocating data in Java <ul>Using Open Source software </ul><ul>Joachim Van der Auwera Geosparc 348 </ul>
  2. 2. <ul>AGENDA </ul><ul><ul><li>GIS basics
  3. 3. Data and data formats
  4. 4. Database options
  5. 5. Java libraries
  6. 6. Java servers and frameworks </li></ul></ul><ul></ul>
  7. 7. <ul>GIS basics </ul><ul><ul><li>Maps, layers, tiles and features </li></ul></ul><ul><ul><li>Geometries
  8. 8. Spatial operations and queries
  9. 9. Projections and Coordinate Reference Systems </li></ul></ul><ul><ul><li>Location? </li></ul></ul><ul></ul>
  10. 10. <ul>Layers </ul><ul><ul><li>Handling complexity
  11. 11. Data is split
  12. 12. Overlays
  13. 13. Transparency </li></ul></ul><ul></ul>
  14. 14. <ul>Tiles </ul><ul><ul><li>Handling size
  15. 15. Data is split
  16. 16. Stitched together at joins
  17. 17. Fixed size
  18. 18. WMTS
  19. 19. Eases cacheability </li></ul></ul><ul></ul>
  20. 20. <ul>Features </ul><ul><ul><li>Represents a real-world phenomenon
  21. 21. Has geometry, linking to location on earth
  22. 22. Has attributes, e.g. “maximum depth” for a lake </li></ul></ul><ul></ul>
  23. 23. <ul>Geometry </ul><ul><ul><li>Point, multi-
  24. 24. Linestring, multi-
  25. 25. Linear ring, multi-
  26. 26. Polygon, multi- </li></ul></ul><ul><ul><li>Usually only one type per layer </li></ul></ul><ul></ul>
  27. 27. <ul>Geometry limitations </ul><ul><ul><li>Constraints on allowed linestring and polygons </li></ul></ul><ul></ul>
  28. 28. <ul>Spatial queries </ul><ul><ul><li>Distance, buffers, joins, intersections
  29. 29. CQL, ECQL </li></ul></ul><ul></ul>
  30. 30. <ul>Coordinate Reference Systems </ul><ul><ul><li>Coordinate notation
  31. 31. Spherical or ellipsoid approximation </li><ul><li>Which ellipsoid </li></ul><li>Origin: (Meridian, Greenwich)?
  32. 32. Unit: degrees, meters,...
  33. 33. Influence of time
  34. 34. WGS84 : global, used by GPS </li><ul><li>(lat,lon) or (lon,lat) </li></ul><li>Many local variants </li></ul></ul><ul></ul>
  35. 35. <ul>Projections </ul><ul><ul><li>The world is not flat
  36. 36. But a screen/paper is
  37. 37. Approximate using a sphere
  38. 38. Approximate using an ellipsoid
  39. 39. Some options </li><ul><li>Cylindrical
  40. 40. Start from a point (azimuthal)
  41. 41. Conical </li></ul></ul></ul><ul></ul>
  42. 42. <ul>Projections, always a compromise </ul><ul><ul><li>Conformal
  43. 43. Equal-area
  44. 44. Equidistant
  45. 45. e.g </li><ul><li>Mercator </li></ul></ul></ul><ul><ul><ul><li>Winkel Tripel
  46. 46. Lambert cyl </li></ul></ul></ul><ul><ul><ul><li>Equirectangular
  47. 47. Sinusoidal </li></ul></ul></ul><ul><ul><ul><li>Molleweide </li></ul></ul></ul><ul></ul>
  48. 48. <ul>Waterman to the rescue? </ul><ul></ul>
  49. 49. <ul>Coordinate Reference Systems </ul><ul><ul><li>EPSG database </li></ul></ul><ul><ul><ul><li>http://www.epsg-registry.org/ </li></ul></ul></ul><ul><ul><ul><li>EPSG:4326 is WGS84 </li></ul></ul></ul><ul><ul><ul><li>EPSG:3857 is Mercator
  50. 50. Google Mercator (originally 900913, then 3785, now gone?) </li></ul></ul></ul><ul><ul><li>Duplicates </li><ul><li>EPSG:4326 (lat-lon or lon-lat) </li></ul></ul></ul><ul><ul><ul><li>urn:x-ogc:def:crs:EPSG:6.11.2:4326
  51. 51. WG:84 </li></ul></ul></ul><ul></ul>
  52. 52. <ul>CRS, SRS, SRID </ul><ul><ul><li>Coordinate Reference System (CRS)
  53. 53. often expressed as Well Known Text (WKT)
  54. 54. SRS, Spatial Reference Code </li><ul><li>EPSG:54019 </li></ul><li>SRID, Spatial Reference ID </li><ul><li>54019
  55. 55. Depends on authority!
  56. 56. Usually EPSG </li></ul></ul></ul><ul></ul>
  57. 57. <ul>Projecting raster images? </ul><ul><ul><li>Aereal images need corrections
  58. 58. Image affected by </li><ul><li>Height of camera
  59. 59. Projection + location (e.g. Mercator!)
  60. 60. Angle of photo + height of surface </li></ul></ul></ul><ul></ul>
  61. 61. <ul>Precision </ul><ul><ul><li>Precision allows aligning coordinates on a grid </li><ul><li>Can skew results on spatial operations </li></ul></ul></ul><ul></ul>
  62. 62. <ul>CRS transformations </ul><ul><ul><li>Transformations can be inaccurate as lines turn into curves </li></ul></ul><ul></ul>
  63. 63. <ul>Location </ul><ul><ul><li>Where am I? </li></ul></ul><ul><ul><ul><li>In browser, HTML5, based on IP, GPS, GSM signal </li></ul></ul></ul><ul><ul><li>Where is …? </li><ul><li>Mostly through geocoder web-services </li><ul><li>Geonames (http://www.geonames.org/) </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Nominatim (http://nominatim.openstreetmap.org/) </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Google API, Mappy, Yahoo! PlaceFinder </li></ul></ul></ul></ul><ul></ul>
  64. 64. <ul>Data and data formats </ul><ul><ul><li>OGC Standards: WMS, WFS, WMST
  65. 65. Raster formats: GeoTiff, JPEG2000, ...
  66. 66. Vector formats: GeoJSON, KML, shape, ...
  67. 67. Free data: OpenStreetMap, Natural Earth, local data </li></ul></ul><ul></ul>
  68. 68. <ul>Open Geospatial Consortium </ul><ul><ul><li>Home to most of the GIS related standards </li></ul></ul><ul><ul><li>http://www.opengeospatial.org/
  69. 69. WMS, Web Map Service
  70. 70. WFS, Web Feature Service
  71. 71. WMTS, Web Map Tile Service
  72. 72. WKT, Well Known Text
  73. 73. GML, Geographic Markup Language
  74. 74. KML, Keyhole Markup Language (Google)
  75. 75. SLD, Styled Layer Description
  76. 76. WPS, Web Processing Service
  77. 77. WCS, Web Coverage Service
  78. 78. ... </li></ul></ul><ul></ul>
  79. 79. <ul>Other raster formats </ul><ul><ul><li>GeoTIFF
  80. 80. JPEG2000
  81. 81. MrSID </li></ul></ul><ul><ul><li>Erdas Imagine
  82. 82. SDTS
  83. 83. ECW
  84. 84. DTED
  85. 85. NITF
  86. 86. NASA ELAS
  87. 87. GRASS rasters
  88. 88. ESRI grid
  89. 89. NetCDF
  90. 90. ... </li></ul></ul><ul></ul>
  91. 91. <ul>Other vector formats </ul><ul><ul><li>Shape file (ESRI), very common
  92. 92. GeoJSON
  93. 93. TIGER
  94. 94. DXF (AutoCad)
  95. 95. SDF (Autodesk, MapGuide) </li></ul></ul><ul></ul>
  96. 96. <ul>Open / free data </ul><ul><ul><li>OpenStreetMap, community built map </li></ul></ul><ul><ul><ul><li>http://www.openstreetmap.org/ </li></ul></ul></ul><ul><ul><li>Natural Earth </li></ul></ul><ul><ul><ul><li>http://www.naturalearthdata.com/ </li></ul></ul></ul><ul><ul><li>Local data </li></ul></ul><ul></ul>
  97. 97. <ul>Database options </ul><ul><ul><li>Why a spatial database? </li><ul><li>Spatial operations
  98. 98. OGC “Simple Features for SQL” support </li></ul></ul></ul><ul><ul><ul><ul><li>… WHERE ST_Intersection(roads.geom, city.geom) </li></ul></ul></ul></ul><ul><ul><ul><li>Spatial indexes </li></ul><li>Relational </li><ul><li>PostGis
  99. 99. GeoDB / H2 </li></ul><li>NoSQL </li><ul><li>Neo4j </li></ul></ul></ul><ul></ul>
  100. 100. <ul>PostGIS </ul><ul><ul><li>Spatial PostgreSQL
  101. 101. PostgreSQL 8.3 or higher </li></ul></ul><ul><ul><li>(non-Java)
  102. 102. High Performance
  103. 103. Data Integrity
  104. 104. Complete support </li><ul><li>All spatial operations
  105. 105. Coordinate transformations
  106. 106. n-dimensional </li></ul></ul></ul>project PostGis version 1.5.2 site http://postgis.refractions.net/ license GPL (JDBC driver is BSD) <ul></ul>
  107. 107. <ul>GeoDB </ul><ul><ul><li>Spatial H2
  108. 108. In-memory DB </li><ul><li>ideal for junit testing </li></ul><li>Does not support all methods, but can easily be extended </li></ul></ul>project GeoDB version 0.4 site https://github.com/jdeolive/geodb/wiki license BSD-like <ul></ul>
  109. 109. <ul>Neo4j </ul><ul><ul><li>NoSQL, graph database </li></ul></ul><ul><ul><li>geographic features stored as graphs
  110. 110. Great OpenStreetMap support (import etc)
  111. 111. Not all spatial operations (e.g. buffer) </li></ul></ul>project Neo4j spatial version 0.5 site wiki.neo4j.org/content/Neo4j_Spatial license AGPL <ul></ul>
  112. 112. <ul>Java Libraries </ul><ul><ul><li>JTS
  113. 113. GeoTools
  114. 114. Hibernate Spatial
  115. 115. GeoToolkit
  116. 116. Proj4j
  117. 117. GeoLatte
  118. 118. OpenLayers ?
  119. 119. Google, Bing!, Yahoo! Maps ? </li></ul></ul><ul></ul>
  120. 120. <ul>JTS </ul><ul><ul><li>JTS Topology Suite
  121. 121. Geometric model
  122. 122. Geometric operations
  123. 123. Spatial structures and algorithms
  124. 124. I/O capabilities </li><ul><li>WKT, WKB, GML </li></ul></ul></ul>project JTS version 1.11 site http://tsusiatsoftware.net/jts/main.html license LGPL <ul></ul>
  125. 125. <ul>GeoTools </ul><ul><ul><li>GIS tools covering a wide
  126. 126. range of topics </li></ul></ul>project GeoTools version 2.7.1 site http://www.geotools.org/ license LGPL <ul></ul>
  127. 127. <ul><ul><li>Many modules </li><ul><li>Referencing (CRS, transformations,...)
  128. 128. Filtering (CQL, ECQL)
  129. 129. Rendering
  130. 130. Coverage (raster images in many formats)
  131. 131. Data access (DB, WFS, raster, shape,...) </li></ul><li>Extensions </li><ul><li>Schema
  132. 132. Graph
  133. 133. WMS client
  134. 134. Validation </li></ul></ul></ul>project GeoTools <ul></ul>
  135. 135. <ul>Hibernate Spatial </ul><ul><ul><li>Spatial extension for
  136. 136. Hibernate
  137. 137. Register your data provider </li></ul></ul><ul><ul><ul><li>hibernate.dialect=org.hibernatespatial.postgis.PostgisDialect </li></ul></ul></ul><ul><ul><li>Special type for storing a Geometry </li></ul></ul><ul><ul><ul><li>@Column(name = &quot;geom&quot;)
  138. 138. @Type(type = &quot;org.hibernatespatial.GeometryUserType&quot;)
  139. 139. private Geometry geometry; </li></ul></ul></ul><ul><ul><li>Spatial queries, also using Criteria
  140. 140. DB support: PostGis, Oracle10i, MySQL, MSSQL, GeoDB (H2) </li></ul></ul>project Hibernate Spatial version 1.1 site http://www.hibernatespatial.org/ license LGPL <ul></ul>
  141. 141. <ul><li>GeoToolkit </li></ul><ul><ul><li>GIS tools covering a wide
  142. 142. range of topics </li></ul></ul><ul><ul><li>Module based </li><ul><li>Referencing
  143. 143. Coverage
  144. 144. Display (swing)
  145. 145. Analytics </li></ul><li>Originally a fork of (part of) GeoTools but with cleanup and refactoring, and Java6 only </li></ul></ul>project GeoToolkit version 3.18 site http://www.geotoolkit.org/ license LGPL <ul></ul>
  146. 146. <ul>Proj4J </ul><ul><ul><li>Java version of Proj4
  147. 147. CRS handling
  148. 148. transformations </li></ul></ul>project Proj4J version 0.1 (-snapshot) site http://trac.osgeo.org/proj4j/ license MIT? <ul></ul>
  149. 149. <ul>GeoLatte </ul><ul><ul><li>Reusable GIS
  150. 150. components
  151. 151. Modules </li><ul><li>Base: transformations, filtering, GeoJSON
  152. 152. Featureserver: access data through Hibernate spatial
  153. 153. Graph
  154. 154. Mapserver
  155. 155. Maprenderer </li></ul></ul></ul>project GeoLatte version ? site http://www.geolatte.org/ license LGPL <ul></ul>
  156. 156. <ul>Notable non-Java projects </ul><ul><ul><li>OpenLayers </li><ul><li>JavaScript
  157. 157. Powerful
  158. 158. Popular </li></ul><li>Not open source </li><ul><li>Google maps / Bing / Yahoo! maps </li><ul><li>Free/open?
  159. 159. Data +/- </li></ul></ul></ul></ul><ul></ul>
  160. 160. <ul>Java servers and frameworks </ul><ul><ul><li>GeoServer
  161. 161. Deegree
  162. 162. uDig
  163. 163. gvSig
  164. 164. Puzzle-GIS
  165. 165. GeoKettle
  166. 166. OpenJUMP
  167. 167. GeoNetwork
  168. 168. SEXTANTE
  169. 169. Geomajas </li></ul></ul><ul></ul>
  170. 170. <ul>GeoServer </ul><ul><ul><li>Share and edit geospatial
  171. 171. data
  172. 172. Render data to WMS
  173. 173. WFS interface to your data
  174. 174. Integrated OpenLayers as default viewing engine
  175. 175. Built on GeoTools
  176. 176. Integrate with ArcGIS, Google Maps/Earth; Yahoo! Maps, MS Virtual Earth </li></ul></ul>project GeoServer version 2.1.0 site http://geoserver.org/ license GPL <ul></ul>
  177. 177. project GeoServer <ul></ul>
  178. 178. <ul>deegree </ul><ul><ul><li>supplies building blocks Spatial Data Infrastructure
  179. 179. Implements OGC and ISO/TC 211 standards
  180. 180. Building blocks </li><ul><li>Web services (WMS, WFS, WPS, WCS, Gazetteer,...)
  181. 181. iGeoPortal
  182. 182. iGeoSecurity
  183. 183. iGeo3D
  184. 184. iGeoDesktop </li></ul></ul></ul>project deegree version 3.0.4 Celcius site http://www.deegree.org/ license LGPL <ul></ul>
  185. 185. project deegree <ul></ul>
  186. 186. <ul>uDig </ul><ul><ul><li>Desktop GIS
  187. 187. Based on Eclipse RCP, JTS, GeoTools
  188. 188. View, edit and print GIS data
  189. 189. Can be extended/customized using plug-ins </li><ul><li>Jgrass, Eurobios, DEWS </li></ul></ul></ul>project uDig version 1.2.1 site http://udig.refractions.net/ license LGPL <ul></ul>
  190. 190. project uDIG <ul></ul>
  191. 191. <ul>gvSig </ul><ul><ul><li>Desktop GIS
  192. 192. Same view local and remote
  193. 193. (through OGC standards)
  194. 194. Extensible
  195. 195. GvSig Mobile
  196. 196. Remote sensing
  197. 197. 3D support </li></ul></ul>project gvSig version 1.11 site http://www.gvsig.org/ license GPL <ul></ul>
  198. 198. project gvSIG <ul></ul>
  199. 199. <ul>Puzzle-GIS </ul><ul><ul><li>Desktop GIS
  200. 200. Based on NetBeans platform
  201. 201. and GeoToolkit
  202. 202. Multi-screen, multi-project at same time
  203. 203. Clear separation source/map/view </li></ul></ul>project Puzzle-GIS version .07 site http://puzzle-gis.codehaus.org/ license LGPL <ul></ul>
  204. 204. project Puzzle-GIS <ul></ul>
  205. 205. <ul>GeoKettle </ul><ul><ul><li>Spatial extension of Kettle
  206. 206. (Pentaho Data Integration)
  207. 207. ETL tool, build spatial
  208. 208. data warehouse
  209. 209. Builds on GeoMondrian, spatial extension of Mondrian
  210. 210. Extract also from spatial data sources
  211. 211. Transform also spatial operations (project, geocode,...) </li></ul></ul>project GeoKettle version 3.2.0 site www.spatialytics.org/projects/geokettle/ license LGPL <ul></ul>
  212. 212. project GeoKettle <ul></ul>
  213. 213. <ul>OpenJUMP </ul><ul><ul><li>Desktop GIS
  214. 214. Save, edit-analyze GIS data
  215. 215. Flexible plug-ins </li></ul></ul>project OpenJUMP version 1.4.0.3 site http://www.openjump.org/ license GPL <ul></ul>
  216. 216. project OpenJUMP <ul></ul>
  217. 217. <ul>GeoNetwork </ul><ul><ul><li>Catalog application to manage spatial resources
  218. 218. Metadata editing
  219. 219. Search functions
  220. 220. Embeds GeoServer (optional) </li></ul></ul>project GeoNetwork version 2.6.4 site http://geonetwork-opensource.org/ license GPL <ul></ul>
  221. 221. project GeoNetwork <ul></ul>
  222. 222. <ul>SEXTANTE </ul><ul><ul><li>Spatial data analysis library
  223. 223. +300 geo-algorithms for
  224. 224. raster and vector data processing
  225. 225. Graphical components to run and use those algorithms </li><ul><li>Including graphical modeler </li></ul><li>Integrates with many GIS tools </li><ul><li>gvSig, OpenJUMP, uDIG </li></ul><li>Split of from gvSig </li></ul></ul>project SEXTANTE version 0.6 site http://sextante.forge.osor.eu/ license MIT <ul></ul>
  226. 226. project SEXTANTE <ul></ul>
  227. 227. project SEXTANTE <ul></ul>
  228. 228. <ul>Geomajas </ul><ul><ul><li>Integrate, transform and
  229. 229. secure GIS data
  230. 230. (web) application framework
  231. 231. Built on GeoTools, JTS, Spring, GWT, Hibernate Spatial
  232. 232. Faces for front-end/clients </li><ul><li>GWT, SmartGWT, GeoJSON </li></ul><li>Generic layers for data access </li><ul><li>WMS, WFS, GeoTools data source, Hibernate Spatial </li></ul><li>Plug-ins for extension </li><ul><li>Caching and rasterization, printing/PDF, security services, geocoder </li></ul></ul></ul>project Geomajas version 1.8.0 site http://www.geomajas.org/ license AGPL <ul></ul>
  233. 233. project Geomajas <ul></ul>
  234. 234. <ul><ul><li>Thin client
  235. 235. Server for heavy-lifting </li><ul><li>Allows security
  236. 236. Data transformation
  237. 237. Integration with back-end
  238. 238. processes </li></ul></ul></ul>project Geomajas <ul></ul>
  239. 239. project Geomajas <ul></ul>
  240. 240. <ul>Joachim Van der Auwera http://geosparc.com/ <li>Geosparc [email_address] @joachimvda </li></ul>
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×