36
5/4/16 18 Postgis Topology will replace Postgis SimpleFeature Closed LineString where it is data

5/4/16 18 Postgis Topology will replace Postgis SimpleFeature

Embed Size (px)

Citation preview

Page 1: 5/4/16 18 Postgis Topology will replace Postgis SimpleFeature

5/4/16 18Postgis Topology will replace Postgis SimpleFeature

Closed LineString where it is data

Page 2: 5/4/16 18 Postgis Topology will replace Postgis SimpleFeature

5/4/16 19Postgis Topology will replace Postgis SimpleFeature

Closed linestring where no data

Page 3: 5/4/16 18 Postgis Topology will replace Postgis SimpleFeature

On this layer : Postgis Topology → 5 points

: Postgis Simple Feature → 333105 (333100 duplicates) points

5/4/16 20Postgis Topology will replace Postgis SimpleFeature

Create s map with full coverage

Page 4: 5/4/16 18 Postgis Topology will replace Postgis SimpleFeature

Use Postgis Topology for line layers ?Intersecting nodes

Shared lines

Page 5: 5/4/16 18 Postgis Topology will replace Postgis SimpleFeature

5/4/16 22Postgis Topology will replace Postgis SimpleFeature

Change an exiting LineString, snap to crossing line

Page 6: 5/4/16 18 Postgis Topology will replace Postgis SimpleFeature

5/4/16 23Postgis Topology will replace Postgis SimpleFeature

Draw a LineString, no snap to

Page 7: 5/4/16 18 Postgis Topology will replace Postgis SimpleFeature

What about point layers and Postgis Topology ?

TopoJSON

Page 8: 5/4/16 18 Postgis Topology will replace Postgis SimpleFeature

5/4/16 25Postgis Topology will replace Postgis SimpleFeature

Postgis Topology and points

Page 9: 5/4/16 18 Postgis Topology will replace Postgis SimpleFeature

5/4/16 26Postgis Topology will replace Postgis SimpleFeature

So what is the end users reaction to just draw new lines ?

:-)Easy, faster, history kept, rollback changes

Page 10: 5/4/16 18 Postgis Topology will replace Postgis SimpleFeature

5/4/16 27Postgis Topology will replace Postgis SimpleFeature

Developer perspective using SimpleFeature

Page 11: 5/4/16 18 Postgis Topology will replace Postgis SimpleFeature

Weaknesses withSimpleFeature

● Duplication of lines

● Total replacement

● Mix of new and old points

● Bandwidth usage

5/4/16 28Postgis Topology will replace Postgis SimpleFeature

Development perspective move border when SimpleFeature

Page 12: 5/4/16 18 Postgis Topology will replace Postgis SimpleFeature

Simple Features and drifting points

Page 13: 5/4/16 18 Postgis Topology will replace Postgis SimpleFeature

5/4/16 30Postgis Topology will replace Postgis SimpleFeature

Drifting points

Page 14: 5/4/16 18 Postgis Topology will replace Postgis SimpleFeature

5/4/16 31Postgis Topology will replace Postgis SimpleFeature

Drifting points

14 Km off

Page 15: 5/4/16 18 Postgis Topology will replace Postgis SimpleFeature

Simple Features “equal”

DE-9IM : T*F**FFF*OR

II � ~IE � ~BE � ~EI � ~EB

Page 16: 5/4/16 18 Postgis Topology will replace Postgis SimpleFeature

SimpleFeature is not using the relationalfeatures of Postgres.

Postgis Topology is using the relationalfeatures of Postgres.

Page 17: 5/4/16 18 Postgis Topology will replace Postgis SimpleFeature

Development perspective And

Postgis Topology

Page 18: 5/4/16 18 Postgis Topology will replace Postgis SimpleFeature

5/4/16 35Postgis Topology will replace Postgis SimpleFeature

Develop

perspective

using

Postgis

Topology

Slide from: http://strk.keybit.net/projects/postgis/Paris2011_TopologyWithPostGIS_2_0.pdf

Page 19: 5/4/16 18 Postgis Topology will replace Postgis SimpleFeature

5/4/16 36Postgis Topology will replace Postgis SimpleFeature

ApacheTomcat

Java app

pgtopo_update_sqlPostgis Topology

GeoJSON

TopoJSON

GeoJSON

TopoJSON/Ids

System overview for the update client

Page 20: 5/4/16 18 Postgis Topology will replace Postgis SimpleFeature

5/4/16 37Postgis Topology will replace Postgis SimpleFeature

Development GitLab, GitHub, Continues Integration

deploy_war_utv: stage: deploy script: - mvn package tomcat7:redeploy -Pkartupd01utv only: - develop deploy_war_test: stage: deploy script: - mvn package tomcat7:redeploy -Pkartupd01test only: - test

Page 21: 5/4/16 18 Postgis Topology will replace Postgis SimpleFeature

Running inside Postgres

5/4/16 38Postgis Topology will replace Postgis SimpleFeature

pgtopo_update_sql

Postgis Topology

● pgtopo_update_sql

uses

Postgis Topology

to check and

adjust result

https://github.com/NibioOpenSource/pgtopo_update_sql

“developed with very good help from Sandro Santilli”

● Postgis Topology package handles the postgis operations

Page 22: 5/4/16 18 Postgis Topology will replace Postgis SimpleFeature

5/4/16 39Postgis Topology will replace Postgis SimpleFeature

pgtopo_update_sql● Called from Java by using stored proc

Postgis Topology

Page 23: 5/4/16 18 Postgis Topology will replace Postgis SimpleFeature

5/4/16 40Postgis Topology will replace Postgis SimpleFeature

pgtopo_update_sql Partly developed as a part of a map update project

● Focus have been this projects used cases ● Needs redesign, but it works for this project ● The update method need a redesign● Have lot of tests that help us

Page 24: 5/4/16 18 Postgis Topology will replace Postgis SimpleFeature

5/4/16 41Postgis Topology will replace Postgis SimpleFeature

Development perspective move border with Postgis Topology

Only new linesfrom client

to

Server

Page 25: 5/4/16 18 Postgis Topology will replace Postgis SimpleFeature

Postgis Topology means

- no drifting points- easier to undo

Page 26: 5/4/16 18 Postgis Topology will replace Postgis SimpleFeature

fkey1 = fkey2Postgis Topology benefits

both end user and developer when workingon surface and line layers.

Page 27: 5/4/16 18 Postgis Topology will replace Postgis SimpleFeature

Postgis Topology

- tested with one billion pointshttp://www.slideshare.net/laopsahl/foss4-g-topologyjuly162015

- seems to be solid and few errors

Page 28: 5/4/16 18 Postgis Topology will replace Postgis SimpleFeature

5/4/16 45Postgis Topology will replace Postgis SimpleFeature

{"type":"Topology","objects":{"collection":{"type":"GeometryCollection","geometries":[{"type":"Polygon","properties":{"id":520},"arcs":[[-1]]}]}},"arcs":[[[9717,419],[-1126,-419],[-5070,958],[-2113,898],[-1126,2036],[422,2335],[-704,2754],[1972,1018],[2253,0],[1267,-419],[1409,-1437],[3098,-6467],[-282,-1257]]],"transform":{"scale":[0.007100710071007101,0.016701670167016704],"translate":[1088433,7800262]}}

● GeoJSON 7.6 MB

● TopoJSON 1.3 MB

● 80 % reduction

What is TopoJSON ?

Page 29: 5/4/16 18 Postgis Topology will replace Postgis SimpleFeature

5/4/16 46Postgis Topology will replace Postgis SimpleFeature

Reduced client network bandwidth

known and fixed bandwidth

Page 30: 5/4/16 18 Postgis Topology will replace Postgis SimpleFeature

5/4/16 47Postgis Topology will replace Postgis SimpleFeature

ST_Simplify perfect works best Postgis Topology

7990316 bytes 149400 byte (98 % less)

Page 31: 5/4/16 18 Postgis Topology will replace Postgis SimpleFeature

5/4/16 48Postgis Topology will replace Postgis SimpleFeature

ST_Simplify gives you a good overview with less points

7990316 bytes 149400 byte (98 % less)

Page 32: 5/4/16 18 Postgis Topology will replace Postgis SimpleFeature

5/4/16 49Postgis Topology will replace Postgis SimpleFeature

ST_Simplify and Simple Feature Using Topology

common border will not match. No problem

Page 33: 5/4/16 18 Postgis Topology will replace Postgis SimpleFeature

5/4/16 50Postgis Topology will replace Postgis SimpleFeature

ST_Simplify and line layers with Topolgy

Page 34: 5/4/16 18 Postgis Topology will replace Postgis SimpleFeature

GeoServer , MapServer and Postgis Topology

Page 35: 5/4/16 18 Postgis Topology will replace Postgis SimpleFeature

5/4/16 52Postgis Topology will replace Postgis SimpleFeature

So what is the end developer reaction Using Postgis Topology ?:-)

Postgis Topology fits new data in to current map.(no id problem, no data lost, no duplication,less data,

faster development time)

Page 36: 5/4/16 18 Postgis Topology will replace Postgis SimpleFeature

IF “YOU NEED SIMPLE USER INTERFACE FOR MAPS UPDATE” AND“MAPS OF HIGH QUALITY”

THENUSE POSTGIS TOPOLOGY

ELSEUSE WHATEVER YOU LIKE

END IF;

Hopefully at next FOSS4G Postgis Topology will be a main themewith workshops many talks.

Thanks for your attention [email protected]