# Draw polygons in meters

Is it possible to draw a polygon on the surface of the globe in terms of meters?

In particular, I would like to specify a center point in lat/lon and then from there, draw lines that are X meters long (or equivalently, at location x,y meters from center? I suppose what I need is to be able to add meters to a lat/lon point?

For now perhaps you could convert meters to cartographic using this calculator:

http://www.movable-type.co.uk/scripts/latlong.html

Scroll down to

Destination point given distance and bearing from start point
(You don’t have to enter minutes/seconds format, it also accepts decimal format, but it’s lat/lon order)

(click the show map, it updates as you put in new values.)

It also list the formula in JavaScript if you wanted to calculate from within your program.

Thanks. I guess I was hoping that I was missing a way built into to Cesium for doing this. (Drawing in meters but having it project onto the ellipsoid). Can anyone confirm if I'll need to do this manually?

Depending on your latitude, things near the poles may be an issue, you may be able to use WebMercatorProjection

http://cesiumjs.org/Cesium/Build/Documentation/WebMercatorProjection.html

use ‘project’ to go from a cartographic to a xyz for your calcs

then unproject to get back to cartographics

So you're saying?

- Project from cartographic to cartesian3
- Do calculation to offset in meters
- Project back to cartographic

If I understand correctly, isn't the Cartesian3 point in the ECEF frame? This would make it difficult to move the point to, say, for example, 5 meters east.

The formula from movable-type is along a great circle, and should be unaffected at the poles.

Type in 89 lat, 0 lon, 0 bearing, 200 kilo-meters

You’ll get 89°12′05″N, 180°00′00″W, from prime to anti meridian.

You’ll get non-sense lines if you click on view map though, Google Maps doesn’t handle high latitude properly.

Straight lines on Mercator are rhumblines (constant bearing) on a globe, not great circles (constant direction.) Constant bearing != constant direction. If you walk with constant direction around the world you’ll end up where you started. If you walk around the world with constant bearing you’ll only end up where you started if you walked due east,west,north, or south.

On that website try 0 lat 0 lon 55 bearing, 99999 km and click view map. You’ll see a curved path.

Mercator

-great circles are curved

-rhumblines are straight lines

Globe

-great circles are circles (appear as straight lines if camera direction vector is co-planar with the circle)

-meridians are great circles and rhumblines

-lines of latitude are not so great circles (except the Equator)

-other rhumblines are spirals if not north,south,east, or west

Don't know about the software, but "Bearing" allows you to do so. Starting at a given point and an angle, you set the distance to draw (or walk, run, drive) and the result is the new cartographic point of destination. Check:
http://www.movable-type.co.uk/scripts/latlong.html

Hope it helps

Hi there,

EllipsoidGeodesic will be useful for this issue. Given two points defining a line on the ellipsoid surface, you can compute a position X meters along the line from the start point.

Hope that helps,

• Rachel