[postgis-users] gis noob question

Paragon Corporation lr at pcorp.us
Tue Nov 4 17:19:46 PST 2008


Iulian,
Oops I forgot one important point.  DO NOT simplify In longlat projection.
You get somewhat bizarre results and that may be perhaps what you are
experiencing.

I think you will want to reproject to a planar project and then project back

So 

SELECT
ST_Transform(ST_SimpilfyPreserverTopology(ST_Transform(the_geom,2163),
100),4326) As newsimpgeom
FROM zipcode;

(2163 is US National Atlas meters so you may need to change that, and 4326
is WGS 84 longlat.  If you got zips from census you may need to change that
to 4269 NAD 83 long lat).

You'll also need to play around with the simplification metric.

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
really slow ( also slow when loading shapefiles directly ). 
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






More information about the postgis-users mailing list