Direction Distance measure in python code

41 views
Skip to first unread message

Dheeraj Kumar

unread,
Dec 9, 2018, 8:53:34 AM12/9/18
to django...@googlegroups.com
Hi can any one tell how can i get distance measure in direction wise
N3 W4 S8 E4 N5
here n is north, w is west , s is south , e is east , n is north
please tell python Django code

PASCUAL Eric

unread,
Dec 9, 2018, 11:44:46 AM12/9/18
to django...@googlegroups.com

Hi,


What are you looking for exactly ? Computing the distance on ground between two points, based on their geographical coordinates ?


If yes, this is not related to Django, nor to Python in any way. Google with keywords such as "geographic coordinates distance computation" and you'll get tons of hits, among which this one : https://en.wikipedia.org/wiki/Geographical_distance

Geographical distance is the distance measured along the surface of the earth.The formulae in this article calculate distances between points which are defined by geographical coordinates in terms of latitude and longitude.This distance is an element in solving the second (inverse) geodetic problem

Transcribing the formulas in Python is left as an exercise, since pretty trivial.


Best


Eric


From: django...@googlegroups.com <django...@googlegroups.com> on behalf of Dheeraj Kumar <tal...@gmail.com>
Sent: Sunday, December 9, 2018 2:52:37 PM
To: django...@googlegroups.com
Subject: Direction Distance measure in python code
 
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CANwUEV_m%2BaN3X%3Dr-Ltq2eKR7Yx%2BhA1gvv%3DtaazyvqRFLjUVEXQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

kennedy kay

unread,
Dec 9, 2018, 11:57:34 AM12/9/18
to django...@googlegroups.com

What I would do if I were you is separate this distance into longitude and latitude. I am sure you know what I mean by that then use a python library called ‘cartopy’.

You can pip install this package:

Pip install cartopy

OR

conda install -c conda-forge cartopy

 

There is another python library for visualizing coordinates on a map but I use cartopy.

Now this is what I do when I want to visualize the coordinates.

I need to provide a dataset containing longitudes and latitudes.

Then do this

 

 

plt.scatter(data.longitude.values, data.latitude.values)

ax = plt.axes(projection=ccrs.PlateCarree())

ax.stock_img()

 

plt.plot(data.longitude.values, data.latitude.values,

         color='blue', linewidth=1, marker='o',

         transform=ccrs.Geodetic())

 

 

I hope this helps.

Cheers!

 

Sent from Mail for Windows 10

 

From: PASCUAL Eric
Sent: Sunday, December 9, 2018 5:44 PM
To: django...@googlegroups.com
Subject: Re: Direction Distance measure in python code

 

Hi,

 

What are you looking for exactly ? Computing the distance on ground between two points, based on their geographical coordinates ?

 

If yes, this is not related to Django, nor to Python in any way. Google with keywords such as "geographic coordinates distance computation" and you'll get tons of hits, among which this one : https://en.wikipedia.org/wiki/Geographical_distance

https://upload.wikimedia.org/wikipedia/commons/4/4c/Azimutalprojektion-schief_kl-cropped.png

Geographical distance is the distance measured along the surface of the earth.The formulae in this article calculate distances between points which are defined by geographical coordinates in terms of latitude and longitude.This distance is an element in solving the second (inverse) geodetic problem

Transcribing the formulas in Python is left as an exercise, since pretty trivial.

 

Best

 

Eric

From: django...@googlegroups.com <django...@googlegroups.com> on behalf of Dheeraj Kumar <tal...@gmail.com>
Sent: Sunday, December 9, 2018 2:52:37 PM
To: django...@googlegroups.com
Subject: Direction Distance measure in python code

 

Hi can any one tell how can i get distance measure in direction wise

N3 W4 S8 E4 N5

here n is north, w is west , s is south , e is east , n is north

please tell python Django code

 

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CANwUEV_m%2BaN3X%3Dr-Ltq2eKR7Yx%2BhA1gvv%3DtaazyvqRFLjUVEXQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.

Reply all
Reply to author
Forward
0 new messages