How to find coordinates from a point having distance and direction(bearing).

827 views
Skip to first unread message

Danilo Cicerone

unread,
Feb 2, 2013, 12:13:28 AM2/2/13
to spatiali...@googlegroups.com
Hi to all,
I'm a SpatiaLite newbie and looking for a way to calculate the coordinates' point having only an origin point, a distance and a direction(azimuth?!, bearing?!). I refer to a WGS84 and SpatiaLite 4.0.
Thanks in advance, Danilo

Erwin P

unread,
Feb 2, 2013, 2:57:31 PM2/2/13
to spatiali...@googlegroups.com
Have a look at:

and this one

Op zaterdag 2 februari 2013 06:13:28 UTC+1 schreef Danilo Cicerone het volgende:

Danilo Cicerone

unread,
Feb 2, 2013, 3:34:31 PM2/2/13
to spatiali...@googlegroups.com
Thanks, but is it possible to translate that in spatialite SQL?

JaakL

unread,
Feb 3, 2013, 11:21:15 AM2/3/13
to spatiali...@googlegroups.com

Note that this given Eucleidian formula does not work if your souce point is in latitude and longitude degrees (WGS84). If you deal with small area, then simpler would be to convert x and y to suitable projection, make sure that distance is in same units and then use xNew = x + (radius*sin(radians)) etc. 

 For the generic and direct solution you want to use Vincety direct forumula [1], which seems not to be implemented in spatialite, I can find only inverse formula (for geodesic distance) from gg_geodesic.c. See interesting reading also in proj.4 page [2].  


Jaak

Danilo Cicerone

unread,
Feb 4, 2013, 3:50:40 AM2/4/13
to spatiali...@googlegroups.com
Thanks a lot,
Danilo

sandro furieri

unread,
Feb 4, 2013, 3:58:59 AM2/4/13
to spatiali...@googlegroups.com
Hi Danilo,

your problem is strictly related with aerial and maritime long range
navigation; as already reported by Jaak, computing distances on the
sphere/ellipsoid is a rather complex task, and requires resolving the
Vincenty formulae [1].
[1] http://en.wikipedia.org/wiki/Vincenty%27s_formulae

SpatiaLite simply supports a single Vincenty operation, i.e. computing
distances on the ellipsoid (supporting this function is required by
the most recent Spatial SQL standards):
ST_Distance () for geographic lat/long coordinates.

I'm sorry, but there are no further SQL functions Vincenty-based
currently implemented in spatialite.

bye Sandro

Danilo Cicerone

unread,
Feb 4, 2013, 7:57:02 AM2/4/13
to spatiali...@googlegroups.com
Ciao Sandro, grazie.


2013/2/4 sandro furieri <a.fu...@lqt.it>

--
You received this message because you are subscribed to the Google Groups "SpatiaLite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spatialite-use...@googlegroups.com.
To post to this group, send email to spatiali...@googlegroups.com.
Visit this group at http://groups.google.com/group/spatialite-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

sandro furieri

unread,
Mar 14, 2013, 10:04:36 AM3/14/13
to spatiali...@googlegroups.com
Hi Danilo,

you are a lucky man :-)

a new feature will be supported by the next to come SpatiaLite 4.1.0

SELECT ST_AsText( ST_Project( MakePoint( 11.52, 42.38, 4326 ), 
50000, Radians( 45 ) ) ); ---------- POINT(11.951479 42.697467)


please see:
https://www.gaia-gis.it/fossil/libspatialite/wiki?name=4.1.0+Changes#geom

bye Sandro

Danilo Cicerone

unread,
Mar 14, 2013, 12:18:51 PM3/14/13
to spatiali...@googlegroups.com
Thanks Sandro, I really appreciate it.


2013/3/14 sandro furieri <a.fu...@lqt.it>

--
You received this message because you are subscribed to a topic in the Google Groups "SpatiaLite Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/spatialite-users/SR0Kb1CffRI/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to spatialite-use...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages