ee.Geometry.MultiPoint.serialize
Returns the serialized representation of this object.
Usage | Returns |
---|
MultiPoint.serialize(legacy) | String |
Argument | Type | Details |
---|
this: geometry | Geometry | The Geometry instance. |
legacy | Boolean, optional | Enables legacy format. |
Examples
// Define a MultiPoint object.
var multiPoint = ee.Geometry.MultiPoint([[-122.082, 37.420], [-122.081, 37.426]]);
// Apply the serialize method to the MultiPoint object.
var multiPointSerialize = multiPoint.serialize();
// Print the result to the console.
print('multiPoint.serialize(...) =', multiPointSerialize);
// 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
# Define a MultiPoint object.
multipoint = ee.Geometry.MultiPoint([[-122.082, 37.420], [-122.081, 37.426]])
# Apply the serialize method to the MultiPoint object.
multipoint_serialize = multipoint.serialize()
# Print the result.
display('multipoint.serialize(...) =', multipoint_serialize)
# 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
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."],[[["Returns the serialized representation (string format) of a given MultiPoint Geometry object."],["Accepts an optional 'legacy' boolean argument to enable legacy formatting."],["Provides usage examples in JavaScript, Python, and Colab environments for demonstrating the method's application."],["Illustrates the practical use of `serialize` by displaying results on a map and in the console."]]],["The `serialize()` method transforms a Geometry object into its serialized string representation. The method, applied to a Geometry instance (like `MultiPoint`), can optionally use a `legacy` format. The examples demonstrate creating a `MultiPoint` object and serializing it. The serialized string is then printed. In both JavaScript and Python, the example code displays the `MultiPoint` geometry on a map for visualization, centered at specific coordinates.\n"]]