I have to translate latitude and longitude coordinates on X, Y plan. I have decided to use UTM as projection system. I use this page ( http://www.uwgb.edu/dutchs/usefuldata/ConvertUTMNoOZ.HTM ) to test and quickly get result.
As test I wann plot on plan London and Rome. Rome has Latitude: 41.90 and Longitude: 12.48. London has Latitude: 51.50 and Longitude -0.12 expressed in degrees.
Using WGS84 and page reported first i've calculated Rome as Easting: 290965 and Northing: 4641744
London has Easting: 699889 and Northing: 5709362.
If I intend northing as the Y coordinate and easting as X coordinata Rome will be western than London and this is a huge mistake (don't you think?)
Where I wrong?
UTM is based on more than just easting and northing, there is also the base reference grid from which the E and N are measured. London and Rome are in different grids.
Related
triangulatePoints() method returns 4D coordinates as (X, Y, Z, W). Real object coordinates can be calculated as (X/W, Y/W, Z/W). I tried to plot points (chessboard corners) generated by this method before and after dividing by W. Interestingly, the correct location of points is only without dividing:
But these coordinates are not real (the real distance between adjacent corners is 1)
After dividing:
Definitely, there is something wrong
I think it can be caused by strange values of W:
[ 1.42646418e-03 1.22798549e-03 1.02968386e-03 8.39846092e-04
6.36201818e-04 4.52465261e-04 2.69547454e-04 8.46875409e-05
-9.68981258e-05 1.40832004e-03 1.21079874e-03 1.01654453e-03
8.17881722e-04 6.27299945e-04 4.34311369e-04 2.59211694e-04
8.54686004e-05 -8.65304610e-05 1.40546728e-03 1.20577158e-03
1.01246696e-03 8.14260624e-04 6.32434676e-04 4.47672734e-04
2.72056146e-04 9.63734783e-05 -8.87211063e-05 1.40579767e-03
1.20654306e-03 1.01806328e-03 8.29431403e-04 6.48407149e-04
4.67954233e-04 2.88052834e-04 1.05378487e-04 -8.11762657e-05
1.42593682e-03 1.23078423e-03 1.04424497e-03 8.57530802e-04
6.73743780e-04 4.87769896e-04 3.05575493e-04 1.14500137e-04
-7.35641006e-05 1.46166584e-03 1.27260783e-03 1.07531622e-03
8.86362221e-04 6.96056406e-04 5.09601785e-04 3.19138955e-04
1.36194620e-04 -5.99504456e-05]
I feel that these values should be almost the same, but they differ by more than 2 orders. Where is a mistake?
I have two models in my rails application: student and tutor. Each model has their own location attributes: latitude, longitude, radius(the radius is input by student/tutor since they decide how far they wanna meet to learn or teach). The latitude and longitude are decided by Google api, and I can get the distance between them with the API also.
Let call the distance between them is distance, r1 for the radius of the student, and r2 for the radius of the tutor.
Now my job is to match the student and tutor that can satisfy the condition r1 and r2. I've come up with the solution:
match tutor and student if distance - r1 - r2 <= 0
However, I am not sure about the accurate of my solution even though I think that algorithm covers all the cases:
Both circles have one common point.
Both circles have 2 common points.
One of the circles is inside of the other.
I think this is not a difficult problem, but I haven't touched geometry for a while since high school, so any advice here would be appreciated.
You also need the position x of both objects, not only the radii r.
Then both circles intersect when
dx = x1 - x2
dy = y1 - y2
dz = z1 - z2
sqrt(dx*dx + dy*dy + dz*dz) <= r1 + r2
The rest is simple.
I'm getting coordinates from GPS tracker as "Lat:40 54.1434" "Lon:29 13.0226", i would like to convert this coordinates for google maps javascript api as "lat : 40.90239, lon : 29.21704". I've searched on google and found formulas+convert tool websites, i tried to understand how they converted using JavaScript but i didn't understand. Is it possible to convert using Delphi XE7 ?
Thanks for advance.
Your GPS tracker is giving you coordinates in degrees + decimal minutes.
These are quite easy to convert to plain decimal degrees, as your Google Maps API requires, by taking the first part of the coordinate and adding on the second part divided by 60.
For example, to convert 40 54.1434 to plain decimal degrees, you split up the string into degrees = 40 and minutes = 54.1434, and then decimalDegrees = degrees + minutes / 60, which is 40 + 54.1434 / 60 = 40.90239.
I'm working on rasterisation of the GSHHS database basically converting shoreline polygons and river lines to raster.
http://www.soest.hawaii.edu/pwessel/gshhg/
The rivers and shores databases are two different files.
I noticed misalignment of hundreds of meters between rivers and shores at points where they are clearly should be aligned. One thing I noticed in the README is that the shorelines database uses WGS84 coordinates and river database was generated form other source using WGS 72. The difference should be in shift of prime meridian and difference in primary axis dimensions of the Earth.
I've searched over the internet about conversion between the two sets and couldn't found.
Answers I need:
How can I convert between them?
Or alternatively
How do I solve misalignment in GSHHS database?
Here are the formulas and parameters to transform WGS 72 coordinates to WGS 84 coordinates
FORMULAS
Δφ" = (4.5 cos φ) / (a sin 1") + (Δf sin 2φ) / (sin 1") (Unit = Arc Seconds)
Δλ" = 0.554 (Unit = Arc Seconds)
Δh = 4.5 sin φ + a Δf sin2 φ - Δa + Δr (Unit = Meters)
Δφ = Δφ" x 1" (Unit = radians)
Δλ = Δλ" x 1" (Unit = radians)
PARAMETERS
Δf = 0.3121057 x 10-7
a = 6378135 m
Δa = 2.0 m
Δr = 1.4 m
1" = pi / (3600.0 * 180.0) rad
To obtain WGS 84 coordinates, add the Δφ, Δλ, Δh changes calculated using WGS 72 coordinates to the WGS 72 coordinates (φ, λ, h, respectively). Latitude is positive north and longitude is positive east (0° to 180°).
RESULT
φ WGS84 = φ + Δφ
λ WGS84 = λ + Δλ
h WGS84 = h + Δh
Documentation [p105-106]
You can use proj4:https://trac.osgeo.org/proj/wiki/man_proj. There are many ellipsoid identifiers supported. You can get a list with the -le option switch. To convert from wgs74 you can use the "towgs84" option switch.
One authoritative source is the National Geospatial Intelligence Agency (NGA). They publish open source, the Geotrans program at http://earth-info.nga.mil/GandG/geotrans/. This gives GUI, batch processing. I expect internally there is an API you could call as a developer.
I have a series of Lat/Long coords. I need to transform it in X, Y coordinates. I've read about UTM, but the problem is that UTM coordinates are relatives to a single zone.
For example, this two coordinates UTM has the same Easting (x) and Northing (y) but different code zone, and so each coords point to a completly different location (one in spain and one in italy):
UTM: 33T 292625m E 4641696m N
UTM: 30U 292625m E 4641696m N
I need a method to automatically transform that relatives coord in absolute X, Y coordinates. Ideas?
Does it have to be UTM? If not, you can also use Mercator, which is a simpler projection that doesn't rely on zones.
See, for example, the Bing Maps system.
You should be able to use the ProjNET library.
What you need is to find the WKT (well known text) that defines your projections, and then you should be able to convert between them.
var utm33NCoordinateSystem = CoordinateSystemWktReader.Parse("WKT for correct utm zone") as IProjectedCoordinateSystem;
var wgs84CoordiateSystem = CoordinateSystemWktReader.Parse(MappingTransforms.WGS84) as IGeographicCoordinateSystem;
var ctfac = new CoordinateTransformationFactory();
_etrsToWgsTransformation = ctfac.CreateFromCoordinateSystems(etrs89CoordinateSystem,wgs84CoordiateSystem);
double[] transform = _etrsToWgsTransformation.MathTransform.Transform(new double[] { y,x });
Note: you have to find the correct WKTs, but that can be found on the project site.
Also you may have to flip the order of the inputs, depending on the transforms.
if we want to correct bearing & Distance in between two points than we use (Polar) method by using Scientific Calculator first of all Press The Button polar than started bracket first
For the Distance POL(N-N,E-E)
For the Bearing POL(N-N,E-E)RclTan-1
Now you have got a Correct bearing