# [postgis-users] gis noob question

Paragon Corporation lr at pcorp.us
Tue Nov 4 17:13:32 PST 2008

```Iulian,

Hmm not sure how much of a noob you are since the below looks kind of
sophisticated for a newbie with some minor syntactical errors
Should be and my parethesis may be off

select (st_dump(
(select  ST_SimplifyPreserveTopology ( st_collect(the_geom),0.01) from
zipcodes
))).geom

1) Question 1 - This assumes you are a total noob. Did you add a spatial
2) Question 2 - Might help to cluster on that index as well since this is a
pretty static table I assume.

3) Where did you get these zipcodes from?  I know for example US zipcodes
are not that large as far as complexity goes (though they are large in
area), so I am questioning why they need to be simplified in the first place
unless you are trying to display all of them at once on the screen.

4) Regarding the below whether it is sane to do that - I would say probably
not, but I could be wrong.

The reason I say no is that that if you collect the geometries first and
then simplify, I think even simplifypreserve will loop thru each geometry
anyway and simplify.  Though I'm not absolutely positive of that.  So the
whole exercise of collect simplify dump is a bit fruitless if that was your
intention.  Not a bad thought and maybe you are right so maybe someone can
correct me on that.

5) If you are getting too many gaps, you may just want to lower your 0.01 to
0.001 or 0.005.  The basic idea being the more you simplify the more gaps
you will get, but the less noticeable they are the further away the observer
is - so for deep in zoom you want no simplification and for far out you want
lots of simplification.

Hope that helps,
Regina

-----Original Message-----
From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Iulian
Margarintescu
Sent: Tuesday, November 04, 2008 10:16 AM
To: postgis-users at postgis.refractions.net
Subject: [postgis-users] gis noob question

Hi,

I have a collection of shapefiles for a number of zipcodes witch i already
imported to postgres, and with i need to use them to create a map with
ThinkGeo. Loading all the data in ThinkGeo (the same in uDig) works but
After some research i've found out about simplification algorithms and at
first tried to simplify every shape for every zipcode but when displayed
there are a lot of gaps between shapes. Than i've found out about topology
preserving simplification but i does not make a lot of sense to apply the
algorithm for each shape, and if applyed for a collection of shapes it would
be nice if after the simplification i still have a shape for each zipcode
since i have data attached to the zipcodes.

Now my question is how should i apply this topology preserving
simplification?

Is it sane to do something like this (with a lot of zipcodes):

select geom(st_dump(
(select  ST_SimplifyPreserveTopology ( st_collect(the_geom),0.01) from
zipcodes
)))

Any other ideas on how should i approach this ?

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

```