<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Following my question (from month ago),
i first thought Simon's answer was correct as i didn't get an
error message.<br>
However, i wasn't getting any <i>results </i>either. Returning
to the issue (after a long break) i now realize the answer is
something like this:<br>
<br>
SELECT * FROM layer<br>
WHERE ST_spatial-relate-function( geom, <b>ST_Transform</b>(
ST_GeomFromKML( 'kml-point' ), 3005 ) )<br>
<br>
<pre class="moz-signature" cols="72">Martin Feuchtwanger <a class="moz-txt-link-abbreviated" href="mailto:feumar@shaw.ca">feumar@shaw.ca</a>
<a class="moz-txt-link-freetext" href="http://members.shaw.ca/geomatics.developer">http://members.shaw.ca/geomatics.developer</a>
</pre>
<pre style="white-space: pre-wrap; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;"><i style="color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: medium; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">On Thu Dec 13 15:26:57 PST 2012, </i><i style="color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: medium; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widow
s: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;"><span style="color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: medium; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">Simon Greener wrote:</span>
</i>
Martin,
Why not enforce the SRID as follows:
SELECT * FROM layer
WHERE ST_Relate( geom, ST_SetSRID(ST_GeomFromKML('<Point><coordinates>-125.6077,49.8986</coordinates></Point>'),3005) );
regards
Simon
</pre>
On 13/12/2012 2:49 PM, Martin Feuchtwanger wrote:<br>
</div>
<blockquote cite="mid:50CA5B88.1070205@shaw.ca" type="cite">I have a
layer table in postgis and an external point.
<br>
The layer SRID is 3005 and the external point is in KML.
<br>
I need help with this form of selection:
<br>
<br>
SELECT * FROM layer WHERE ST_spatial-relate( geom, ST_GeomFromKML(
'kml-point' ) )
<br>
<br>
The 'kml-point' is like this
'<Point><coordinates>-125.6077,49.8986</coordinates></Point>'<br>
and the ST_spatial-relate() is one of the many
spatial-relationship functions that take 2 geometries and return a
boolean.
<br>
<br>
When i use ST_Disjoint(), i get "ERROR: Operation on mixed SRID
geometries"
<br>
When i use ST_Contains(), i get no error message but no rows
either (there should be some).
<br>
<br>
I understand that other conversion functions, such as
ST_GeomFromText(), would need an SRID qualifier, but i didn't
think that ST_GeomFromKML() should.
<br>
<br>
I've tried a few variations of prefixing the 'kml-point' with
srid=3005; and postfixing it with ::geometry and get a variety of
error messages.
<br>
<br>
What am i doing wrong?
<br>
<br>
PostGIS_Full_Version()
<br>
"POSTGIS="2.0.1 r9979" GEOS="3.3.5-CAPI-1.7.5" PROJ="Rel. 4.8.0, 6
March 2012" GDAL="GDAL 1.9.1, released 2012/05/15" LIBXML="2.7.8"
LIBJSON="UNKNOWN" RASTER"
<br>
<br>
Thanks,
<br>
<br>
</blockquote>
<br>
</body>
</html>