Hi,
I have a lot of panoramic images which are assigned to coordinates, do you have any suggestion/advise how can i calculate the arrow direction to enable to go the next panorama?
Thanks in advance!
Hi,
I have a lot of panoramic images which are assigned to coordinates, do you have any suggestion/advise how can i calculate the arrow direction to enable to go the next panorama?
Thanks in advance!
you need to know the y distans (long1 - long2) and the distance(lat1 - lat2) and then perform a tanges to know the angle between these points.
Alsoo this is a good site: http://www.movable-type.co.uk/scripts/latlong.html
search for bearing.
Hi,
Thanks for answer! I have also tried some ways (postgis, bearing calculation) but i dont know how can i show this result as arrow in krpano (ath/atv or rotate)?
best regards
Gülsün
Hi.
I have KRpano plugin who automatically calculates the distance between two markers.
example no javascript
The result given in kilometers in miles.
pietero
edit:
I used this formula.
ACOS(SIN(lat1)*SIN(lat2)+COS(lat1)*COS(lat2)*COS(lon2-lon1))*6371
Hi spacerywirtualne,
Your plugin is not for download or? Anyway i need a solution to show my arrow direction in krpano automatically. Is there any way to draw a line between two lat/lon(maybe it is a solution)? Or bearing is really for me a solution?
Is there nobody who really worked with lat/lon?
Thanks in advance!
once you have the bearing, you can make a arrow hotspot pointing up, you then can use ath for the bearing (north being at 0)
Hi Zephyr,
Thanks for answer! What do you exactly mean with (north being at 0)?
My Problem is;
if my way horizantal like this bearing from X to x2 => 90 and from X to x3 => 270. I see my arrow in left and right not in front of my car. (my arrow in the wrong place)
--------------------------------------------
x1 X x2
--------------------------------------------
if my way; X to X1 => 0 and X to X2 => 180. And my arrow in the right place, in front or back of my car.
| x1 |
| |
| X |
| |
| x2 |
| |
Do you have any advice? Thanks a lot!
Gülsün
My code calculating bearing in java
double dLon = Math.toRadians(Double.valueOf(point2.getLon())-Double.valueOf(point1.getLon()));
double y = Math.sin(dLon) * Math.cos(Double.valueOf(point2.getLat()));
double x = Math.cos(Double.valueOf(point1.getLat()))*Math.sin(Double.valueOf(point2.getLat())) -
Math.sin(Double.valueOf(point1.getLat()))*Math.cos(Double.valueOf(point2.getLat()))*Math.cos(Double.valueOf(dLon));
double brng = Math.atan2(y, x);
return (Math.toDegrees(brng));
with north = 0, I mean that you should align your panorama so, that the center of the image is your north bearing (so in krpano ath = 0 = north)
see attachmebnt for image
Hi Zephyr,
Firstly thanks for answer but i cannot understand exactly, what do you mean?
I have to change my latitude and longitude for aliging to north 0? Because i tried your formula but it does not work for me. Or i have to calculate bearing of my lat/lon to north.
best regards
Gülsün
A panorama is just an image. YOU have to say, my car is north or northwest. Else you can just put your panorama upside down and make it black :P Only then you can start putting hotspots down on base of long/lat.
Thanks for answer :) i unterstand now :)
with north = 0, I mean that you should align your panorama so, that the center of the image is your north bearing (so in krpano ath = 0 = north)
Hello, I have the problem of having two panoramas wich are not align to same 'north', meaning, the ath = 0 is looking at different directions in both panos. this is a problem when going from one pano to the next, since they are no aligned to eacht other.
how can i correct this? some correction factor, so ath=0 is lookint at the real north in both panoramas.
thanks
Best way is photoshop. But krpano provides a parameter to adjust the rotation:
https://krpano.com/docu/xml/#image.prealign
Don’t have an account yet? Register yourself now and be a part of our community!