ee.Geometry.Polygon.edgesAreGeodesics
Returns true if the geometry edges, if any, are geodesics along a spherical model of the earth; if false, any edges are straight lines in the projection.
Usage | Returns |
---|
Polygon.edgesAreGeodesics() | Boolean |
Argument | Type | Details |
---|
this: geometry | Geometry | |
Examples
// Define a Polygon object.
var polygon = ee.Geometry.Polygon(
[[[-122.092, 37.424],
[-122.086, 37.418],
[-122.079, 37.425],
[-122.085, 37.423]]]);
// Apply the edgesAreGeodesics method to the Polygon object.
var polygonEdgesAreGeodesics = polygon.edgesAreGeodesics();
// Print the result to the console.
print('polygon.edgesAreGeodesics(...) =', polygonEdgesAreGeodesics);
// Display relevant geometries on the map.
Map.setCenter(-122.085, 37.422, 15);
Map.addLayer(polygon,
{'color': 'black'},
'Geometry [black]: polygon');
Python setup
See the
Python Environment page for information on the Python API and using
geemap
for interactive development.
import ee
import geemap.core as geemap
# Define a Polygon object.
polygon = ee.Geometry.Polygon([[
[-122.092, 37.424],
[-122.086, 37.418],
[-122.079, 37.425],
[-122.085, 37.423],
]])
# Apply the edgesAreGeodesics method to the Polygon object.
polygon_edges_are_geodesics = polygon.edgesAreGeodesics()
# Print the result.
display('polygon.edgesAreGeodesics(...) =', polygon_edges_are_geodesics)
# Display relevant geometries on the map.
m = geemap.Map()
m.set_center(-122.085, 37.422, 15)
m.add_layer(polygon, {'color': 'black'}, 'Geometry [black]: polygon')
m
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2023-10-06 UTC.
[null,null,["Last updated 2023-10-06 UTC."],[[["`edgesAreGeodesics()` is a method that determines if the edges of a geometry are treated as geodesics (curved lines following the Earth's curvature) or straight lines in the projection."],["This method returns `true` if the edges are geodesics and `false` if they are straight lines."],["It can be applied to `Geometry` objects, such as Polygons, to understand how their edges are interpreted in Earth Engine's computations."],["The method takes no arguments other than the geometry object itself."]]],["The `edgesAreGeodesics()` method, applied to a geometry object, determines if its edges follow geodesics on a spherical Earth model. It returns a Boolean value: `true` indicates geodesic edges, while `false` means edges are straight lines in the projection. The method is used on geometry objects, including polygons, and no additional parameters are needed. The example code demonstrates applying `edgesAreGeodesics()` to a polygon and printing the Boolean result.\n"]]