I append a collada file into the plug-in, and then move it (append.Child, then remove.Child, then append.Child, etc) based on very small Latitude and Longitude increments. When the Latitude increment = Longitude increment, however, the file moves in a rectangular fashion and NOT a square fashion. What am I doing wrong? Shouldn't the "path" which the collada file travels be "square"?
The increment in both directions (lat or long) is the same increment (0.00001499817). In trying to figure this out, I also noticed that the "circle" polygon code also shows up as an oval unless you place it along the equator.
Should I be assuming that a latitude increment EQUALS a longitude increment in Earth???
Anybody know what might be going on? Thanks. Paul
Should I be assuming that a latitude increment EQUALS a longitude
increment in Earth???
Do you assume the Earth is a perfect sphere?
Do you assume that latitude and longitude lines are evenly spaced out?
To quote someone else from a quick google search
Longitude is the east-west (right/left) measurement on a map. It goes
from 180 degrees west to 0 (through Greenwich, London, UK) then to
180 degrees East. 180 degrees West or East is actually the same line
- its in the middle of the Pacific ocean.
There are thus 360 lines of integer Longitude.
Latitude goes from the Equator - 0 degrees, North to the North Pole at
90 degrees north. Or south to the South Pole at 90 degrees south.
There are thus 180 lines of integer latitude.
Technically, you'd have to say that the number of possible lines is
actually infinite. Since between any two lines you choose, no matter
how close together they are, you can always fit a bunch more in
between them.
Related
I am using VB.NET and want to calculate the Longitude and Latitude of a point directly EAST of a given point when given a distance of kilometers.
In this example, Point 1 has the longitude of -118.243683 and Latitude of 34.052235. I know that the distance between these two points are exactly 30 kilometers. How do I find the exact Longitude and Latitude of the second point? I know that is is possible to find the distance between two points but I do not know how to find the longitude and latitude of a second point when given a first point and a relative distance (in kilometers) away is 30.
Assuming that the angle is zero degrees between the two points, how do I find the point (in Longitude and Latitude) of the second point?
I have over 350,000 pairs of latitude and longitude decimal values. These pairs represent locations in the US. These data give me fairly precise data, but I don't need to be this precise.
I'm looking for recommendations on how to round these values so that I can reduce my locations from 350,000 to something smaller.
Rounding both values to the nearest hundredth produces 138k pairs.
Rounding both values to the nearest thousandth produces 320k pairs.
If rounding to the 2nd decimal, I fear that I'm reaching out too far. If rounding to the 3rd decimal, I feel like I still have too many pairs. Ideally, I would like to be within perhaps 400 to 600 meters of the actual lat/lon. I suppose rounding to the 3rd decimal is indeed approaching that desired area, but slightly on the strict side.
Has anyone tried this, and maybe taken the approach of rounding latitude to the 2nd decimal and longitude to the 3rd decimal? Would you recommend one over the other? Again, most data in the continental US, with some in Alaska and Hawaii.
Keeping the precision in your latitude values is more helpful than the precision in longitude. At the equator the precision (in degrees) comes out to the same, but as you move north or south from there, the distance in a degree longitude becomes less and less.
If you really need within the 500 meters, and you assume your rounding of each location has equal loss of distance, you can round each value by 354 meters. (That is you target rounding each an equal distance on average.)
354 meters is about 0.0033 degrees of latitude anywhere in the world. (There's less than a percent of variance in this depending on location.)
But longitude changes size much more dramatically:
In northern Alaska, at a latitude of 70 degrees N, 354 meters comes close to 0.01 degrees longitude, but in Hawaii, the same distance east-west equals 0.0033 degrees.
Instead of just rounding, could you group to nearest even thousandth for latitude? For longitude, group to nearest hundredth if latitude is greater than 50 group to nearest even thousandth otherwise.
Might be a pain to explain to people, but not too painful to code, I think.
I am using the Microsoft.SqlServer.Types DLL in my projects for validating Latitudes and Longitudes.
The Library validates longitude values between -15069 and 15069 degrees instead from -180 to 180.
Can anybody explain what is the significance or reason that Microsoft is checking the longitude values to be between -15069 and 15069 degrees?
Microsoft has listed the standards for Geo Spatial standards on this website which mentions the Longitude values MUST be between -15069 and 15069 degrees, inclusive.
https://msdn.microsoft.com/en-us/library/ee301753(v=sql.105).aspx
Your inputs in understanding this concept will be appreciated!
Why is longitude not restricted to [-180°..+180°]?
Here's a brief thought experiment.
Which of the following three lines does LINESTRING (-180 0, 180 0) represent?
A line going around the whole globe along the equator in an eastward direction.
A line going around the whole globe along the equator in a westward direction.
A line of length 0, since -180° latitude denotes the same meridian as +180° latitude.
As soon as you decide on any of the three possibilities, you will find that you have no way of modelling the other two cases as LINESTRING (try it!)… at least not when you restrict longitude to the (geographically correct) interval [-180°..+180°]!
Let's see what happens when we relax that restriction:
The line going around the globe in an eastward direction can now be modelled as LINESTRING (-180 0, 180 0). (This seems to match our expectations, since increasing degrees of longitude means "going eastward".)
The line going around the globe in a westward direction now becomes LINESTRING (-180 0, -540 0). (Decreasing degrees of longitude denotes "going westward".)
The line of length 0 becomes LINESTRING (-180 0, -180 0). (No change in coordinates means "no distance travelled".)
Yes, but why did they chose exactly ±15069 degrees?
That, I cannot say. It might have to do with floating-point precision (i.e. spatial computations becoming too imprecise if you specified a point that's "wrapped around" the globe more than 15,069° ÷ 360° = 41,8583… times) or simply a arbitrary limit (i.e. they thought noone will need to be able to construct a spiral that goes around the globe more than approx. 42 times).
Why was latitude restricted to [-90°..+90°], if longitude wasn't restricted?
Let's repeat the above thought experiment: What does LINESTRING (0 90, 0 -90) mean?
A line going around half the globe along the prime meridian in a southward direction.
A line going around half the globe along the prime meridian in a northward direction.
A line of length 0.
We can rule out (3), since POINT (0 90) and POINT (0 -90) are distinct points: namely, the north pole and the south pole. A line going from one to the other definitely does not have zero length.
We can also rule out (2), simply because it does not make any sense to say "going northward" when starting at the north pole. You can only stay there, or go south, which is already covered by (1).
So we end up unambiguously with (1). The reason, therefore, why latitude was restricted to the geographically meaningful [-90°..+90°] is because there is never any ambiguity when modelling lines that touch or cross the geographic poles. This is because there are no sudden degree "jumps" like there are with longitude (where one and the same meridian is described both by -180° and +180°).
Path image
I need to calculate distance from subscriber position to Position B in the image. I have the GPS co-ordinate of the subscriber and the "B" position. How can I calculate the distance?
Simple case: Express lat and long values in decimal form and use the standard geometry distance formula if subscriber is less than 100 miles from position B. distance = sqrt((lat1-lat2)^2 - (long1-long2)^2).
More general case: Use the haversine formulas using a great circle to calculate distances from points on a sphere for more accurate measurements if position B might be a continent or two away from the subscriber. Let's call the subscriber position A and say and say he is at lat[a], long[a] and the fixed point B is at lat[b], long[b]. Let r represent the radius of the earth (about 3961 miles).
distance = 2*r*arcsin(sqrt(sin^2((lat[b]-lat[a])/2) + cos(lat[a])*cos(lat[b])*sin^2((long[b]-long[a])/2)))
If you specify r in miles, your answer will come out in miles. If you use kilometers use 6373 for a good number for the earth's radius, and of course the answer will come out in kilometers.
Exact case: The haversine formula will not provide a perfect answer because the earth is not a perfect sphere. Even apart from the mountains and the canyons, the earth has a larger radius at the equator than it does at the poles. The radius at the equator is the equator is about 3963 miles, and at the poles it is about 3950 miles. So you really need to devise your own lookup table (or borrow one from google maps) if you are measuring distances halfway around the globe and you have to be exact.
The haversine formula will be accurate to less than half of a percentage point. In 1000 miles your answer will be accurate to within 5 miles.
Haversine formula: https://en.wikipedia.org/wiki/Haversine_formula
Radius of the earth: https://en.wikipedia.org/wiki/Earth_radius
Does the span for MKCoordinateRegion represent the distance from the center to each boundary or the distance from boundary to boundary?
If I want to calculate the boundaries of the region to I add/subtract the span from the center or do I need to /2?
lowerLatitude=center-span.latitudeDelta
or
lowerLatitude=center-(span.latitudeDelta/2)
Running this code:
self.mapView.region = MKCoordinateRegionMake(CLLocationCoordinate2DMake(0.0, 0.0), MKCoordinateSpanMake(23.5, 10.0));
I was able to see as far north as the border of the Western Sahara, and as far south as the Etosha National Park; as far west as the west cosast of Senegal; and as far east as N'Djamena.
Based on that, and a little time with Google Maps, it appears that the span is a total of 47 degrees north-south, and 20 degrees west-east.
The span is the distance from boundary to boundary. If the most Westerly place you can see is at 10 degrees and the most Eastery is 20 degrees, the longitudeDelta will be 10 degrees (span). The center coordinate will have a longitude of 15 degrees (a point, not a span).
To put it another way, the span is twice the distance from the center to the edge. The center is the point half way along both spans.