You are correct when you note that two lines that are coincident prior to application of DP are unlikely to be coincident afterward. The polygons of which they are part may have gaps and overlaps introduced.

You could avoid this issue by extracting the polygon boundary lines, union-ing them together, simplify-ing those, and building back into polygons.

Maciej Sawicki wrote:
Hi,
I want to simplify complex shp file. I will probably use something
like DP algorithm
(http://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm). But
when using DP algorithm for different points sets, common points can
be treated differently and this causes empty space between polygons.
To avoid this I need to use algorithm separately for different
sections.

I tried do it my self with help of geotools but I stumbled into this
project: 
http://www.cartoweb.org/downloads/vertexsimplification/documentation.html.
Unfortunately I don't have much experience with relational databases
and I don't heave any expedience with postgis.

I tried to simplify this shp:
http://efele.net/maps/tz/world/tz_world.zip. I installed postgis and
imported my shp. This is my db:

 Schema |         Name         |   Type   | Owner
--------+----------------------+----------+--------
 public | geometry_columns     | table    | viroos
 public | spatial_ref_sys      | table    | viroos
 public | tz_world_org         | table    | viroos
 public | tz_world_org_gid_seq | sequence | viroos

I use this command: python vertex.py -H localhost -u viroos -p
password -d simplify2 -v public -t public.tz_world -i gid -g geom -m
100000

but I get this error:

Vertex Table Generation
Traceback (most recent call last):
  File "vertex.py", line 393, in <module>
    main()
  File "vertex.py", line 380, in main
    vertex(schemaVertex,tableIn,colGeo,colId,dmin)
  File "vertex.py", line 46, in vertex
    populateVertex(vertex,sequence,colId,colGeo,tableIn,dmin)
  File "vertex.py", line 105, in populateVertex
    geometryType= s[0][0]
IndexError: list index out of range


I got no idea what I do wrong :(.

I will appreciate any help with this.
Also if there is exist any better alternative for doing this I would
like to hear about it.

TIA for help.

Best regards,
Maciej Sawicki
_______________________________________________
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


--
Regards,

Chris Hermansen · chris.herman...@timberline.ca · skype:clhermansen
tel+1.604.714.2878   ·  fax+1.604.733.0631   ·   mob+1.778.840.4625
Timberline Natural Resource Group Ltd   ·  http://www.timberline.ca
401  ·  958 West 8th Avenue  ·  Vancouver BC  ·  Canada  ·  V5Z 1E5

_______________________________________________
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users

Reply via email to