Transcript
Page 1: Geo-Informatiesystemen: theorie en visualisatie

Edward Mac Gillavry24 mei 2013

GEO-INFORMATIESYSTEMENGEO-INFORMATIESYSTEMENTheorie en visualisatieTheorie en visualisatie

Page 2: Geo-Informatiesystemen: theorie en visualisatie

Richard, Edward, Hans Amsterdam Sinds 2009 Geo-applicaties voor het (mobiele) Web Webcartografie Desktop GIS ondersteuning: Quantum GIS Open Source en Open Data

WEBMAPPER: what the map can beWEBMAPPER: what the map can be

Page 3: Geo-Informatiesystemen: theorie en visualisatie

RIJKSWATERSTAATRIJKSWATERSTAAT

Page 4: Geo-Informatiesystemen: theorie en visualisatie

PDOKPDOK

Page 5: Geo-Informatiesystemen: theorie en visualisatie

ZORGVERZEKERAARS NLZORGVERZEKERAARS NL

Page 6: Geo-Informatiesystemen: theorie en visualisatie

ZORGVERZEKERAARS NLZORGVERZEKERAARS NL

Page 7: Geo-Informatiesystemen: theorie en visualisatie

MAPPYMAPPY

Page 8: Geo-Informatiesystemen: theorie en visualisatie

MAPPYMAPPY

Page 9: Geo-Informatiesystemen: theorie en visualisatie

DRENTS ARCHIEFDRENTS ARCHIEF

Page 10: Geo-Informatiesystemen: theorie en visualisatie

GEO-INFORMATIEGEO-INFORMATIE

Page 11: Geo-Informatiesystemen: theorie en visualisatie

““80% VAN DE DATA IS GEOGRAFISCH”80% VAN DE DATA IS GEOGRAFISCH”

https://twitter.com/briantimoney/status/336967412673044480

Page 12: Geo-Informatiesystemen: theorie en visualisatie

Shell stratengids → TomTom Navigator (2004) Locatienet → Google Maps (2005) “Baksteen” → iPhone 3G met a-GPS (2007)

CBS Wijk- en Buurtkaart (2005) AND doneert NL data aan OpenStreetMap (2007) Nationaal Georegister, Provinciaal Georegister (2009) Data.overheid.nl (2011) Topografische data = open data (2012) Postcode (BAG) = open data (2012)

GEO VOOR IEDEREENGEO VOOR IEDEREEN

Page 13: Geo-Informatiesystemen: theorie en visualisatie

GEO VOOR IEDEREEN?GEO VOOR IEDEREEN?

Page 14: Geo-Informatiesystemen: theorie en visualisatie

RD WGS-84 BAG Shape NGR 900913 WIN1252 WMS PDOK

GEO VOOR IEDEREEN? ECHT?GEO VOOR IEDEREEN? ECHT?

Page 15: Geo-Informatiesystemen: theorie en visualisatie

RD = Rijksdriehoekstelsel WGS-84 = lengte- en breedtegraden BAG = Basisadministratie Adressen en Gebouwen Shape = ESRI Shape (bestandsformaat) NGR = Nationaal Georegister 900913 (google) = Web Mercator WIN1252 = ASCII tekenset in MS Windows WMS = Web Mapping Service PDOK = Publieke Dienstverlening op de Kaart

GEO VOOR IEDEREEN? ECHT?GEO VOOR IEDEREEN? ECHT?

Page 16: Geo-Informatiesystemen: theorie en visualisatie

ONZE GEREEDSCHAPSKISTONZE GEREEDSCHAPSKIST

DatabewerkingGrafisch Web mapping

InkScape

GIMP

QuantumGIS

PostgreSQL

Page 17: Geo-Informatiesystemen: theorie en visualisatie

NAVIGEREN IN “GEO-LAND”NAVIGEREN IN “GEO-LAND”

Page 18: Geo-Informatiesystemen: theorie en visualisatie

CBS WIJK- EN BUURTKAART 2012CBS WIJK- EN BUURTKAART 2012

Page 19: Geo-Informatiesystemen: theorie en visualisatie

ESRI = Environmental Spatial Research Institute Formaat stamt uit begin jaren '90 Shape bestandsformaat:

.shp – geometrie .shx – index .dbf – informatie (inderdaad dBase IV)

Punten OF lijnen OF vlakken Lengte van kolomnamen en bestandsgrootte beperkt Windows-1252 tekenset Gelukkig veel software, bibliotheken

ESRIESRITMTM-shape bestandsformaat-shape bestandsformaat

http://en.wikipedia.org/wiki/Shapefile

Page 20: Geo-Informatiesystemen: theorie en visualisatie

QUANTUM GIS – TO THE RESCUEQUANTUM GIS – TO THE RESCUE

– Layer > Add Vector Layer...– Ctrl + Shift + V– Werkbalk

Page 21: Geo-Informatiesystemen: theorie en visualisatie

ENCODING – WINDOWS-1252ENCODING – WINDOWS-1252

Skasterlân Súdwest-Fryslân Côte d'Ivoire Douarière Mevrouw van Hier tot Daar

Zie ook eventueel meegeleverde .cpg bestand

Page 22: Geo-Informatiesystemen: theorie en visualisatie

QUANTUM GIS – TO THE RESCUEQUANTUM GIS – TO THE RESCUE

Page 23: Geo-Informatiesystemen: theorie en visualisatie

GDAL/OGR VOOR DE DIEHARDSGDAL/OGR VOOR DE DIEHARDS

Quantum GIS gebruikt OGR (vector) en GDAL (raster) voor inlezen van bestandsformaten

Ondersteunt heel veel formaten! :-) Wizards of plug-ins geven soms iets meer

controle (bijvoorbeeld .csv bestand) Bij complexere imports is een ogr2ogr

commandoregel nodig Voor informatie, gebruik ogrinfo

Page 24: Geo-Informatiesystemen: theorie en visualisatie

ogrinfoogrinfo

ogrinfo -al -so buurt_2012_v1.shp

Layer name: buurt_2012_v1 Geometry: 3D Polygon Feature Count: 12002 Extent: (10425.200000, 306846.200000) -

(278026.100000, 621876.300000) Layer SRS WKT: PROJCS["RD_New",

GEOGCS["GCS_Amersfoort", DATUM["Amersfoort", …

Page 25: Geo-Informatiesystemen: theorie en visualisatie

RIJKSDRIEHOEKSTELSELRIJKSDRIEHOEKSTELSEL

Page 26: Geo-Informatiesystemen: theorie en visualisatie

RD, RD New, Amersfoort EPSG: 28992 (European Petroleum Survey Group) X- en Y-coördinaten Ellipsoïde van Bessel (benadering vorm van de Aarde)

Driehoek? → Pythagoras! Centrum is de OLV-toren in Amersfoort Nulpunt bij Parijs: X-coördinaat < Y-coördinaat Alleen voor Nederland Hoekgetrouw en minimale afwijking

RIJKSDRIEHOEKSTELSELRIJKSDRIEHOEKSTELSEL

Page 27: Geo-Informatiesystemen: theorie en visualisatie

RIJKSDRIEHOEKSTELSELRIJKSDRIEHOEKSTELSEL

Page 28: Geo-Informatiesystemen: theorie en visualisatie

WGS-84WGS-84

Page 29: Geo-Informatiesystemen: theorie en visualisatie

World Geodetic System 1984 Standaard coördinaten van Global Positioning System (GPS) EPSG: 4326 Lengte- en breedtegraden Ellipsoïde (benadering vorm van de Aarde) Plate Carrée: lengtegraad = x, breedtegraad = y

Let op de volgorde van de assen! Wereldwijd Afstandsgetrouw (langs de meridianen)

WGS-84WGS-84

Page 30: Geo-Informatiesystemen: theorie en visualisatie

WGS-84WGS-84

Page 31: Geo-Informatiesystemen: theorie en visualisatie

WEB MERCATORWEB MERCATOR

Page 32: Geo-Informatiesystemen: theorie en visualisatie

GERARDUS MERCATORGERARDUS MERCATOR

Page 33: Geo-Informatiesystemen: theorie en visualisatie

Google projection, Pseudo Mercator, Spherical Mercator EPSG: 900913, EPSG: 3785, EPSG: 3857 Meters Ellipsoïde WGS-84 (benadering vorm van de Aarde)

Google Maps, Bing Maps, OpenStreetMap, ArcGIS Online Zoomniveau 0 op 1 tegeltje (256 x 256 pixels) Hoekgetrouw, maar niet nauwkeurig

WEB MERCATORWEB MERCATOR

http://crschmidt.net/blog/archives/243/google-projection-900913/

Page 34: Geo-Informatiesystemen: theorie en visualisatie

WEB MERCATOR – TILINGWEB MERCATOR – TILING

Zoomniveau 0 Zoomniveau 1 Zoomniveau 2

Zoomniveau Kaartgrootte (pixels) Aantal tiles Resolutie (meters/pixel) Schaalgetal (bij 96 dpi)

0 256 x 256 1 x 1 = 1 156.543,034 591.658.711

1 512 x 512 2 x 2 = 4 78.271,517 295.829.355

2 1.024 x 1.024 4 x 4 = 16 39.135,758 147.914.678

3 2.048 x 2.048 8 x 8 = 64 19.567,879 73.957.339

4 4.096 x 4.096 16 x 16 = 256 9.783,940 36.978.669

5 8.192 x 8.192 32 x 32 = 1.024 4.891,970 18.489.335

6 16.384 x 16.384 64 x 64 = 4.096 2.445,985 9.244.667

7 32.768 x 32.768 128 x 128 = 16.384 1.222,992 4.622.334

8 65.536 * 65.536 256 x 256 = 65.536 611,496 2.311.167

9 131.072 x 131.072 512 x 512 = 262.144 305,748 1.155.583

10 262.144 x 262.144 1.024 x 1.024 = 1.048.576 152,874 577.792

Page 35: Geo-Informatiesystemen: theorie en visualisatie

VERSCHUIVING 100M NOORD?VERSCHUIVING 100M NOORD?

Page 36: Geo-Informatiesystemen: theorie en visualisatie

GEBRUIK JUISTE PARAMETERS!GEBRUIK JUISTE PARAMETERS!

ogr2ogr -f bestandsformaat⏎

doelbestand -t_srs doelprojectie⏎

-s_srs bronprojectie⏎

bronbestand

Page 37: Geo-Informatiesystemen: theorie en visualisatie

GEBRUIK JUISTE PARAMETERS!GEBRUIK JUISTE PARAMETERS!

ogr2ogr -f “KML”⏎

groningen_goed.kml -t_srs “EPSG:4326”⏎

-s_srs “+proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.999908 +x_0=155000 +y_0=463000 +ellps=bessel +units=m +towgs84=565.2369,50.0087,465.658,-0.406857330322398,0.350732676542563,-1.8703473836068,4.0812 +no_defs no_defs”⏎

groningen.shp

Page 38: Geo-Informatiesystemen: theorie en visualisatie

Let op “towgs84” parameter:

+proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel +units=m +towgs84=565.2369,50.0087,465.658,-0.406857330322398,0.350732676542563,-1.8703473836068,4.0812 +no_defs no_defs <>

Deze staan niet altijd in de definitie van RD, zelfs niet op:

http://spatialreference.org/ref/epsg/28992/

GEBRUIK JUISTE PARAMETERS!GEBRUIK JUISTE PARAMETERS!

Page 39: Geo-Informatiesystemen: theorie en visualisatie

GEBRUIK JUISTE PARAMETERS!GEBRUIK JUISTE PARAMETERS!

Page 40: Geo-Informatiesystemen: theorie en visualisatie

CBS GEO-SERVICES VIA NGRCBS GEO-SERVICES VIA NGR

http://www.nationaalgeoregister.nl/geonetwork/srv/search/?uuid=d25fe199-2430-48fd-ad57-5b5f79f73cdf

Page 41: Geo-Informatiesystemen: theorie en visualisatie

CBS GEO-SERVICES VIA NGRCBS GEO-SERVICES VIA NGR

http://www.nationaalgeoregister.nl/geonetwork/srv/search/?uuid=d25fe199-2430-48fd-ad57-5b5f79f73cdf

Page 42: Geo-Informatiesystemen: theorie en visualisatie

CBS GEO-SERVICES VIA PDOKCBS GEO-SERVICES VIA PDOK

https://www.pdok.nl/nl/producten/pdok-services/overzicht-urls/c

Page 43: Geo-Informatiesystemen: theorie en visualisatie

Open Geospatial Consortium (OGC) Recommendations ~ standaarden Internationaal Breed geïmplementeerd

Traaaaaag “Afgeraffelde” indruk Expliciete notatie (verbose)

OGC WEB SERVICESOGC WEB SERVICES

Page 44: Geo-Informatiesystemen: theorie en visualisatie

WEB MAPPING SERVICE – GetCapabilitiesWEB MAPPING SERVICE – GetCapabilities

– Layer > Add WMS Layer...– Ctrl + Shift + W– Werkbalk

Page 45: Geo-Informatiesystemen: theorie en visualisatie

WEB MAPPING SERVICE – GetCapabilitiesWEB MAPPING SERVICE – GetCapabilities

Page 46: Geo-Informatiesystemen: theorie en visualisatie

WEB MAPPING SERVICE – GetMapWEB MAPPING SERVICE – GetMap

Page 47: Geo-Informatiesystemen: theorie en visualisatie

WEB MAPPING SERVICE – GetMapWEB MAPPING SERVICE – GetMap

Page 48: Geo-Informatiesystemen: theorie en visualisatie

WEB MAPPING SERVICE – GetFeatureInfoWEB MAPPING SERVICE – GetFeatureInfo

Page 49: Geo-Informatiesystemen: theorie en visualisatie

WEB FEATURE SERVICE – GetFeatureWEB FEATURE SERVICE – GetFeature

– Layer > Add WFS Layer...– Geen sneltoetscombinatie– Werkbalk

Page 50: Geo-Informatiesystemen: theorie en visualisatie

WEB FEATURE SERVICE – GetFeatureWEB FEATURE SERVICE – GetFeature

Page 51: Geo-Informatiesystemen: theorie en visualisatie

WEB MAP TILE SERVICESWEB MAP TILE SERVICES

https://www.pdok.nl/nl/producten/pdok-services/overzicht-urls/b

Page 52: Geo-Informatiesystemen: theorie en visualisatie

TILED SERVICESTILED SERVICES

Open Geospatial Consortium (OGC):

WMTS = Web Map Tiled Service Open Source Geospatial Foundation (OSGeo):

TMS = Tile Map Server Google Maps, OpenStreetMap, Bing, MapQuest:

XYZ ~ TMS, maar een omgekeerde Y-waarde!

Page 53: Geo-Informatiesystemen: theorie en visualisatie

QUANTUM GIS 1.9 OF JAVASCRIPTQUANTUM GIS 1.9 OF JAVASCRIPT

OpenLayers.js: Uitgebreide functionaliteit, dus “hard werken”● Tiling protocol: XYZ, TMS, WMTS http://www.openlayers.org/

Leaflet.js:● Doelgerichte functionaliteit met goede documentatie● Tiling protocol: XYZ en TMS● http://leafletjs.com/

Page 54: Geo-Informatiesystemen: theorie en visualisatie

NEDERLANDSE RICHTLIJN TILINGNEDERLANDSE RICHTLIJN TILING

15 (v.1.0) + 2 (v.1.1) zoomniveaus Well-Known Scale Set (WKSS):

urn:ogc:def:wkss:OGC:1.0:NLDEPSG28992Scale

Zoomniveau Kaartgrootte (pixels) Aantal tiles Resolutie (meters/pixel) Schaalgetal (bij 96 dpi)

0 256 x 256 1 x 1 = 1 3440,640 12.288.000

1 512 x 512 2 x 2 = 4 1720,320 6.144.000

2 1.024 x 1.024 4 x 4 = 16 860,160 3.072.000

3 2.048 x 2.048 8 x 8 = 64 430,080 1.536.000

4 4.096 x 4.096 16 x 16 = 256 215,040 768.000

5 8.192 x 8.192 32 x 32 = 1.024 107,520 384.000

6 16.384 x 16.384 64 x 64 = 4.096 53,760 192.000

7 32.768 x 32.768 128 x 128 = 16.384 26,880 96.000

8 65.536 * 65.536 256 x 256 = 65.536 13,440 48.000

9 131.072 x 131.072 512 x 512 = 262.144 6,720 24.000

10 262.144 x 262.144 1.024 x 1.024 = 1.048.576 3,360 12.000

http://www.geonovum.nl/sites/default/files/nederlandse_richtlijn_tiling_-_versie_1.1.pdf

Page 55: Geo-Informatiesystemen: theorie en visualisatie

NL WMTS-service in OpenLayersNL WMTS-service in OpenLayers

http://bl.ocks.org/emacgillavry/5669391

Page 56: Geo-Informatiesystemen: theorie en visualisatie

PDOK-Services Plugin voor QGISPDOK-Services Plugin voor QGIS

Page 57: Geo-Informatiesystemen: theorie en visualisatie

WEB MAPPING...WEB MAPPING...

Page 58: Geo-Informatiesystemen: theorie en visualisatie

...ZONDER GOOGLE MAPS ;-)...ZONDER GOOGLE MAPS ;-)

http://emacgillavry.github.io/PDOK-Leaflet/

Page 59: Geo-Informatiesystemen: theorie en visualisatie

ARCHITECTUURARCHITECTUUR

Kaart: BRT-Achtergrondkaart als TMS Viewer: Leaflet.js Projectie: RD i.p.v. Web Mercator Statistische data: CBS-gegevens als GeoJSON Choropleet: D3.js

Page 60: Geo-Informatiesystemen: theorie en visualisatie

ARCHITECTUURARCHITECTUUR

Kaart: BRT-Achtergrondkaart als TMS ✓ Viewer: Leaflet.js ✓ Projectie: RD i.p.v. Web Mercator ✓ Statistische data: CBS-gegevens als GeoJSON Choropleet: D3.js

Page 61: Geo-Informatiesystemen: theorie en visualisatie

GeoJSON MAKEN MET GeoJSON MAKEN MET ogr2ogrogr2ogr

ogr2ogr -f “bestandsformaat”⏎

doelbestand

-sql “kolomnamen en filter”⏎

-t_srs “doelprojectie”⏎

-s_srs “bronprojectie”⏎

bronbestand

Meer informatie GeoJSON:

http://geojson.org/geojson-spec.html

Page 62: Geo-Informatiesystemen: theorie en visualisatie

SQL KOMT ALTIJD VAN PAS!SQL KOMT ALTIJD VAN PAS!

ogr2ogr -f "GeoJSON"⏎

groningen.json⏎

-sql "SELECT 'BU_NAAM', 'BU_CODE', 'GM_NAAM', CAST('P_EENP_HH' AS integer) AS 'P_EENP_HH' FROM 'buurt_2012_v1' WHERE 'GM_NAAM' = 'Groningen'"⏎

-t_srs "EPSG:4326"⏎

-s_srs "+proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.999908 +x_0=155000 +y_0=463000 +ellps=bessel +units=m +towgs84=565.2369,50.0087,465.658,-0.406857330322398,0.350732676542563,-1.8703473836068,4.0812 +no_defs no_defs"⏎

buurt_2012_v1.shp

Percentage eenpersoonshuishoudens per buurt in de gemeente Groningen

Page 63: Geo-Informatiesystemen: theorie en visualisatie

D3.jsD3.js

Data-Driven Documents CSS + HTML + Scalable Vector Graphics (SVG)

Brongegevens uit JSON Interactie Veel voorbeelden en uitgebreide documentatie Meer informatie: http://d3js.org/

Page 64: Geo-Informatiesystemen: theorie en visualisatie

EINDRESULTAATEINDRESULTAAT

http://emacgillavry.github.io/PDOK-Leaflet/

Page 65: Geo-Informatiesystemen: theorie en visualisatie

Edward Mac [email protected]

www.webmapper.net

HARTELIJK DANKHARTELIJK DANK


Top Related