[postgis-users] Map Simplification Program howto use it or is it exist any better alternative?
Maciej Sawicki
viroos.pl at gmail.com
Fri Feb 12 07:18:20 PST 2010
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
More information about the postgis-users
mailing list