Latitude+Longitude to East+North

What is the easiest way to convert from lat/long to east/north coordinates?

Background

I want to arrange a number of objects in a pattern. I know how to generate the positions in a 2d cartesian coordinate system but not in lat/long or ECEF. These positions are within 100 meters of each other and don’t need super high accuracy so I am ok with any distortions that come from assuming a flat plane.

What I know

I know how to convert between lat/long and ECEF.

I have found Transforms.eastNorthUpToFixedFrame to convert from the the local 2d east north coordinate system to ECEF.

What I don’t know

I have not seen a method for tranforming from ECEF to the east north. Will the Matrix4 from Transforms.eastNorthUpToFixedFrame always be invertible or do I need to compute the transform another way?

Do I need to go lat/long -> ECEF -> east/north or is there a way to go directly between east/north and lat/long?

Thanks!

Anytime you’re looking to offset something in meters, you’re going to want to work with Cartesian3 coordinates. If you want to find a position that is roughly X meters north and Y meters east of a known position, you would accomplish this by adding a vector that point north with a magnitude of X and a vector that points east with a magnitude of Y to your position.

Here is a sandcastle example that shows how to compute the north and east vectors for any position: Sandcastle

Transforms.eastNorthUPToFixedFrame creates a transformation matrix that takes positions in a local coordinate system and positions them onto the ellipsoid surface such that the x/y/z axes of the local coordinate system are now positioned east/north/up in the ECEF coordinate system. That particular function isn’t applicable to the problem you’re trying to solve.

1 Like

Thanks Hannah. She pointed out offline that what I was looking for to go between 3d ECEF and a 2d coordinate system was EllipsoidTangentPlane.

1 Like