[postgis-users] Problem in a spatial query

Diego Roberto diegorrborges at gmail.com
Mon Aug 5 11:26:04 PDT 2013


Hello I am conducting a survey to check if a point that I am trying to
insert already exists a point near recorded in a radius of 300 meters.
I use this query to perform this procedure:

SELECT i.id_impediments
  FROM impediments AS i
  WHERE st_dwithin(
GeomFromText('POINT(-49.256452 -16.674886)',4326)::geography,
i.geometry_data,
  300)

So far so good, however for coordinates outside the 'Brazil' displays the
following error:
Coordinate values are out of range [-180 -90, 180 90] for GEOGRAPHY type

Following SQL:
SELECT i.id_impediments
  FROM impediments AS i
  WHERE st_dwithin(
GeomFromText('POINT(37.797848 -122.466774)',4326)::geography,
i.geometry_data,
  300) AND i.id_type =5

How should I treat this information, can someone help me? The way I'm
working is correct?

Thank you.
Diego.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20130805/3cd16a4c/attachment.html>


More information about the postgis-users mailing list