<div dir="ltr">Hi,<div><br></div><div>The issue is indeed you are using Postgres polygons instead of PostGIS polygons. ST_MakePoint (note ST_ prefix) builds a postgis point.<br>Non-working countertpart would be this:<br><font color="#000000" face="monospace">SELECT ST_WITHIN('(1,1)'::point, '(1,1)'::point ) ;            </font></div><span style="font-family:monospace"><br></span></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Aug 6, 2019 at 7:37 AM Michael Lubinsky <<a href="mailto:mlubinsky@hotmail.com">mlubinsky@hotmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">




<div dir="ltr">
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<p style="margin:0px 0px 1em;font-family:Arial,"Helvetica Neue",Helvetica,sans-serif;font-size:15px;clear:both;color:rgb(36,39,41);text-align:left;background-color:rgb(255,255,255)">
Environment: PostgreSQL 11.4 with PostGIS 2.5.2</p>
<pre style="margin:0px 0px 1em;padding:12px 8px;font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace,sans-serif;font-size:13px;width:auto;max-height:600px;overflow:auto;background-color:rgb(239,240,241);border-radius:3px;color:rgb(36,39,41);text-align:left"><code style="margin:0px;background-color:rgb(239,240,241)">CREATE TABLE m_polygon (id SERIAL PRIMARY KEY, bounds POLYGON);
INSERT INTO m_polygon(bounds) VALUES( 
  '(0.0, 0.0),  (0.0, 10.0), (10.0, 0.0), (10.0, 10.0), (0,0)' 
);

SELECT ST_WITHIN(m_polygon.bounds , m_polygon.bounds ) FROM m_polygon;
</code></pre>
<p style="margin:0px 0px 1em;font-family:Arial,"Helvetica Neue",Helvetica,sans-serif;font-size:15px;clear:both;color:rgb(36,39,41);text-align:left;background-color:rgb(255,255,255)">
I am getting the error message for SELECT statement above:</p>
<pre style="margin:0px 0px 1em;padding:12px 8px;font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace,sans-serif;font-size:13px;width:auto;max-height:600px;overflow:auto;background-color:rgb(239,240,241);border-radius:3px;color:rgb(36,39,41);text-align:left"><code style="margin:0px;background-color:rgb(239,240,241)">ERROR:  function st_within(polygon, polygon) does not exist 
HINT:  No function matches the given name and argument types. You might 
need to add explicit type casts
</code></pre>
<p style="margin:0px 0px 1em;font-family:Arial,"Helvetica Neue",Helvetica,sans-serif;font-size:15px;clear:both;color:rgb(36,39,41);text-align:left;background-color:rgb(255,255,255)">
I was thinking what the reason for the error is: the ST_WITHIN arguments types should be GEOMETRY, but I am passing the POLYGONs.</p>
<p style="margin:0px 0px 1em;font-family:Arial,"Helvetica Neue",Helvetica,sans-serif;font-size:15px;clear:both;color:rgb(36,39,41);text-align:left;background-color:rgb(255,255,255)">
However the following works:</p>
<pre style="margin:0px 0px 1em;padding:12px 8px;font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace,sans-serif;font-size:13px;width:auto;max-height:600px;overflow:auto;background-color:rgb(239,240,241);border-radius:3px;color:rgb(36,39,41);text-align:left"><code style="margin:0px;background-color:rgb(239,240,241)">SELECT ST_WITHIN(ST_MakePoint(1,1), ST_MakePoint(1,1) ) ;</code></pre>
Thanks! </div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Michael</div>
</div>

_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/postgis-users" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/postgis-users</a></blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div>Darafei Praliaskouski</div><div>Support me: <a href="http://patreon.com/komzpa" target="_blank">http://patreon.com/komzpa</a></div></div></div></div>