Changes between Version 19 and Version 20 of UsersWikiPostgisTopology


Ignore:
Timestamp:
Sep 13, 2016, 6:22:09 AM (8 years ago)
Author:
Lars Aksel Opsahl
Comment:

Info about a simple script to convert Simple Feature to Postgis Topology

Legend:

Unmodified
Added
Removed
Modified
  • UsersWikiPostgisTopology

    v19 v20  
    8787this implementation follows as for these views structure.
    8888
     89== Convert shape file and simple feature data to Postgis Topology ==
     90
     91Here is a ref to script that copies small tables with simple feature data into to a postgis topology table which are created on the fly.  This purpose of this script is to make it easier to Postgis Topology on your simple feature data.[[BR]]
     92(This script is not created for performance but just to make easier to to get people in to test Postgis Topology on small datasets.)
     93
     94The script taks at minimum two parameters [[BR]]
     951) Parameters one is schema1.simple_feature_table1 used for input. [[BR]]
     962) Parameter two is the schema2.topology_table_name for the result. [[BR]]
     97(More info about parameters can found in the script it self).
     98
     99Here is an example of how to call it
     100
     101{{{
     102select topo_help_sf_to_topology_case_1('org_rein_sosi_dump.rein_konsesjonomr_flate','topo_test.rein_konsesjonomr_flate');
     103}}}
     104
     105The result of this file will two tables : [[BR]]
     106Table 1 : topo_test.rein_konsesjonomr_flate with the attributtes from table one and a topology column [[BR]]
     107Table 2 : topo_test.rein_konsesjonomr_flate_v with attributtes from table one and a geometry columns casted from the portgis topology column. [[BR]]
     108
     109To check out the data use for instance qgis with Plugin: PostGIS Topology Editor from Strk .
     110
     111if you have some shape files added here som you can test here is a example where I uses shp2pgsl to gether with this script.
     112
     113{{{
     114-- # create schema if not exist
     115-- psql sl -c'CREATE SCHEMA IF NOT EXISTS test;'
     116
     117-- # copy data from shape file to postgis
     118-- shp2pgsql -W ISO-8859-1 -d -D -s 4258 data/muni_surface.shp test.muni_surface | psql sl;
     119
     120-- #copy data from simple feature to topology
     121-- psql sl -c "SELECT topo_help_sf_to_topology_case_1('test.muni_surface','test_topo.muni_surface');" 2>> /tmp/importfromtemp.log;
     122}}}
     123
     124To instal it
     125{{{
     126git clone https://github.com/NibioOpenSource/pgtopo_update_sql
     127cd pgtopo_update_sql/src/test/sql/import
     128cat script/func_* | psql
     129}}}
     130
     131
     132
    89133== Validating Topology ==
    90134