[postgis-users] Array Size Error
Paragon Corporation
lr at pcorp.us
Wed Jul 27 14:56:43 PDT 2011
Paul,
I think Leo had something in mind like this:
WITH ctsubgroup AS
( SELECT ST_ConvexHull(ST_Force_2D(ST_Union(geom))) As geom
FROM table001
GROUP BY ST_SnapToGrid(geom, 10,10)
)
SELECT ST_ConvexHull(ST_Union(geom))
FROM ctsubgroup;
The 10,10 should be dependent on your spatial ref , you can make larger
groupings the bigger you make that grid snap.
The idea is you want your subsets to be smaller than max size of array
allowed.
http://www.postgis.org/documentation/manual-svn/ST_SnapToGrid.html
In theory I think ST_MemCollect may work, but will take a really really long
time for that many points
and once it's done collecting, it would push the whole thing to PostGIS/GEOS
to collapse, which will probably lead to other limit issues.
Hope that helps,
Regina
http://www.postgis.us <http://www.postgis.us/>
_____
From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Paragon
Corporation
Sent: Wednesday, July 27, 2011 6:38 AM
To: 'PostGIS Users Discussion'
Subject: Re: [postgis-users] Array Size Error
Paul,
I think it's a waste of time. Your best bet is to collect your geometries
into groups an do a convex hull of each group and then the convexhull of the
convexhulls
Leo
http://www.postgis.us <http://www.postgis.us/>
_____
From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Paul &
Caroline Lewis
Sent: Wednesday, July 27, 2011 5:32 AM
To: PostGIS Users
Subject: [postgis-users] Array Size Error
Thanks for the responses. Have changed the original query from this:
SELECT ST_ConvexHull(ST_Collect(ST_Force_2D(geom))) FROM table001
to this:
SELECT ST_ConvexHull(ST_MemUnion(geom)) FROM table001
and its still running; over 12 hours now.
Is this a waste of time.
I'm trying it this way as I guessed it could be an aggregate approach issue
after reading this post from Paul:
http://blog.cleverelephant.ca/2009/01/must-faster-unions-in-postgis-14.html
and was wondering if the union operation might work for my current
requirements so set it running yesterday.
The ST_Union gives the same array size error after a few seconds but as I
said the ST_MemUnion is still running, but is it working or going to work!!!
Anyway, thanks again for your feedback.
Paul
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20110727/8247aa2c/attachment.html>
More information about the postgis-users
mailing list