<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=us-ascii" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 9.00.8112.16440"></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=202300302-05022012><FONT color=#0000ff
size=2 face=Arial>Your polygon is untyped so could cast to raster or geometry
thus ambiguous which function to use.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=202300302-05022012><FONT color=#0000ff
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=202300302-05022012><FONT color=#0000ff
size=2 face=Arial>Try casting it first by changing your code
to:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=202300302-05022012><FONT color=#0000ff
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=202300302-05022012><FONT color=#0000ff
size=2 face=Arial><FONT color=#000000 size=3
face="Times New Roman"> SELECT<BR>ST_SummaryStats(r.rast) as
stats<BR>FROM<BR>new_york_r as r <BR>WHERE<BR>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)</FONT><BR></FONT></SPAN></DIV>
<DIV><SPAN class=202300302-05022012></SPAN><FONT face=Arial><FONT
color=#0000ff><FONT size=2>Hope that helps,</FONT></FONT></FONT></DIV>
<DIV><SPAN class=202300302-05022012></SPAN><SPAN
class=202300302-05022012></SPAN><FONT face=Arial><FONT color=#0000ff><FONT
size=2>R<SPAN class=202300302-05022012>egina</SPAN></FONT></FONT></FONT></DIV>
<DIV><SPAN class=202300302-05022012></SPAN><SPAN
class=202300302-05022012></SPAN><FONT face=Arial><FONT color=#0000ff><FONT
size=2><A href="http://www.postgis.us">h<SPAN
class=202300302-05022012>ttp://www.postgis.us</A></SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=202300302-05022012></SPAN></FONT></FONT></FONT><BR> </DIV>
<BLOCKQUOTE
style="BORDER-LEFT: #0000ff 2px solid; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px">
<DIV dir=ltr lang=en-us class=OutlookMessageHeader align=left>
<HR tabIndex=-1>
<FONT size=2 face=Tahoma><B>From:</B>
postgis-users-bounces@postgis.refractions.net
[mailto:postgis-users-bounces@postgis.refractions.net] <B>On Behalf Of
</B>David Quinn<BR><B>Sent:</B> Saturday, February 04, 2012 7:51
PM<BR><B>To:</B> postgis-users@postgis.refractions.net<BR><B>Subject:</B>
[postgis-users] Problem with raster/polygon intersection<BR></FONT><BR></DIV>
<DIV></DIV>Hello List,<BR><BR>I'm trying to intersect a raster with a polygon
and running into an error message that I don't understand.
<BR><BR>
SELECT<BR>
ST_SummaryStats(r.rast) as stats<BR>
FROM<BR> new_york_r as
r <BR>
WHERE<BR>
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))')<BR><BR>The error message is:<BR><BR>"ERROR:
function st_intersects(raster, unknown) is not unique<BR>LINE 6:
ST_Intersects(r.rast,
'SRID=900913;POLYGON((-8239995.68240...<BR>
^<BR>HINT: Could not choose a best candidate function. You might need to
add explicit type casts."<BR><BR>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.<BR><BR>Is there a step that I am
missing here to run this intersection on a raster?<BR><BR>I'm using PostGIS
2.0.0 SVN / Postgresql 9.1 on Windows 7.
<BR><BR>Thanks,<BR>David<BR><BR><BR><BR></BLOCKQUOTE></BODY></HTML>