[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgis-users
Subject:    Re: [postgis-users] Combining squares
From:       Andreas <ml () 3 ! 141592654 ! de>
Date:       2009-12-23 1:59:38
Message-ID: 22427644.55.1261533578044.JavaMail.root () store1 ! zcs ! ext ! wpsrv ! net
[Download RAW message or body]

Hi,
 
> SELECT
> ST_Difference(ST_Union(the_geom), (SELECT the_geom FROM squares WHERE
> id='S'))
> FROM squares
> [...]
> Does this return a multipolyon or a single polygon? 

I think it depends on whether or not the result is presentable as a single polygon. I \
had a test case which consisted of disjoint squares which touch each other - in this \
case the upper query resulted in a single polygon.

> I didn't state
> this originally, but I have disjointed squares. So if you look at a
> grid :
> ABCDEF
> OPQRST
> UVWXYZ
> I might have ABCEFOQUVW
> ABC EF
> O Q
> UVW
> So I would want one polygon with ABCQWVU and one with EF

As far as I know, you may want to produce a multi-polygon M and then use \
generate_series [1] and ST_GeometryN [2] for retrieving one row for each \
single-polygon in M - I'm not quite sure on how to do that syntactically, but there \
is an example in [2], which may help you out.

Best regards,
Andreas

[1] http://www.postgresql.org/docs/8.4/interactive/functions-srf.html
[2] http://postgis.refractions.net/docs/ST_GeometryN.html
_______________________________________________
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic