[Proj] How can I convert between cartesian space and WGS84?
David Grundberg
david.grundberg at oryx.se
Thu Oct 19 01:26:48 PDT 2017
Hello,
I'd like to have a cartesian space, ideally in meters, axis-aligned with
north/east/up, centered on a WGS84 position, so that I can transform
between this cartesian space and WGS84 coordinates. I attempted to make
a Mercator projection but quickly ran into problems. Just to illustrate,
I tested with geocentric projection and known coordinates.
I tested it with coordinates for a track and it should be 100 meters
between the points.
<https://kartor.eniro.se/?c=63.821347,20.321247&z=18&l=aerial&d={%22l%22:[[63.821477,20.321209,63.820758,20.322454,null,0]]}>
or https://tinyurl.com/ybcxe3sb
$ printf "63.821477N 20.321209E\n63.820758N 20.322454E" | cs2cs -v
+proj=latlong +ellps=WGS84 +datum=WGS84 +no_defs +to +proj=geocent
+datum=WGS84 +to_meters
# ---- From Coordinate System ----
#Lat/long (Geodetic alias)
#
# +proj=latlong +ellps=WGS84 +datum=WGS84 +no_defs +towgs84=0,0,0
#--- following specified but NOT used
# +ellps=WGS84
# ---- To Coordinate System ----
#Geocentric
#
# +proj=geocent +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0
#--- following specified but NOT used
# +to_meters
2639773.20 5369807.65 2201077.86
2639819.46 5369731.56 2201207.11
$ octave
octave:1> norm([2639773.20 5369807.65 2201077.86] - [2639819.46
5369731.56 2201207.11])
ans = 156.96 # Should be about 100.7 meters!
octave:2>
$
Any advice appreciated!
David
More information about the Proj
mailing list