[prev in list] [next in list] [prev in thread] [next in thread]
List: postgis-users
Subject: Re: [postgis-users] Error with ST functions
From: "Paragon Corporation" <lr () pcorp ! us>
Date: 2015-11-21 5:21:29
Message-ID: 000001d1241c$7a8d2650$6fa772f0$ () pcorp ! us
[Download RAW message or body]
This is a multipart message in MIME format.
[Attachment #2 (multipart/alternative)]
This is a multipart message in MIME format.
Lorenzo,
There is nothing wrong here except your query.
There is no such signature as ST_Clip(Boolean, geom,rast)
It's
ST_Clip(geom,rast, boolean)
Your proc query did the array agg of protos out of sequence.
Easiest way to see this is just open a psql console and run
\df st_clip
And you should see this though your schema location is probably different from mine.
\
List of functions
Schema | Name | Result data type | \
Argument data types | Type
---------+---------+------------------+----------------------------------------------- \
----------------------------------------------------------------------------------------+--------
postgis | st_clip | raster | rast raster, geom geometry, crop boolean \
| normal
postgis | st_clip | raster | rast raster, geom geometry, nodataval double \
precision, crop boolean DEFAULT true \
| normal
postgis | st_clip | raster | rast raster, geom geometry, nodataval double \
precision[] DEFAULT NULL::double precision[], crop boolean DEFAULT true \
| normal
postgis | st_clip | raster | rast raster, nband integer, geom geometry, \
crop boolean \
| normal
postgis | st_clip | raster | rast raster, nband integer, geom geometry, \
nodataval double precision, crop boolean DEFAULT true \
| normal
postgis | st_clip | raster | rast raster, nband integer[], geom geometry, \
nodataval double precision[] DEFAULT NULL::double precision[], crop boolean DEFAULT \
true | normal
(6 rows)
Or look at the manual
http://postgis.net/docs/RT_ST_Clip.html
Hope that helps,
Regina
http://www.postgis.us
http://postgis.net
From: postgis-users [mailto:postgis-users-bounces@lists.osgeo.org] On Behalf Of \
Lorenzo Bottaccioli
Sent: Friday, November 20, 2015 7:10 AM
To: Lorenzo Bottaccioli <lorenzo.bottaccioli@gmail.com>; PostGIS Users Discussion \
<postgis-users@lists.osgeo.org>
Subject: Re: [postgis-users] Error with ST functions
HI, I'have tried to reinstall postgis. But i still get errors like this one:
SELECT
ST_clip(True,polygon.geom, raster.rast)
FROM
public.edifici as polygon,
public.ele1000x1000 as raster;
ERROR: function st_clip(boolean, geometry, raster) does not exist
LINE 2: ST_clip(True,polygon.geom, raster.rast)
^
HINT: No function matches the given name and argument types. You might need to add \
explicit type casts.
gis=# SELECT
n.nspname, p.proname, array_agg(t.typname)
FROM
pg_proc p, pg_namespace n, pg_type t
WHERE p.proname = 'st_clip'
AND n.oid = p.pronamespace
AND t.oid = any (p.proargtypes)
GROUP BY
n.nspname, p.proname, p.oid;
nspname | proname | array_agg
---------+---------+--------------------------------------
public | st_clip | {bool,_float8,geometry,raster}
public | st_clip | {bool,_int4,_float8,geometry,raster}
public | st_clip | {bool,float8,geometry,raster}
public | st_clip | {bool,int4,float8,geometry,raster}
public | st_clip | {bool,int4,geometry,raster}
public | st_clip | {bool,geometry,raster}
2015-11-19 18:38 GMT+01:00 Sandro Santilli <strk@keybit.net <mailto:strk@keybit.net> \
>:
On Thu, Nov 19, 2015 at 06:25:46PM +0100, Lorenzo Bottaccioli wrote:
> grep -i st_bandisnodata rtpostgis.sql
> CREATE OR REPLACE FUNCTION st_bandisnodata(rast raster, band integer
> DEFAULT 1, forceChecking boolean DEFAULT FALSE)
> CREATE OR REPLACE FUNCTION st_bandisnodata(rast raster, forceChecking
> boolean)
> AS $$ SELECT st_bandisnodata($1, 1, $2) $$
Right, so someone tempered with the db.
There might be more things missing.
One way to check what else is missing would be:
BEGIN;
CREATE EXTENSION postgis VERSION '2.1.2' FROM 'unpackaged';
-- you'd get an error here, if anything is missing
ROLLBACK; -- we're just checking, right?
Let me know if you need help with fixing things.
--strk;
() Free GIS & Flash consultant/developer
/\ http://strk.keybit.net/services.html
[Attachment #5 (text/html)]
<html xmlns:v="urn:schemas-microsoft-com:vml" \
xmlns:o="urn:schemas-microsoft-com:office:office" \
xmlns:w="urn:schemas-microsoft-com:office:word" \
xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" \
xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type \
content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 \
(filtered medium)"><style><!-- /* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div \
class=WordSection1><p class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Lorenzo,<o:p></o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>There is \
nothing wrong here except your query.<o:p></o:p></span></p><p class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>There is no \
such signature as ST_Clip(Boolean, geom,rast)<o:p></o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>It's \
<o:p></o:p></span></p><p class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>ST_Clip(geom,rast, \
boolean)<o:p></o:p></span></p><p class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Your proc \
query did the array agg of protos out of sequence.<o:p></o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Easiest way \
to see this is just open a psql console and run<o:p></o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>\df \
st_clip<o:p></o:p></span></p><p class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>And you \
should see this though your schema location is probably different from \
mine.<o:p></o:p></span></p><p class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'> \
List of functions<o:p></o:p></span></p><p class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'> Schema | \
Name | Result data type | \
Argument data types \
| Type<o:p></o:p></span></p><p class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>---------+---- \
-----+------------------+------------------------------------------------------------- \
--------------------------------------------------------------------------+--------<o:p></o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'> postgis | \
st_clip | raster | rast raster, geom geometry, crop boolean \
| normal<o:p></o:p></span></p><p class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'> postgis | \
st_clip | raster | rast raster, geom geometry, nodataval double \
precision, crop boolean DEFAULT true \
| normal<o:p></o:p></span></p><p class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'> postgis | \
st_clip | raster | rast raster, geom geometry, nodataval double \
precision[] DEFAULT NULL::double precision[], crop boolean DEFAULT true \
| normal<o:p></o:p></span></p><p class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'> postgis | \
st_clip | raster | rast raster, nband integer, geom geometry, \
crop boolean \
| normal<o:p></o:p></span></p><p class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'> postgis | \
st_clip | raster | rast raster, nband integer, geom geometry, \
nodataval double precision, crop boolean DEFAULT true \
| normal<o:p></o:p></span></p><p class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'> postgis | \
st_clip | raster | rast raster, nband integer[], geom geometry, \
nodataval double precision[] DEFAULT NULL::double precision[], crop boolean DEFAULT \
true | normal<o:p></o:p></span></p><p class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>(6 \
rows)<o:p></o:p></span></p><p class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Or look at \
the manual<o:p></o:p></span></p><p class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><a \
href="http://postgis.net/docs/RT_ST_Clip.html">http://postgis.net/docs/RT_ST_Clip.html</a><o:p></o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Hope that \
helps,<o:p></o:p></span></p><p class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Regina<o:p></o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><a \
href="http://www.postgis.us">http://www.postgis.us</a><o:p></o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><a \
href="http://postgis.net">http://postgis.net</a><o:p></o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p \
class=MsoNormal style='margin-left:.5in'><b><span \
style='font-size:11.0pt;font-family:"Calibri",sans-serif'>From:</span></b><span \
style='font-size:11.0pt;font-family:"Calibri",sans-serif'> postgis-users \
[mailto:postgis-users-bounces@lists.osgeo.org] <b>On Behalf Of </b>Lorenzo \
Bottaccioli<br><b>Sent:</b> Friday, November 20, 2015 7:10 AM<br><b>To:</b> Lorenzo \
Bottaccioli <lorenzo.bottaccioli@gmail.com>; PostGIS Users Discussion \
<postgis-users@lists.osgeo.org><br><b>Subject:</b> Re: [postgis-users] Error \
with ST functions<o:p></o:p></span></p><p class=MsoNormal \
style='margin-left:.5in'><o:p> </o:p></p><div><p class=MsoNormal \
style='margin-left:.5in'>HI, I'have tried to reinstall postgis. But i still get \
errors like this one:<o:p></o:p></p><div><p class=MsoNormal \
style='margin-left:.5in'><o:p> </o:p></p></div><div><div><p class=MsoNormal \
style='margin-left:.5in'> SELECT \
\
<o:p></o:p></p></div><div><p \
class=MsoNormal style='margin-left:.5in'>ST_clip(True,polygon.geom, \
raster.rast)<o:p></o:p></p></div><div><p class=MsoNormal \
style='margin-left:.5in'>FROM <o:p></o:p></p></div><div><p class=MsoNormal \
style='margin-left:.5in'> public.edifici as \
polygon,<o:p></o:p></p></div><div><p class=MsoNormal style='margin-left:.5in'> \
public.ele1000x1000 as raster;<o:p></o:p></p></div><div><p class=MsoNormal \
style='margin-left:.5in'>ERROR: function st_clip(boolean, geometry, raster) \
does not exist<o:p></o:p></p></div><div><p class=MsoNormal \
style='margin-left:.5in'>LINE 2: ST_clip(True,polygon.geom, \
raster.rast)<o:p></o:p></p></div><div><p class=MsoNormal \
style='margin-left:.5in'> ^<o:p></o:p></p></div><div><p \
class=MsoNormal style='margin-left:.5in'>HINT: No function matches the given \
name and argument types. You might need to add explicit type \
casts.<o:p></o:p></p></div><div><p class=MsoNormal style='margin-left:.5in'>gis=# \
SELECT \
<o:p></o:p></p></div><div><p class=MsoNormal \
style='margin-left:.5in'> n.nspname, p.proname, \
array_agg(t.typname)<o:p></o:p></p></div><div><p class=MsoNormal \
style='margin-left:.5in'> FROM \
\
<o:p></o:p></p></div><div><p class=MsoNormal \
style='margin-left:.5in'> pg_proc p, pg_namespace n, pg_type \
t<o:p></o:p></p></div><div><p class=MsoNormal style='margin-left:.5in'> WHERE \
p.proname = 'st_clip'<o:p></o:p></p></div><div><p class=MsoNormal \
style='margin-left:.5in'> AND n.oid = \
p.pronamespace<o:p></o:p></p></div><div><p class=MsoNormal \
style='margin-left:.5in'> AND t.oid = any \
(p.proargtypes)<o:p></o:p></p></div><div><p class=MsoNormal \
style='margin-left:.5in'> GROUP BY<o:p></o:p></p></div><div><p class=MsoNormal \
style='margin-left:.5in'> n.nspname, p.proname, \
p.oid;<o:p></o:p></p></div><div><p class=MsoNormal \
style='margin-left:.5in'> nspname | proname | \
array_agg \
<o:p></o:p></p></div><div><p class=MsoNormal \
style='margin-left:.5in'>---------+---------+--------------------------------------<o:p></o:p></p></div><div><p \
class=MsoNormal style='margin-left:.5in'> public | st_clip | \
{bool,_float8,geometry,raster}<o:p></o:p></p></div><div><p class=MsoNormal \
style='margin-left:.5in'> public | st_clip | \
{bool,_int4,_float8,geometry,raster}<o:p></o:p></p></div><div><p class=MsoNormal \
style='margin-left:.5in'> public | st_clip | \
{bool,float8,geometry,raster}<o:p></o:p></p></div><div><p class=MsoNormal \
style='margin-left:.5in'> public | st_clip | \
{bool,int4,float8,geometry,raster}<o:p></o:p></p></div><div><p class=MsoNormal \
style='margin-left:.5in'> public | st_clip | \
{bool,int4,geometry,raster}<o:p></o:p></p></div><div><p class=MsoNormal \
style='margin-left:.5in'> public | st_clip | \
{bool,geometry,raster}<o:p></o:p></p></div></div><div><p class=MsoNormal \
style='margin-left:.5in'><o:p> </o:p></p></div></div><div><p class=MsoNormal \
style='margin-left:.5in'><o:p> </o:p></p><div><p class=MsoNormal \
style='margin-left:.5in'>2015-11-19 18:38 GMT+01:00 Sandro Santilli <<a \
href="mailto:strk@keybit.net" \
target="_blank">strk@keybit.net</a>>:<o:p></o:p></p><blockquote \
style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in \
6.0pt;margin-left:4.8pt;margin-right:0in'><p class=MsoNormal \
style='margin-left:.5in'>On Thu, Nov 19, 2015 at 06:25:46PM +0100, Lorenzo \
Bottaccioli wrote:<br>> grep -i st_bandisnodata rtpostgis.sql<br>> CREATE OR \
REPLACE FUNCTION st_bandisnodata(rast raster, band integer<br>> DEFAULT 1, \
forceChecking boolean DEFAULT FALSE)<br>> CREATE OR REPLACE FUNCTION \
st_bandisnodata(rast raster, forceChecking<br>> boolean)<br>> \
AS $$ SELECT st_bandisnodata($1, 1, $2) $$<br><br>Right, so someone tempered \
with the db.<br>There might be more things missing.<br><br>One way to check what else \
is missing would be:<br><br> BEGIN;<br> CREATE EXTENSION postgis VERSION \
'2.1.2' FROM 'unpackaged';<br> -- you'd get an error here, if anything is \
missing<br> ROLLBACK; -- we're just checking, right?<br><br>Let me know if you \
need help with fixing things.<o:p></o:p></p><div><div><p class=MsoNormal \
style='margin-left:.5in'><br>--strk;<br><br> () Free GIS & \
Flash consultant/developer<br> /\ <a \
href="http://strk.keybit.net/services.html" \
target="_blank">http://strk.keybit.net/services.html</a><o:p></o:p></p></div></div></blockquote></div><p \
class=MsoNormal style='margin-left:.5in'><o:p> </o:p></p></div></div></body></html>
[Attachment #6 (text/plain)]
_______________________________________________
postgis-users mailing list
postgis-users@lists.osgeo.org
http://lists.osgeo.org/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