Geographic Information Systems Asked by curious kid on March 5, 2021
I need to figure out how to convert my X/Y-coordinates to longitude and latitude.
I do not need the exact conversion, just an approximate so I can plot it in a mapping API. I managed to estimate the following X/Y to Long/Lat:
(x, y) = 24050, 123783.3333 -> (long, lat) = (122.98, 24.46)
(x, y) = 24216.6667, 123933.3333 -> (long, lat) = (122.985339,
24.46041)
Can I somehow use these to come up with a formula to convert the other X/Y points?
I found another link that does what I want, but I cannot extract the formula: http://www.whoi.edu/marine/ndsf/cgi-bin/NDSFutility.cgi?form=0&from=XY&to=LatLon
In the above link, I specify the origin of X/Y in Lat/Long coordinates, and it was able to convert X/Y to Lat/Lang.
It is complex, due to curvature of the earth effects and where on Earth you are.
I would recommend reading this page:
http://www.geosci.usyd.edu.au/users/prey/Teaching/Geos-2111GIS/Practicals/UTMConvDutch.xls
If you can replicate what the spreadsheet is doing in your API, you'll have your answer.
Exactly how you do that depends on the language you're using, and I presume you've got the programming skill to do that part.
Answered by Sir Adelaide on March 5, 2021
//Sample "convert xy to latlong" by pod ArcGis:
for item in (GeometryDataXYValue)!{
let xValue = item.paths?.ofX
let yValue = item.paths?.ofY
//recieve x y point
currentPoint = AGSPoint(x: xValue!, y: yValue!, spatialReference: AGSSpatialReference.webMercator())
//convert to lat long by AGSSpatialReference.wgs84()
if let aReference = AGSGeometryEngine.projectGeometry(currentPoint!, to: AGSSpatialReference.wgs84()) as? AGSPoint {
currentPoint = aReference
}
}
var long:Double = currentPoint!.x
var lat: Double = currentPoint!.y
print("value long lat = (long , lat)")
}
Answered by Papon Smc on March 5, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP