[postgis-users] How to simplify and complex (i.e. slow) geometry
Mike Dvorak
dvorak at stanford.edu
Mon Aug 20 22:50:59 PDT 2007
Thanks for the response Martin. Unfortunately, that produces about the
same results, but maybe I'm misinterpreting your advice. Here's what I
tried most recently:
CREATE TABLE buffered_mask_5( key SERIAL PRIMARY KEY );
SELECT AddGeometryColumn('buffered_mask_5', 'the_geom', 3310, 'POLYGON',
2);
INSERT INTO buffered_mask_5 (the_geom) SELECT
ST_Buffer(Transform(ST_Buffer(the_geom, 0.0), 3310), 2500) AS the_geom
FROM usgs_bathy_mm5_20_50_200m
Any more advice?
Cheers,
Mike
Martin Davis wrote:
> Try using ST_Buffer(mask, 0.0). That should union all the geometries
> into a single (Multi)polygon.
>
> You could also help us to find some funding to support porting the new
> JTS optimized predicates to GEOS ;^)
>
> Martin
>
>
>
> Mike Dvorak wrote:
>> Dear PostGIS users,
>>
>> First off, I must say that I think the PostGIS project is absolutely
>> great. I've been using PostGIS daily for my research for about 6 months
>> now and have come to love it. I deal with rather larger geospatial
>> databases (as large as 200 GB), so I think I have been really pushing
>> PostGIS (and Postgres) to its limits but having mostly success in
>> doing so.
>>
>> Here's my current problem. I have a complex 2D polygon geometry that
>> I'm using as a mask, to limit what areas of wind fields from a weather
>> model I insert into my database. You can find an example mask of the
>> "shallow" ocean waters near the San Francisco Bay here:
>> http://www.stanford.edu/~dvorak/tmp/how-to-simplify-geom-example.png
>>
>> The problem is that this 2D polygon, contains a lot of redundancy for a
>> mask and it takes forever (i.e. tens of hours) to create the
>> intersection of the 2D mask polygon and the grid of model points that I
>> want to mask (approximately 200 x 240 points).
>>
>> I tried using ST_ConvexHull and ST_Union (with the mask for both
>> arguments) without luck to simplify this example mask in the URL. Is
>> there a PostGIS function that will get rid of all redundant mask objects
>> i.e. objects that are completely contained within another object, or do
>> I have to program this myself?
>>
>> Thanks for any advice!
>>
>> Cheers,
>> Mike
>>
>>
>>
>
--
==========================================
Mike Dvorak
Atmosphere/Energy PhD student
Dept. of Civil & Environmental Engineering
Stanford University
Phone: (773) 936-8053
==========================================
More information about the postgis-users
mailing list