ee.Geometry.MultiLineString.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 |
---|
MultiLineString.edgesAreGeodesics() | Boolean |
Argument | Type | Details |
---|
this: geometry | Geometry | |
Examples
// Define a MultiLineString object.
var multiLineString = ee.Geometry.MultiLineString(
[[[-122.088, 37.418], [-122.086, 37.422], [-122.082, 37.418]],
[[-122.087, 37.416], [-122.083, 37.416], [-122.082, 37.419]]]);
// Apply the edgesAreGeodesics method to the MultiLineString object.
var multiLineStringEdgesAreGeodesics = multiLineString.edgesAreGeodesics();
// Print the result to the console.
print('multiLineString.edgesAreGeodesics(...) =', multiLineStringEdgesAreGeodesics);
// Display relevant geometries on the map.
Map.setCenter(-122.085, 37.422, 15);
Map.addLayer(multiLineString,
{'color': 'black'},
'Geometry [black]: multiLineString');
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 MultiLineString object.
multilinestring = ee.Geometry.MultiLineString([
[[-122.088, 37.418], [-122.086, 37.422], [-122.082, 37.418]],
[[-122.087, 37.416], [-122.083, 37.416], [-122.082, 37.419]],
])
# Apply the edgesAreGeodesics method to the MultiLineString object.
multilinestring_edges_are_geodesics = multilinestring.edgesAreGeodesics()
# Print the result.
display(
'multilinestring.edgesAreGeodesics(...) =',
multilinestring_edges_are_geodesics,
)
# Display relevant geometries on the map.
m = geemap.Map()
m.set_center(-122.085, 37.422, 15)
m.add_layer(
multilinestring, {'color': 'black'}, 'Geometry [black]: multilinestring'
)
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 used to determine if the edges of a MultiLineString geometry are treated as geodesics (curved along the Earth's surface) or straight lines in the projection."],["It returns `true` if the edges are geodesics and `false` if they are straight lines."],["The method is applied to a MultiLineString geometry object and takes no arguments."],["This function is useful for controlling how lines are displayed and analyzed in Earth Engine, especially when dealing with large distances or areas."]]],["The `edgesAreGeodesics()` method checks if a geometry's edges are geodesics on a spherical Earth model. It takes a geometry as input and returns a boolean value. `True` indicates geodesic edges, while `false` means straight lines in the projection. The examples show how to apply this method to a `MultiLineString` object in both JavaScript and Python, printing the boolean result and visualizing the geometry on a map.\n"]]