svg in gis and webmapping - universiteit twente...andreas neumann & barend köbben 2 categories...

25
Andreas Neumann & Barend Köbben SVG in GIS and Webmapping 1

Upload: others

Post on 29-Jul-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: SVG in GIS and Webmapping - Universiteit Twente...Andreas Neumann & Barend Köbben 2 Categories and examples • Spatial Databases Postgis, SpatiaLite • Desktop-GIS Quantum-GIS,

Andreas Neumann & Barend Köbben

SVG in GIS and Webmapping

1

Page 2: SVG in GIS and Webmapping - Universiteit Twente...Andreas Neumann & Barend Köbben 2 Categories and examples • Spatial Databases Postgis, SpatiaLite • Desktop-GIS Quantum-GIS,

Andreas Neumann & Barend Köbben 2

Categories and examples

• Spatial Databases Postgis, SpatiaLite

• Desktop-GIS Quantum-GIS, GRASS, Autodesk Map3D, ESRI ArcGIS

• Converters MapViewSVG, FME, gdal,

• Commercial Webmap Services Google Maps

• OS Webmap Services Mapserver, Geoserver, RIM/TimeMapperWMS

• Smaller Webmapping projects Yosemite, Geofotos, etc.

• Virtual Globes Google-Earth

Page 3: SVG in GIS and Webmapping - Universiteit Twente...Andreas Neumann & Barend Köbben 2 Categories and examples • Spatial Databases Postgis, SpatiaLite • Desktop-GIS Quantum-GIS,

Andreas Neumann & Barend Köbben 3

Spatial Databases: PostGIS

AsSVG(): export of “raw” geometries:

d-attribute output for• Polygon/Multipolygon• Linestring/Multilinestring

circle (cx/cy) or use (x/y) output for• Point/Multipolygon

semicolon separator for• GeometryCollection

Page 4: SVG in GIS and Webmapping - Universiteit Twente...Andreas Neumann & Barend Köbben 2 Categories and examples • Spatial Databases Postgis, SpatiaLite • Desktop-GIS Quantum-GIS,

Andreas Neumann & Barend Köbben 4

Spatial Databases: PostGIS

Optional:• Relative path notation• Nr of digits (accuracy reduction)

Can be combined with all other Postgis-Operators (e.g. Simplification, clipping, buffering, etc.)

see

http://postgis.refractions.net/documentation/manual-1.4/ST_AsSVG.html

Page 5: SVG in GIS and Webmapping - Universiteit Twente...Andreas Neumann & Barend Köbben 2 Categories and examples • Spatial Databases Postgis, SpatiaLite • Desktop-GIS Quantum-GIS,

Andreas Neumann & Barend Köbben 5

Spatial Databases: SpatiaLite

• Spatial Extension for SQLite• Same functionality as AsSVG() in Postgis

see: http://www.gaia-gis.it/spatialite/spatialite-sql-2.3.1.html

Page 6: SVG in GIS and Webmapping - Universiteit Twente...Andreas Neumann & Barend Köbben 2 Categories and examples • Spatial Databases Postgis, SpatiaLite • Desktop-GIS Quantum-GIS,

Andreas Neumann & Barend Köbben 6

Desktop-GIS : Quantum-GIS

• SVG for definition of point-symbols• SVG for importing graphics into map

layouts (e.g. logos, map legends, north arrows, etc.); restricted to SVG tiny

• SVG for exporting map layouts (no clipping)

• Python-Plugins: SVG through qt and/or Webkit

Page 7: SVG in GIS and Webmapping - Universiteit Twente...Andreas Neumann & Barend Köbben 2 Categories and examples • Spatial Databases Postgis, SpatiaLite • Desktop-GIS Quantum-GIS,

Andreas Neumann & Barend Köbben 7

Desktop-GIS : Quantum-GIS

Page 8: SVG in GIS and Webmapping - Universiteit Twente...Andreas Neumann & Barend Köbben 2 Categories and examples • Spatial Databases Postgis, SpatiaLite • Desktop-GIS Quantum-GIS,

Andreas Neumann & Barend Köbben 8

Desktop-GIS : Quantum-GIS

Planned:• SVG pattern support for polygon fills• QGIS SVG Mapserver (will work with

carto.net navigation tools and network requests): SVG layers or layer groups using symbolization from QGIS project files.

Page 9: SVG in GIS and Webmapping - Universiteit Twente...Andreas Neumann & Barend Köbben 2 Categories and examples • Spatial Databases Postgis, SpatiaLite • Desktop-GIS Quantum-GIS,

Andreas Neumann & Barend Köbben 9

Desktop-GIS : GRASS GIS

v.out.svgexports GRASS vector data to SVG, incl.

attributes• converts to <path/> (line, boundary, area)

and <circle/> (point, centroid) elements• control of coordinate precision

Maybe Planned:• Styling of the outputsee http://grass.itc.it/grass64/manuals/html64_user/v.out.svg.html

or http://svg.cc/grass/index.html

Page 10: SVG in GIS and Webmapping - Universiteit Twente...Andreas Neumann & Barend Köbben 2 Categories and examples • Spatial Databases Postgis, SpatiaLite • Desktop-GIS Quantum-GIS,

Andreas Neumann & Barend Köbben 10

Desktop-GIS : Autodesk Map3D

SVG “under the hood”, used in the storage of the display model for definition of:

• point symbols• line symbols

mixed with other proprietary markup

Page 11: SVG in GIS and Webmapping - Universiteit Twente...Andreas Neumann & Barend Köbben 2 Categories and examples • Spatial Databases Postgis, SpatiaLite • Desktop-GIS Quantum-GIS,

Andreas Neumann & Barend Köbben 11

Desktop-GIS : Autodesk Map3D

<Graphics> <Path> <Geometry>M -471.333,-0.000 A 471.333,471.333 0 1 1 471.333,-0.000 A 471.333,471.333 0 1 1 -471.333,-0.000</Geometry> <FillColor>%COLORBYLAYERPFAW%</FillColor> </Path> <Path> <Geometry>M 471.333,-0.000 A 471.333,471.333 0 0 1 -471.333,-0.000 A 471.333,471.333 0 0 1 471.333,-0.000</Geometry> <LineColor>%COLORBYLAYERPFAW%</LineColor> <LineWeight>%LWBYLAYERBAW15%</LineWeight> </Path> <Path> <Geometry>M -9.828,471.231 A 471.333,471.333 0 0 0 -9.828,-471.231 M -9.828,-471.231 A 471.333,471.333 0 1 0 -9.828,471.231</Geometry> <LineColor>ff000000</LineColor> <LineWeight>%LWBYLAYERBAW15%</LineWeight> </Path></Graphics>

Page 12: SVG in GIS and Webmapping - Universiteit Twente...Andreas Neumann & Barend Köbben 2 Categories and examples • Spatial Databases Postgis, SpatiaLite • Desktop-GIS Quantum-GIS,

Andreas Neumann & Barend Köbben 12

Desktop-GIS : ArcMAP

• High-end commercial GIS system, part of large suite (ArcGIS) by ESRI

• SVG (only) as output format for maps and graphs

• SVG output has been present since v 8.1, not changed much since. Future unclear, ESRI does not publish development plans/roadmaps

Page 13: SVG in GIS and Webmapping - Universiteit Twente...Andreas Neumann & Barend Köbben 2 Categories and examples • Spatial Databases Postgis, SpatiaLite • Desktop-GIS Quantum-GIS,

Andreas Neumann & Barend Köbben 13

Desktop-GIS : ArcMAP

• Quite good for the purpose it's for: static maps on webpages– maps are always exported as 'graphics' files, no

geographic coordinates, just paper cooordinates, no attributes, no interactivity

• SVG not very interoperable: things work/look different in different SVG viewers

Page 14: SVG in GIS and Webmapping - Universiteit Twente...Andreas Neumann & Barend Köbben 2 Categories and examples • Spatial Databases Postgis, SpatiaLite • Desktop-GIS Quantum-GIS,

Andreas Neumann & Barend Köbben 14

Desktop-GIS : ArcMAP

• Font embedding ONLY works for label fonts. Fonts used in scale-bar, legends, etc. are NOT embedded automatically

• Font-based marker symbols (common in ArcMap) do NOT work: Although the font IS embedded, the symbols are not correctly shown; Alternative option 'convert marker symbols to polygons', is good for most cases

Page 15: SVG in GIS and Webmapping - Universiteit Twente...Andreas Neumann & Barend Köbben 2 Categories and examples • Spatial Databases Postgis, SpatiaLite • Desktop-GIS Quantum-GIS,

Andreas Neumann & Barend Köbben 15

Convertors : MapViewSVG

• An extension for ESRI ArcMAP– commercial product from uisMedia– exports ArcGIS 8/9 data to SVG interactive

websites via wizard interface– active development:

just upgraded under new name Mappetizer (based on Dojo, also Silverlight export)

Page 16: SVG in GIS and Webmapping - Universiteit Twente...Andreas Neumann & Barend Köbben 2 Categories and examples • Spatial Databases Postgis, SpatiaLite • Desktop-GIS Quantum-GIS,

Andreas Neumann & Barend Köbben 16

MapViewSVG

Limitations in ArcGIS – SVG conversion:not all datatypes

files and webservice (WMS, ArcIMS), NO ArcSDE and other DB connections

raster limited (imagery OK, discrete raster data limited)

lots, but not all symbology/visualisations supported the output is a client-side GIS-viewer, not a WebGIS!

limits possible data amounts (spatial) data is stored client-side

Page 17: SVG in GIS and Webmapping - Universiteit Twente...Andreas Neumann & Barend Köbben 2 Categories and examples • Spatial Databases Postgis, SpatiaLite • Desktop-GIS Quantum-GIS,

Andreas Neumann & Barend Köbben 17

Convertors : FME

• mature and powerful (converts any format)• supports preservation of ids• supports embedding of attributes

(no check for XML validity)• supports grouping/layering• supports mouse-events• supports styling and CSS• template support• supports gzip compressionhttp://docs.safe.com/fme/html/ReadersWriters/ReadersWriters.htm#svg.htm

Page 18: SVG in GIS and Webmapping - Universiteit Twente...Andreas Neumann & Barend Köbben 2 Categories and examples • Spatial Databases Postgis, SpatiaLite • Desktop-GIS Quantum-GIS,

Andreas Neumann & Barend Köbben 18

Convertors : shp2svg, gdal

• powerful, flexible (conversion from shp)• supports preservation of ids• supports embedding of attributes• supports grouping/layering• supports mouse-events• supports styling and CSS• supports absolute/relative coordinates• supports viewBox/scale• will be replaced by gdal/ogr (any format)http://www.carto.net/papers/svg/utils/shp2svg/, http://www.gdal.org/

Page 19: SVG in GIS and Webmapping - Universiteit Twente...Andreas Neumann & Barend Köbben 2 Categories and examples • Spatial Databases Postgis, SpatiaLite • Desktop-GIS Quantum-GIS,

Andreas Neumann & Barend Köbben 19

Commercial Webmap Services: Google Maps and Microsoft Virtual Earth

Page 20: SVG in GIS and Webmapping - Universiteit Twente...Andreas Neumann & Barend Köbben 2 Categories and examples • Spatial Databases Postgis, SpatiaLite • Desktop-GIS Quantum-GIS,

Andreas Neumann & Barend Köbben 20

OS Webmap Services:Geoserver

• OS software server written in Java, publishes data from any major spatial data source using OGC open standards

• SVG is output for its Web Map Service:– static non-interactive maps from

standardised service request GetMap– two renderers available:

• fast & simple (only limited styling)→ not so useful, low quality

• full-featured & slower (uses Batik)→ very complete implementation

• both can compress (.svgz format)

Page 21: SVG in GIS and Webmapping - Universiteit Twente...Andreas Neumann & Barend Köbben 2 Categories and examples • Spatial Databases Postgis, SpatiaLite • Desktop-GIS Quantum-GIS,

Andreas Neumann & Barend Köbben 21

OS Webmap Services:Mapserver

• OS software server written in C, publishes data from any major spatial data source using OGC open standards

• SVG is output for its Web Map Service:– static non-interactive maps from

standardised service request GetMap– As of version 4.5, MapServer can output maps in

SVG 1.1, as well as goSVG (an expanded SVG Tiny profile, part of the Japanese G-XML standard)

Page 22: SVG in GIS and Webmapping - Universiteit Twente...Andreas Neumann & Barend Köbben 2 Categories and examples • Spatial Databases Postgis, SpatiaLite • Desktop-GIS Quantum-GIS,

Andreas Neumann & Barend Köbben 22

• symbolisation somewhat limited:– Linetype layers are drawn without symbols -

only line thickness changes– Polygon patterns not supported– Only TRUETYPE fonts are supported

– can eliminate duplicate points and collinear lines when outputting SVG

– can compress (.svgz format)

OS Webmap Services:Mapserver

Page 23: SVG in GIS and Webmapping - Universiteit Twente...Andreas Neumann & Barend Köbben 2 Categories and examples • Spatial Databases Postgis, SpatiaLite • Desktop-GIS Quantum-GIS,

Andreas Neumann & Barend Köbben 23

• Pro: part of OGC service: SVG as output to numerous data sources and processes in a standardised, inter-operable setup

• Con: SVG is limited to pure WMS 'picture only' → can be different: see Time/RIMapperWMS

• development takes place in open community

both Geoserver & MapServer

Page 24: SVG in GIS and Webmapping - Universiteit Twente...Andreas Neumann & Barend Köbben 2 Categories and examples • Spatial Databases Postgis, SpatiaLite • Desktop-GIS Quantum-GIS,

Andreas Neumann & Barend Köbben 24

Smaller Webmapping projects

• Yosemite• Geophotos

Page 25: SVG in GIS and Webmapping - Universiteit Twente...Andreas Neumann & Barend Köbben 2 Categories and examples • Spatial Databases Postgis, SpatiaLite • Desktop-GIS Quantum-GIS,

Andreas Neumann & Barend Köbben 25

Virtual Globes : Google-Earth

• SVG in Information Bubbles (through Webkit (<iframe/>))• Supports HTML/SVG/Canvas, etc. on the

same level that Webkit supports SVG• Supports SMIL animation and interactivity

Potential Improvements (not implemented):• Support of SVG for Placemark Icons