neo4j spatial - gis for the rest of us

91
Peter Neubauer Neo Technology #neo4j @peterneubauer [email protected] Neo4j Spatial - GIS for the rest of us. OSCON Data 2011 Saturday, July 30, 2011

Upload: peter-neubauer

Post on 16-Apr-2017

16.384 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Neo4j Spatial - GIS for the rest of us

Peter NeubauerNeo Technology

#neo4j@[email protected]

Neo4j Spatial - GIS for the rest

of us. OSCON Data 2011

Saturday, July 30, 2011

Page 2: Neo4j Spatial - GIS for the rest of us

#neo4j@[email protected]

We are hiring. Now.

Contact me.

Saturday, July 30, 2011

Page 3: Neo4j Spatial - GIS for the rest of us

Neo4j - ?

Saturday, July 30, 2011

Page 4: Neo4j Spatial - GIS for the rest of us

The Neo4j model: Property Graph

Saturday, July 30, 2011

Page 5: Neo4j Spatial - GIS for the rest of us

The Neo4j model: Property Graph

1 2

3

Saturday, July 30, 2011

Page 6: Neo4j Spatial - GIS for the rest of us

The Neo4j model: Property Graph

1 2

3

Saturday, July 30, 2011

Page 7: Neo4j Spatial - GIS for the rest of us

The Neo4j model: Property Graphname = “Emil”age = 29sex = “yes”

type = KNOWStime = 4 years

type = carvendor = “SAAB”model = “95 Aero”

1 2

3

Saturday, July 30, 2011

Page 8: Neo4j Spatial - GIS for the rest of us

Saturday, July 30, 2011

Page 9: Neo4j Spatial - GIS for the rest of us

Impact Analytics, CMDB, Network Management, Provisioning

Saturday, July 30, 2011

Page 10: Neo4j Spatial - GIS for the rest of us

Show me!

Saturday, July 30, 2011

Page 11: Neo4j Spatial - GIS for the rest of us

Neo4j Spatial

Saturday, July 30, 2011

Page 12: Neo4j Spatial - GIS for the rest of us

Components

9Saturday, July 30, 2011

Page 13: Neo4j Spatial - GIS for the rest of us

Core

Components

9Saturday, July 30, 2011

Page 14: Neo4j Spatial - GIS for the rest of us

Core

Storage

Components

9Saturday, July 30, 2011

Page 15: Neo4j Spatial - GIS for the rest of us

Core

Storage

Search

Components

9Saturday, July 30, 2011

Page 16: Neo4j Spatial - GIS for the rest of us

Core

Storage

Search

GeoProcessing

Components

9Saturday, July 30, 2011

Page 17: Neo4j Spatial - GIS for the rest of us

Core

Storage

Search

GeoProcessing

Import/export

Components

9Saturday, July 30, 2011

Page 18: Neo4j Spatial - GIS for the rest of us

Core

Storage

Search

GeoProcessing

Import/export

Extensions

Components

9Saturday, July 30, 2011

Page 19: Neo4j Spatial - GIS for the rest of us

Core

Storage

Search

GeoProcessing

Import/export

Extensions

Geotools & GeoServer

Components

9Saturday, July 30, 2011

Page 20: Neo4j Spatial - GIS for the rest of us

Core

Storage

Search

GeoProcessing

Import/export

Extensions

Geotools & GeoServer

uDig

Components

9Saturday, July 30, 2011

Page 21: Neo4j Spatial - GIS for the rest of us

Core

Storage

Search

GeoProcessing

Import/export

Extensions

Geotools & GeoServer

uDig

OpenStreetMap

Components

9Saturday, July 30, 2011

Page 22: Neo4j Spatial - GIS for the rest of us

Neo4j dynamic layers

Layer1

Layer2

Layer3

GeometryEncoderDynamic

QueryDynamic

StylesDynamicMeta-Inf

Connected domain data Neo4j Spatial GIS and Spatial stacks

MultidimIndexes

Saturday, July 30, 2011

Page 23: Neo4j Spatial - GIS for the rest of us

TopicsOpen Street Map

Layers

Indexes

Styling

Geoprocessing

Routing

Examples

11Saturday, July 30, 2011

Page 24: Neo4j Spatial - GIS for the rest of us

Open StreetMap

Saturday, July 30, 2011

Page 25: Neo4j Spatial - GIS for the rest of us

OpenStreetMap - Topology

13Saturday, July 30, 2011

Page 26: Neo4j Spatial - GIS for the rest of us

OSM Files<?xml version="1.0" encoding="UTF-8"?><osm version="0.6" generator="CGImap 0.0.2"> <bounds minlat="56.0437000" minlon="12.9388000" maxlat="56.0761000" maxlon="13.0109000"/> <node id="371662020" lat="56.0709040" lon="12.9639158" user="Grillo" uid="13957" visible="true" version="2" changeset="5465617" timestamp="2010-08-11T19:50:23Z"/>.... <way id="72090582" user="Craig Taverner" uid="48197" visible="true" version="1" changeset="5474347" timestamp="2010-08-12T16:15:06Z"> <nd ref="371662020"/> <nd ref="857081476"/> <nd ref="857081950"/> <nd ref="857081819"/> <nd ref="857081796"/> <nd ref="857081692"/> <nd ref="857081617"/> <nd ref="857081523"/> <tag k="highway" v="residential"/> <tag k="name" v="Nybrodalsvägen"/> </way></osm>

Saturday, July 30, 2011

Page 27: Neo4j Spatial - GIS for the rest of us

OpenStreetMap

Saturday, July 30, 2011

Page 28: Neo4j Spatial - GIS for the rest of us

OpenStreetMap

Saturday, July 30, 2011

Page 29: Neo4j Spatial - GIS for the rest of us

OpenStreetMap

Saturday, July 30, 2011

Page 30: Neo4j Spatial - GIS for the rest of us

OpenStreetMap

OSM

Saturday, July 30, 2011

Page 31: Neo4j Spatial - GIS for the rest of us

OpenStreetMap

OSMDynamicLayers

Saturday, July 30, 2011

Page 32: Neo4j Spatial - GIS for the rest of us

OpenStreetMap

OSM

Index (RTree)

DynamicLayers

Saturday, July 30, 2011

Page 33: Neo4j Spatial - GIS for the rest of us

Layers

Saturday, July 30, 2011

Page 34: Neo4j Spatial - GIS for the rest of us

From Graph to Layer

Saturday, July 30, 2011

Page 35: Neo4j Spatial - GIS for the rest of us

From Graph to LayerGeometryEncoder - encode, decode

Saturday, July 30, 2011

Page 36: Neo4j Spatial - GIS for the rest of us

From Graph to LayerGeometryEncoder - encode, decode

Property (wkt)

Saturday, July 30, 2011

Page 37: Neo4j Spatial - GIS for the rest of us

From Graph to LayerGeometryEncoder - encode, decode

Property (wkt)

Properties (lon, lat)

Saturday, July 30, 2011

Page 38: Neo4j Spatial - GIS for the rest of us

From Graph to LayerGeometryEncoder - encode, decode

Property (wkt)

Properties (lon, lat)

Subgraph (ways, polygons)

Saturday, July 30, 2011

Page 39: Neo4j Spatial - GIS for the rest of us

From Graph to LayerGeometryEncoder - encode, decode

Property (wkt)

Properties (lon, lat)

Subgraph (ways, polygons)

Domain specific (e.g. OSM)

Saturday, July 30, 2011

Page 40: Neo4j Spatial - GIS for the rest of us

From Graph to LayerGeometryEncoder - encode, decode

Property (wkt)

Properties (lon, lat)

Subgraph (ways, polygons)

Domain specific (e.g. OSM)

OSM Way encoding/decoding

Saturday, July 30, 2011

Page 41: Neo4j Spatial - GIS for the rest of us

From Graph to LayerGeometryEncoder - encode, decode

Property (wkt)

Properties (lon, lat)

Subgraph (ways, polygons)

Domain specific (e.g. OSM)

OSM Way encoding/decoding

CRS, Geometry type

Saturday, July 30, 2011

Page 42: Neo4j Spatial - GIS for the rest of us

From Graph to LayerGeometryEncoder - encode, decode

Property (wkt)

Properties (lon, lat)

Subgraph (ways, polygons)

Domain specific (e.g. OSM)

OSM Way encoding/decoding

CRS, Geometry type

Styling

Saturday, July 30, 2011

Page 43: Neo4j Spatial - GIS for the rest of us

From Graph to LayerGeometryEncoder - encode, decode

Property (wkt)

Properties (lon, lat)

Subgraph (ways, polygons)

Domain specific (e.g. OSM)

OSM Way encoding/decoding

CRS, Geometry type

Styling

Dynamic Layers

Saturday, July 30, 2011

Page 44: Neo4j Spatial - GIS for the rest of us

From Graph to LayerGeometryEncoder - encode, decode

Property (wkt)

Properties (lon, lat)

Subgraph (ways, polygons)

Domain specific (e.g. OSM)

OSM Way encoding/decoding

CRS, Geometry type

Styling

Dynamic Layers

Search

Saturday, July 30, 2011

Page 45: Neo4j Spatial - GIS for the rest of us

Dynamic Layers, uDig

Saturday, July 30, 2011

Page 46: Neo4j Spatial - GIS for the rest of us

Dynamic Layers, GeoServer

Saturday, July 30, 2011

Page 47: Neo4j Spatial - GIS for the rest of us

Indexes

Saturday, July 30, 2011

Page 48: Neo4j Spatial - GIS for the rest of us

Multiple indexes - GIS

Illustrations: WikipediaSaturday, July 30, 2011

Page 49: Neo4j Spatial - GIS for the rest of us

OpenStreetMap

Saturday, July 30, 2011

Page 50: Neo4j Spatial - GIS for the rest of us

OpenStreetMap

OSM

Index (RTree)

DynamicLayers

Saturday, July 30, 2011

Page 51: Neo4j Spatial - GIS for the rest of us

In - graph indexingIndex<Node> index = db.index().forNodes( "layer1");Node n1 = db.createNode();n1.setProperty( "lat", (double)56.2 );n1.setProperty( "lon", (double)15.3 );index.add( n1 );

Java:index.query( LayerNodeIndex.BBOX_QUERY, "[15.0, 16.0, 56.0, 57.0]" );

Cypher:START poi=(layer1,'bbox:[15.0, 16.0, 56.0, 57.0]') MATCH (poi) -[r] - (x) RETURN poi, r~TYPE, x.layer?

Gremlin:g.idx('node')[[layer1: 'bbox:[15.0, 16.0, 56.0, 57.0]']]

Saturday, July 30, 2011

Page 52: Neo4j Spatial - GIS for the rest of us

Styling

Saturday, July 30, 2011

Page 53: Neo4j Spatial - GIS for the rest of us

Styling SLD<FeatureTypeStyle> <Rule> <ogc:Filter> <ogc:And> <ogc:PropertyIsEqualTo> <ogc:Function name="geometryType"> <ogc:PropertyName>the_geom</ogc:PropertyName> </ogc:Function> <ogc:Literal>LineString</ogc:Literal> </ogc:PropertyIsEqualTo> <ogc:Not> <ogc:PropertyIsNull> <ogc:PropertyName>highway</ogc:PropertyName> </ogc:PropertyIsNull> </ogc:Not> <ogc:PropertyIsEqualTo> <ogc:PropertyName>highway</ogc:PropertyName> <ogc:Literal>residential</ogc:Literal> </ogc:PropertyIsEqualTo> </ogc:And> </ogc:Filter> <Symbolizers>.......</> </Rule></FeatureTypeStyle>

Saturday, July 30, 2011

Page 54: Neo4j Spatial - GIS for the rest of us

Styling SLD<FeatureTypeStyle> <Rule> <Filter>.....</Filter> <LineSymbolizer> <Stroke> <CssParameter name="stroke">#909090</CssParameter> <CssParameter name="stroke-width">3</CssParameter> </Stroke> </LineSymbolizer> <LineSymbolizer> <Stroke> <CssParameter name="stroke">#ffff80</CssParameter> <CssParameter name="stroke-width">1</CssParameter> </Stroke> </LineSymbolizer> </Rule></FeatureTypeStyle>

Saturday, July 30, 2011

Page 55: Neo4j Spatial - GIS for the rest of us

Styling Ruby DSLrequire 'amanzi/sld'

Amanzi::SLD::Config.config[:geometry_property] = 'the_geom'#Amanzi::SLD::Config.config[:verbose] = true

sld = Amanzi::SLD::Document.new "Example Neo4j Spatial OSM Style"

sld.comment "A style for residential streets"sld. add_line_symbolizer(:stroke => '#909090', :stroke_width => 3). add_line_symbolizer(:stroke => '#ffff80', :stroke_width => 1) do |f| f.op(:and) do |f| f.geometry = 'LineString' f.property.exists? 'highway' f.property['highway'] = 'residential' endendsld

Saturday, July 30, 2011

Page 56: Neo4j Spatial - GIS for the rest of us

Dynamic Layers, styling

Saturday, July 30, 2011

Page 57: Neo4j Spatial - GIS for the rest of us

Dynamic Layers, styling

Saturday, July 30, 2011

Page 58: Neo4j Spatial - GIS for the rest of us

Dynamic Layers, styling

Saturday, July 30, 2011

Page 59: Neo4j Spatial - GIS for the rest of us

Dynamic Layers, styling

Saturday, July 30, 2011

Page 60: Neo4j Spatial - GIS for the rest of us

Geoprocessing

Saturday, July 30, 2011

Page 61: Neo4j Spatial - GIS for the rest of us

GSoC: PostGIS -> OSM Graph

33Saturday, July 30, 2011

Page 62: Neo4j Spatial - GIS for the rest of us

GSoC: PostGIS -> OSM GraphOutputs: GeoJSON, KML

33Saturday, July 30, 2011

Page 63: Neo4j Spatial - GIS for the rest of us

GSoC: PostGIS -> OSM GraphOutputs: GeoJSON, KML

33Saturday, July 30, 2011

Page 64: Neo4j Spatial - GIS for the rest of us

GSoC: PostGIS -> OSM GraphOutputs: GeoJSON, KML

Accessors: ST_EndPoint

33Saturday, July 30, 2011

Page 65: Neo4j Spatial - GIS for the rest of us

GSoC: PostGIS -> OSM GraphOutputs: GeoJSON, KML

Accessors: ST_EndPoint

33Saturday, July 30, 2011

Page 66: Neo4j Spatial - GIS for the rest of us

GSoC: PostGIS -> OSM GraphOutputs: GeoJSON, KML

Accessors: ST_EndPoint

Processing: ST_CLosest, ST_Disjoint

33Saturday, July 30, 2011

Page 67: Neo4j Spatial - GIS for the rest of us

GSoC: PostGIS -> OSM GraphOutputs: GeoJSON, KML

Accessors: ST_EndPoint

Processing: ST_CLosest, ST_Disjoint

33Saturday, July 30, 2011

Page 68: Neo4j Spatial - GIS for the rest of us

GSoC: PostGIS -> OSM GraphOutputs: GeoJSON, KML

Accessors: ST_EndPoint

Processing: ST_CLosest, ST_Disjoint

Search: SearchWithin, SearchClosest, Route, etc

33Saturday, July 30, 2011

Page 69: Neo4j Spatial - GIS for the rest of us

GSoC: PostGIS -> OSM GraphOutputs: GeoJSON, KML

Accessors: ST_EndPoint

Processing: ST_CLosest, ST_Disjoint

Search: SearchWithin, SearchClosest, Route, etc

33Saturday, July 30, 2011

Page 70: Neo4j Spatial - GIS for the rest of us

GSoC: PostGIS -> OSM GraphOutputs: GeoJSON, KML

Accessors: ST_EndPoint

Processing: ST_CLosest, ST_Disjoint

Search: SearchWithin, SearchClosest, Route, etc

Thanks Andreas Wilhelm!33

Saturday, July 30, 2011

Page 71: Neo4j Spatial - GIS for the rest of us

Routing

Saturday, July 30, 2011

Page 72: Neo4j Spatial - GIS for the rest of us

Routing

Saturday, July 30, 2011

Page 73: Neo4j Spatial - GIS for the rest of us

Graph - Algos, A*

Saturday, July 30, 2011

Page 74: Neo4j Spatial - GIS for the rest of us

h"p://www.transportdublin.ie/  -­‐  Patrick  Fitzgerald  on  Neo4jSaturday, July 30, 2011

Page 75: Neo4j Spatial - GIS for the rest of us

Neo4j Spatial examples

Saturday, July 30, 2011

Page 76: Neo4j Spatial - GIS for the rest of us

Polymap3

Saturday, July 30, 2011

Page 77: Neo4j Spatial - GIS for the rest of us

AWE

Saturday, July 30, 2011

Page 78: Neo4j Spatial - GIS for the rest of us

Cell network analysis

Saturday, July 30, 2011

Page 79: Neo4j Spatial - GIS for the rest of us

Next steps

Saturday, July 30, 2011

Page 80: Neo4j Spatial - GIS for the rest of us

Next stepsNeo4j Spatial

Saturday, July 30, 2011

Page 81: Neo4j Spatial - GIS for the rest of us

Next stepsNeo4j Spatial

Cypher, Gremlin, CQL dynamic querying

Saturday, July 30, 2011

Page 82: Neo4j Spatial - GIS for the rest of us

Next stepsNeo4j Spatial

Cypher, Gremlin, CQL dynamic querying

Graph Geoprocessing domain level - GSoC 2011

Saturday, July 30, 2011

Page 83: Neo4j Spatial - GIS for the rest of us

Next stepsNeo4j Spatial

Cypher, Gremlin, CQL dynamic querying

Graph Geoprocessing domain level - GSoC 2011

Index Performance optimizations

Saturday, July 30, 2011

Page 84: Neo4j Spatial - GIS for the rest of us

Next stepsNeo4j Spatial

Cypher, Gremlin, CQL dynamic querying

Graph Geoprocessing domain level - GSoC 2011

Index Performance optimizations

Pluggable indexing, Composite Index

Saturday, July 30, 2011

Page 85: Neo4j Spatial - GIS for the rest of us

Next stepsNeo4j Spatial

Cypher, Gremlin, CQL dynamic querying

Graph Geoprocessing domain level - GSoC 2011

Index Performance optimizations

Pluggable indexing, Composite Index

Routing API support

Saturday, July 30, 2011

Page 86: Neo4j Spatial - GIS for the rest of us

Next stepsNeo4j Spatial

Cypher, Gremlin, CQL dynamic querying

Graph Geoprocessing domain level - GSoC 2011

Index Performance optimizations

Pluggable indexing, Composite Index

Routing API support

OSM

Saturday, July 30, 2011

Page 87: Neo4j Spatial - GIS for the rest of us

Next stepsNeo4j Spatial

Cypher, Gremlin, CQL dynamic querying

Graph Geoprocessing domain level - GSoC 2011

Index Performance optimizations

Pluggable indexing, Composite Index

Routing API support

OSM

uDig OSM Topology editor - GSoC 2011

Saturday, July 30, 2011

Page 88: Neo4j Spatial - GIS for the rest of us

Next stepsNeo4j Spatial

Cypher, Gremlin, CQL dynamic querying

Graph Geoprocessing domain level - GSoC 2011

Index Performance optimizations

Pluggable indexing, Composite Index

Routing API support

OSM

uDig OSM Topology editor - GSoC 2011

OSM tests Germany, US

Saturday, July 30, 2011

Page 89: Neo4j Spatial - GIS for the rest of us

Next stepsNeo4j Spatial

Cypher, Gremlin, CQL dynamic querying

Graph Geoprocessing domain level - GSoC 2011

Index Performance optimizations

Pluggable indexing, Composite Index

Routing API support

OSM

uDig OSM Topology editor - GSoC 2011

OSM tests Germany, US

Stitching for OSM datasets

Saturday, July 30, 2011

Page 90: Neo4j Spatial - GIS for the rest of us

Get involved!

http://github.com/neo4j/neo4j-spatial

http://neo4j.org

Saturday, July 30, 2011

Page 91: Neo4j Spatial - GIS for the rest of us

http://neotechnology.com44

And - we are hiring!

Saturday, July 30, 2011