ee.Geometry.MultiPoint.getInfo

  • MultiPoint.getInfo() retrieves the value of a MultiPoint object from the server and returns it as a GeoJSON object.

  • Requests can be made synchronously (blocking) or asynchronously (non-blocking) with a callback function, the asynchronous method being preferred for better performance.

  • evaluate() is recommended over getInfo() when making asynchronous requests to avoid blocking the user interface.

  • This method is useful for retrieving the coordinates of a MultiPoint object and using it for further analysis or visualization.

Retrieves the value of this object from the server.

If no callback function is provided, the request is made synchronously. If a callback is provided, the request is made asynchronously.

The asynchronous mode is preferred because the synchronous mode stops all other code (for example, the EE Code Editor UI) while waiting for the server. To make an asynchronous request, evaluate() is preferred over getInfo().

Returns the computed value of this object.

UsageReturns
MultiPoint.getInfo(callback)Object
ArgumentTypeDetails
this: computedobjectComputedObjectThe ComputedObject instance.
callbackFunction, optionalAn optional callback. If not supplied, the call is made synchronously.

Examples

Code Editor (JavaScript)

// Define a MultiPoint object.
var multiPoint = ee.Geometry.MultiPoint([[-122.082, 37.420], [-122.081, 37.426]]);

// Apply the getInfo method to the MultiPoint object.
var multiPointGetInfo = multiPoint.getInfo();

// Print the result to the console.
print('multiPoint.getInfo(...) =', multiPointGetInfo);

// Display relevant geometries on the map.
Map.setCenter(-122.085, 37.422, 15);
Map.addLayer(multiPoint,
             {'color': 'black'},
             'Geometry [black]: multiPoint');

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

Colab (Python)

# Define a MultiPoint object.
multipoint = ee.Geometry.MultiPoint([[-122.082, 37.420], [-122.081, 37.426]])

# Apply the getInfo method to the MultiPoint object.
multipoint_get_info = multipoint.getInfo()

# Print the result.
display('multipoint.getInfo(...) =', multipoint_get_info)

# Display relevant geometries on the map.
m = geemap.Map()
m.set_center(-122.085, 37.422, 15)
m.add_layer(multipoint, {'color': 'black'}, 'Geometry [black]: multipoint')
m