[postgis-users] st_distance meter/degree

franco base frenk.calza at gmail.com
Thu Apr 13 03:54:05 PDT 2017


Thanks Jorge but it isn't the matter.
I'd know why postgis have a different way to calculate the distance
with the same sql query.

2017-04-13 12:37 GMT+02:00 Jorge Gustavo Rocha <jgr at di.uminho.pt>:

> Hi Franco,
>
> You can use the usual control statements IF THEN ELSE [1] to make it
> exactly like you want.
>
> [1]
> https://www.postgresql.org/docs/current/static/plpgsql-
> control-structures.html
>
> Regards,
>
> Jorge
>
> Às 10:57 de 13-04-2017, franco base escreveu:
> > Hi all.
> > Is it possible that st_distance between point return meter distance if
> > point are very close and degrees otherwise?
> >
> > SELECT ST_distance ( ST_SetSRID
> > (ST_MakePoint(45.4553804010375,9.11292550791171) ,4326), ST_SetSRID
> > (ST_MakePoint(45.4553855607023,9.11291318106981) ,4326))
> >
> > return 1.3 ( meter distance)
> >
> >
> > SELECT ST_distance ( ST_SetSRID
> > (ST_MakePoint(45.4553804010375,9.11292550791171) ,4326), ST_SetSRID
> > (ST_MakePoint(45.4560699405679,9.1164832309759) ,4326))
> >
> > return 0.003 (degrees distance)
> >
> >
> > Thanks
> > fb
> >
> >
> >
> >
> >
> > _______________________________________________
> > postgis-users mailing list
> > postgis-users at lists.osgeo.org
> > https://lists.osgeo.org/mailman/listinfo/postgis-users
> >
>
> J. Gustavo
> --
> Jorge Gustavo Rocha
> Departamento de Informática
> Universidade do Minho
> 4710-057 Braga
> Tel: +351 253604480
> Fax: +351 253604471
> Móvel: +351 910333888
> skype: nabocudnosor
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/postgis-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20170413/b81f2721/attachment.html>


More information about the postgis-users mailing list