[postgis-users] Problem with raster/polygon intersection
David Quinn
daithiquinn at gmail.com
Sat Feb 4 18:16:22 PST 2012
yes, that fixed it. Thank you!
-David
On Sat, Feb 4, 2012 at 9:05 PM, Paragon Corporation <lr at pcorp.us> wrote:
> **
> Your polygon is untyped so could cast to raster or geometry thus ambiguous
> which function to use.
>
> Try casting it first by changing your code to:
>
> SELECT
> ST_SummaryStats(r.rast) as stats
> FROM
> new_york_r as r
> WHERE
> ST_Intersects(r.rast, 'SRID=900913;POLYGON((-8239995.68240392
> 4974479.31918724,-8230242.31759608 4974479.31918724,-8230242.31759608
> 4979684.68081276,-8239995.68240392 4979684.68081276,-8239995.68240392
> 4974479.31918724))'::geometry)
> Hope that helps,
> Regina
> http://www.postgis.us
>
>
>
> ------------------------------
> *From:* postgis-users-bounces at postgis.refractions.net [mailto:
> postgis-users-bounces at postgis.refractions.net] *On Behalf Of *David Quinn
> *Sent:* Saturday, February 04, 2012 7:51 PM
> *To:* postgis-users at postgis.refractions.net
> *Subject:* [postgis-users] Problem with raster/polygon intersection
>
> Hello List,
>
> I'm trying to intersect a raster with a polygon and running into an error
> message that I don't understand.
>
> SELECT
> ST_SummaryStats(r.rast) as stats
> FROM
> new_york_r as r
> WHERE
> ST_Intersects(r.rast, 'SRID=900913;POLYGON((-8239995.68240392
> 4974479.31918724,-8230242.31759608 4974479.31918724,-8230242.31759608
> 4979684.68081276,-8239995.68240392 4979684.68081276,-8239995.68240392
> 4974479.31918724))')
>
> The error message is:
>
> "ERROR: function st_intersects(raster, unknown) is not unique
> LINE 6: ST_Intersects(r.rast, 'SRID=900913;POLYGON((-8239995.68240...
> ^
> HINT: Could not choose a best candidate function. You might need to add
> explicit type casts."
>
> I am able to run a very similar query with ST_Intersects(r.rast, geom),
> where geom is from another table, and it runs fine. ST_Intersects(geom,
> 'SRID=900913;POLYGON((-823999.....)') also runs without a problem when geom
> is a vector.
>
> Is there a step that I am missing here to run this intersection on a
> raster?
>
> I'm using PostGIS 2.0.0 SVN / Postgresql 9.1 on Windows 7.
>
> Thanks,
> David
>
>
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20120204/f9ec0ee0/attachment.html>
More information about the postgis-users
mailing list