[postgis-users] Problem in a spatial query

Lelo - Luiz Rogério De Pieri lelo.pieri at gmail.com
Mon Aug 5 11:32:29 PDT 2013


Hi Diego,

What about remove ::geography from your query?




On Mon, Aug 5, 2013 at 3:26 PM, Diego Roberto <diegorrborges at gmail.com>wrote:

> 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.
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>
>


-- 
Rogério De Pieri  (Lelo)
MBA em Gerenciamento de Projetos - FGV
SCJP 5
Buscando melhorar a cada dia
Áudio, Hardware & Software
www.twitter.com/lelopieri
blogdolelo.wordpress.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20130805/bf2cf359/attachment.html>


More information about the postgis-users mailing list