From 2ec9a268e70de99df3e149a8e4dddb1a8aed994d Mon Sep 17 00:00:00 2001 From: Justin Braaten Date: Wed, 6 Sep 2023 14:15:27 -0700 Subject: [PATCH] Convert Geometry.MultiLineString API code snippets from JS to Py PiperOrigin-RevId: 563213100 --- .../ee_geometry_multilinestring_area.py | 35 +++++++++++++ .../ee_geometry_multilinestring_bounds.py | 40 +++++++++++++++ .../ee_geometry_multilinestring_buffer.py | 40 +++++++++++++++ .../ee_geometry_multilinestring_centroid.py | 40 +++++++++++++++ ...ee_geometry_multilinestring_containedin.py | 41 ++++++++++++++++ .../ee_geometry_multilinestring_contains.py | 41 ++++++++++++++++ .../ee_geometry_multilinestring_convexhull.py | 40 +++++++++++++++ ...ee_geometry_multilinestring_coordinates.py | 35 +++++++++++++ .../ee_geometry_multilinestring_cutlines.py | 42 ++++++++++++++++ .../ee_geometry_multilinestring_difference.py | 46 +++++++++++++++++ .../ee_geometry_multilinestring_disjoint.py | 41 ++++++++++++++++ .../ee_geometry_multilinestring_dissolve.py | 40 +++++++++++++++ .../ee_geometry_multilinestring_distance.py | 41 ++++++++++++++++ ...metry_multilinestring_edgesaregeodesics.py | 38 ++++++++++++++ .../ee_geometry_multilinestring_geodesic.py | 35 +++++++++++++ .../ee_geometry_multilinestring_geometries.py | 35 +++++++++++++ .../ee_geometry_multilinestring_getinfo.py | 35 +++++++++++++ ...e_geometry_multilinestring_intersection.py | 46 +++++++++++++++++ .../ee_geometry_multilinestring_intersects.py | 41 ++++++++++++++++ ...ee_geometry_multilinestring_isunbounded.py | 35 +++++++++++++ .../ee_geometry_multilinestring_length.py | 35 +++++++++++++ .../ee_geometry_multilinestring_perimeter.py | 35 +++++++++++++ .../ee_geometry_multilinestring_projection.py | 35 +++++++++++++ .../ee_geometry_multilinestring_serialize.py | 35 +++++++++++++ .../ee_geometry_multilinestring_simplify.py | 40 +++++++++++++++ ...try_multilinestring_symmetricdifference.py | 49 +++++++++++++++++++ .../ee_geometry_multilinestring_togeojson.py | 35 +++++++++++++ ...eometry_multilinestring_togeojsonstring.py | 37 ++++++++++++++ .../ee_geometry_multilinestring_type.py | 35 +++++++++++++ .../ee_geometry_multilinestring_union.py | 44 +++++++++++++++++ ...geometry_multilinestring_withindistance.py | 43 ++++++++++++++++ 31 files changed, 1210 insertions(+) create mode 100644 samples/python/apidocs/ee_geometry_multilinestring_area.py create mode 100644 samples/python/apidocs/ee_geometry_multilinestring_bounds.py create mode 100644 samples/python/apidocs/ee_geometry_multilinestring_buffer.py create mode 100644 samples/python/apidocs/ee_geometry_multilinestring_centroid.py create mode 100644 samples/python/apidocs/ee_geometry_multilinestring_containedin.py create mode 100644 samples/python/apidocs/ee_geometry_multilinestring_contains.py create mode 100644 samples/python/apidocs/ee_geometry_multilinestring_convexhull.py create mode 100644 samples/python/apidocs/ee_geometry_multilinestring_coordinates.py create mode 100644 samples/python/apidocs/ee_geometry_multilinestring_cutlines.py create mode 100644 samples/python/apidocs/ee_geometry_multilinestring_difference.py create mode 100644 samples/python/apidocs/ee_geometry_multilinestring_disjoint.py create mode 100644 samples/python/apidocs/ee_geometry_multilinestring_dissolve.py create mode 100644 samples/python/apidocs/ee_geometry_multilinestring_distance.py create mode 100644 samples/python/apidocs/ee_geometry_multilinestring_edgesaregeodesics.py create mode 100644 samples/python/apidocs/ee_geometry_multilinestring_geodesic.py create mode 100644 samples/python/apidocs/ee_geometry_multilinestring_geometries.py create mode 100644 samples/python/apidocs/ee_geometry_multilinestring_getinfo.py create mode 100644 samples/python/apidocs/ee_geometry_multilinestring_intersection.py create mode 100644 samples/python/apidocs/ee_geometry_multilinestring_intersects.py create mode 100644 samples/python/apidocs/ee_geometry_multilinestring_isunbounded.py create mode 100644 samples/python/apidocs/ee_geometry_multilinestring_length.py create mode 100644 samples/python/apidocs/ee_geometry_multilinestring_perimeter.py create mode 100644 samples/python/apidocs/ee_geometry_multilinestring_projection.py create mode 100644 samples/python/apidocs/ee_geometry_multilinestring_serialize.py create mode 100644 samples/python/apidocs/ee_geometry_multilinestring_simplify.py create mode 100644 samples/python/apidocs/ee_geometry_multilinestring_symmetricdifference.py create mode 100644 samples/python/apidocs/ee_geometry_multilinestring_togeojson.py create mode 100644 samples/python/apidocs/ee_geometry_multilinestring_togeojsonstring.py create mode 100644 samples/python/apidocs/ee_geometry_multilinestring_type.py create mode 100644 samples/python/apidocs/ee_geometry_multilinestring_union.py create mode 100644 samples/python/apidocs/ee_geometry_multilinestring_withindistance.py diff --git a/samples/python/apidocs/ee_geometry_multilinestring_area.py b/samples/python/apidocs/ee_geometry_multilinestring_area.py new file mode 100644 index 000000000..0f45f71d3 --- /dev/null +++ b/samples/python/apidocs/ee_geometry_multilinestring_area.py @@ -0,0 +1,35 @@ +# Copyright 2023 The Google Earth Engine Community Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# [START earthengine__apidocs__ee_geometry_multilinestring_area] +# 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 area method to the MultiLineString object. +multilinestring_area = multilinestring.area(maxError=1) + +# Print the result. +display('multilinestring.area(...) =', multilinestring_area) + +# Display relevant geometries on the map. +m = geemap.Map() +m.set_center(-122.085, 37.422, 15) +m.add_ee_layer( + multilinestring, {'color': 'black'}, 'Geometry [black]: multilinestring' +) +m +# [END earthengine__apidocs__ee_geometry_multilinestring_area] diff --git a/samples/python/apidocs/ee_geometry_multilinestring_bounds.py b/samples/python/apidocs/ee_geometry_multilinestring_bounds.py new file mode 100644 index 000000000..a6ebe013b --- /dev/null +++ b/samples/python/apidocs/ee_geometry_multilinestring_bounds.py @@ -0,0 +1,40 @@ +# Copyright 2023 The Google Earth Engine Community Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# [START earthengine__apidocs__ee_geometry_multilinestring_bounds] +# 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 bounds method to the MultiLineString object. +multilinestring_bounds = multilinestring.bounds() + +# Print the result. +display('multilinestring.bounds(...) =', multilinestring_bounds) + +# Display relevant geometries on the map. +m = geemap.Map() +m.set_center(-122.085, 37.422, 15) +m.add_ee_layer( + multilinestring, {'color': 'black'}, 'Geometry [black]: multilinestring' +) +m.add_ee_layer( + multilinestring_bounds, + {'color': 'red'}, + 'Result [red]: multilinestring.bounds', +) +m +# [END earthengine__apidocs__ee_geometry_multilinestring_bounds] diff --git a/samples/python/apidocs/ee_geometry_multilinestring_buffer.py b/samples/python/apidocs/ee_geometry_multilinestring_buffer.py new file mode 100644 index 000000000..b3e1bcadf --- /dev/null +++ b/samples/python/apidocs/ee_geometry_multilinestring_buffer.py @@ -0,0 +1,40 @@ +# Copyright 2023 The Google Earth Engine Community Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# [START earthengine__apidocs__ee_geometry_multilinestring_buffer] +# 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 buffer method to the MultiLineString object. +multilinestring_buffer = multilinestring.buffer(distance=100) + +# Print the result. +display('multilinestring.buffer(...) =', multilinestring_buffer) + +# Display relevant geometries on the map. +m = geemap.Map() +m.set_center(-122.085, 37.422, 15) +m.add_ee_layer( + multilinestring, {'color': 'black'}, 'Geometry [black]: multilinestring' +) +m.add_ee_layer( + multilinestring_buffer, + {'color': 'red'}, + 'Result [red]: multilinestring.buffer', +) +m +# [END earthengine__apidocs__ee_geometry_multilinestring_buffer] diff --git a/samples/python/apidocs/ee_geometry_multilinestring_centroid.py b/samples/python/apidocs/ee_geometry_multilinestring_centroid.py new file mode 100644 index 000000000..f212daee0 --- /dev/null +++ b/samples/python/apidocs/ee_geometry_multilinestring_centroid.py @@ -0,0 +1,40 @@ +# Copyright 2023 The Google Earth Engine Community Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# [START earthengine__apidocs__ee_geometry_multilinestring_centroid] +# 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 centroid method to the MultiLineString object. +multilinestring_centroid = multilinestring.centroid(maxError=1) + +# Print the result. +display('multilinestring.centroid(...) =', multilinestring_centroid) + +# Display relevant geometries on the map. +m = geemap.Map() +m.set_center(-122.085, 37.422, 15) +m.add_ee_layer( + multilinestring, {'color': 'black'}, 'Geometry [black]: multilinestring' +) +m.add_ee_layer( + multilinestring_centroid, + {'color': 'red'}, + 'Result [red]: multilinestring.centroid', +) +m +# [END earthengine__apidocs__ee_geometry_multilinestring_centroid] diff --git a/samples/python/apidocs/ee_geometry_multilinestring_containedin.py b/samples/python/apidocs/ee_geometry_multilinestring_containedin.py new file mode 100644 index 000000000..b452c1706 --- /dev/null +++ b/samples/python/apidocs/ee_geometry_multilinestring_containedin.py @@ -0,0 +1,41 @@ +# Copyright 2023 The Google Earth Engine Community Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# [START earthengine__apidocs__ee_geometry_multilinestring_containedin] +# 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]], +]) + +# Define other inputs. +input_geom = ee.Geometry.BBox(-122.085, 37.415, -122.075, 37.425) + +# Apply the containedIn method to the MultiLineString object. +multilinestring_contained_in = multilinestring.containedIn( + right=input_geom, maxError=1 +) + +# Print the result. +display('multilinestring.containedIn(...) =', multilinestring_contained_in) + +# Display relevant geometries on the map. +m = geemap.Map() +m.set_center(-122.085, 37.422, 15) +m.add_ee_layer( + multilinestring, {'color': 'black'}, 'Geometry [black]: multilinestring' +) +m.add_ee_layer(input_geom, {'color': 'blue'}, 'Parameter [blue]: input_geom') +m +# [END earthengine__apidocs__ee_geometry_multilinestring_containedin] diff --git a/samples/python/apidocs/ee_geometry_multilinestring_contains.py b/samples/python/apidocs/ee_geometry_multilinestring_contains.py new file mode 100644 index 000000000..bb92e6356 --- /dev/null +++ b/samples/python/apidocs/ee_geometry_multilinestring_contains.py @@ -0,0 +1,41 @@ +# Copyright 2023 The Google Earth Engine Community Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# [START earthengine__apidocs__ee_geometry_multilinestring_contains] +# 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]], +]) + +# Define other inputs. +input_geom = ee.Geometry.BBox(-122.085, 37.415, -122.075, 37.425) + +# Apply the contains method to the MultiLineString object. +multilinestring_contains = multilinestring.contains( + right=input_geom, maxError=1 +) + +# Print the result. +display('multilinestring.contains(...) =', multilinestring_contains) + +# Display relevant geometries on the map. +m = geemap.Map() +m.set_center(-122.085, 37.422, 15) +m.add_ee_layer( + multilinestring, {'color': 'black'}, 'Geometry [black]: multilinestring' +) +m.add_ee_layer(input_geom, {'color': 'blue'}, 'Parameter [blue]: input_geom') +m +# [END earthengine__apidocs__ee_geometry_multilinestring_contains] diff --git a/samples/python/apidocs/ee_geometry_multilinestring_convexhull.py b/samples/python/apidocs/ee_geometry_multilinestring_convexhull.py new file mode 100644 index 000000000..5095f0605 --- /dev/null +++ b/samples/python/apidocs/ee_geometry_multilinestring_convexhull.py @@ -0,0 +1,40 @@ +# Copyright 2023 The Google Earth Engine Community Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# [START earthengine__apidocs__ee_geometry_multilinestring_convexhull] +# 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 convexHull method to the MultiLineString object. +multilinestring_convex_hull = multilinestring.convexHull(maxError=1) + +# Print the result. +display('multilinestring.convexHull(...) =', multilinestring_convex_hull) + +# Display relevant geometries on the map. +m = geemap.Map() +m.set_center(-122.085, 37.422, 15) +m.add_ee_layer( + multilinestring, {'color': 'black'}, 'Geometry [black]: multilinestring' +) +m.add_ee_layer( + multilinestring_convex_hull, + {'color': 'red'}, + 'Result [red]: multilinestring.convexHull', +) +m +# [END earthengine__apidocs__ee_geometry_multilinestring_convexhull] diff --git a/samples/python/apidocs/ee_geometry_multilinestring_coordinates.py b/samples/python/apidocs/ee_geometry_multilinestring_coordinates.py new file mode 100644 index 000000000..7f3ee941a --- /dev/null +++ b/samples/python/apidocs/ee_geometry_multilinestring_coordinates.py @@ -0,0 +1,35 @@ +# Copyright 2023 The Google Earth Engine Community Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# [START earthengine__apidocs__ee_geometry_multilinestring_coordinates] +# 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 coordinates method to the MultiLineString object. +multilinestring_coordinates = multilinestring.coordinates() + +# Print the result. +display('multilinestring.coordinates(...) =', multilinestring_coordinates) + +# Display relevant geometries on the map. +m = geemap.Map() +m.set_center(-122.085, 37.422, 15) +m.add_ee_layer( + multilinestring, {'color': 'black'}, 'Geometry [black]: multilinestring' +) +m +# [END earthengine__apidocs__ee_geometry_multilinestring_coordinates] diff --git a/samples/python/apidocs/ee_geometry_multilinestring_cutlines.py b/samples/python/apidocs/ee_geometry_multilinestring_cutlines.py new file mode 100644 index 000000000..3f64a8e25 --- /dev/null +++ b/samples/python/apidocs/ee_geometry_multilinestring_cutlines.py @@ -0,0 +1,42 @@ +# Copyright 2023 The Google Earth Engine Community Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# [START earthengine__apidocs__ee_geometry_multilinestring_cutlines] +# 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 cutLines method to the MultiLineString object. +multilinestring_cut_lines = multilinestring.cutLines( + distances=[10, 100], maxError=1 +) + +# Print the result. +display('multilinestring.cutLines(...) =', multilinestring_cut_lines) + +# Display relevant geometries on the map. +m = geemap.Map() +m.set_center(-122.085, 37.422, 15) +m.add_ee_layer( + multilinestring, {'color': 'black'}, 'Geometry [black]: multilinestring' +) +m.add_ee_layer( + multilinestring_cut_lines, + {'color': 'red'}, + 'Result [red]: multilinestring.cutLines', +) +m +# [END earthengine__apidocs__ee_geometry_multilinestring_cutlines] diff --git a/samples/python/apidocs/ee_geometry_multilinestring_difference.py b/samples/python/apidocs/ee_geometry_multilinestring_difference.py new file mode 100644 index 000000000..ba896951c --- /dev/null +++ b/samples/python/apidocs/ee_geometry_multilinestring_difference.py @@ -0,0 +1,46 @@ +# Copyright 2023 The Google Earth Engine Community Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# [START earthengine__apidocs__ee_geometry_multilinestring_difference] +# 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]], +]) + +# Define other inputs. +input_geom = ee.Geometry.BBox(-122.085, 37.415, -122.075, 37.425) + +# Apply the difference method to the MultiLineString object. +multilinestring_difference = multilinestring.difference( + right=input_geom, maxError=1 +) + +# Print the result. +display('multilinestring.difference(...) =', multilinestring_difference) + +# Display relevant geometries on the map. +m = geemap.Map() +m.set_center(-122.085, 37.422, 15) +m.add_ee_layer( + multilinestring, {'color': 'black'}, 'Geometry [black]: multilinestring' +) +m.add_ee_layer(input_geom, {'color': 'blue'}, 'Parameter [blue]: input_geom') +m.add_ee_layer( + multilinestring_difference, + {'color': 'red'}, + 'Result [red]: multilinestring.difference', +) +m +# [END earthengine__apidocs__ee_geometry_multilinestring_difference] diff --git a/samples/python/apidocs/ee_geometry_multilinestring_disjoint.py b/samples/python/apidocs/ee_geometry_multilinestring_disjoint.py new file mode 100644 index 000000000..c753441c5 --- /dev/null +++ b/samples/python/apidocs/ee_geometry_multilinestring_disjoint.py @@ -0,0 +1,41 @@ +# Copyright 2023 The Google Earth Engine Community Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# [START earthengine__apidocs__ee_geometry_multilinestring_disjoint] +# 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]], +]) + +# Define other inputs. +input_geom = ee.Geometry.BBox(-122.085, 37.415, -122.075, 37.425) + +# Apply the disjoint method to the MultiLineString object. +multilinestring_disjoint = multilinestring.disjoint( + right=input_geom, maxError=1 +) + +# Print the result. +display('multilinestring.disjoint(...) =', multilinestring_disjoint) + +# Display relevant geometries on the map. +m = geemap.Map() +m.set_center(-122.085, 37.422, 15) +m.add_ee_layer( + multilinestring, {'color': 'black'}, 'Geometry [black]: multilinestring' +) +m.add_ee_layer(input_geom, {'color': 'blue'}, 'Parameter [blue]: input_geom') +m +# [END earthengine__apidocs__ee_geometry_multilinestring_disjoint] diff --git a/samples/python/apidocs/ee_geometry_multilinestring_dissolve.py b/samples/python/apidocs/ee_geometry_multilinestring_dissolve.py new file mode 100644 index 000000000..b809abe15 --- /dev/null +++ b/samples/python/apidocs/ee_geometry_multilinestring_dissolve.py @@ -0,0 +1,40 @@ +# Copyright 2023 The Google Earth Engine Community Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# [START earthengine__apidocs__ee_geometry_multilinestring_dissolve] +# 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 dissolve method to the MultiLineString object. +multilinestring_dissolve = multilinestring.dissolve(maxError=1) + +# Print the result. +display('multilinestring.dissolve(...) =', multilinestring_dissolve) + +# Display relevant geometries on the map. +m = geemap.Map() +m.set_center(-122.085, 37.422, 15) +m.add_ee_layer( + multilinestring, {'color': 'black'}, 'Geometry [black]: multilinestring' +) +m.add_ee_layer( + multilinestring_dissolve, + {'color': 'red'}, + 'Result [red]: multilinestring.dissolve', +) +m +# [END earthengine__apidocs__ee_geometry_multilinestring_dissolve] diff --git a/samples/python/apidocs/ee_geometry_multilinestring_distance.py b/samples/python/apidocs/ee_geometry_multilinestring_distance.py new file mode 100644 index 000000000..baf8de8d6 --- /dev/null +++ b/samples/python/apidocs/ee_geometry_multilinestring_distance.py @@ -0,0 +1,41 @@ +# Copyright 2023 The Google Earth Engine Community Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# [START earthengine__apidocs__ee_geometry_multilinestring_distance] +# 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]], +]) + +# Define other inputs. +input_geom = ee.Geometry.Point(-122.090, 37.423) + +# Apply the distance method to the MultiLineString object. +multilinestring_distance = multilinestring.distance( + right=input_geom, maxError=1 +) + +# Print the result. +display('multilinestring.distance(...) =', multilinestring_distance) + +# Display relevant geometries on the map. +m = geemap.Map() +m.set_center(-122.085, 37.422, 15) +m.add_ee_layer( + multilinestring, {'color': 'black'}, 'Geometry [black]: multilinestring' +) +m.add_ee_layer(input_geom, {'color': 'blue'}, 'Parameter [blue]: input_geom') +m +# [END earthengine__apidocs__ee_geometry_multilinestring_distance] diff --git a/samples/python/apidocs/ee_geometry_multilinestring_edgesaregeodesics.py b/samples/python/apidocs/ee_geometry_multilinestring_edgesaregeodesics.py new file mode 100644 index 000000000..bbc663e80 --- /dev/null +++ b/samples/python/apidocs/ee_geometry_multilinestring_edgesaregeodesics.py @@ -0,0 +1,38 @@ +# Copyright 2023 The Google Earth Engine Community Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# [START earthengine__apidocs__ee_geometry_multilinestring_edgesaregeodesics] +# 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_ee_layer( + multilinestring, {'color': 'black'}, 'Geometry [black]: multilinestring' +) +m +# [END earthengine__apidocs__ee_geometry_multilinestring_edgesaregeodesics] diff --git a/samples/python/apidocs/ee_geometry_multilinestring_geodesic.py b/samples/python/apidocs/ee_geometry_multilinestring_geodesic.py new file mode 100644 index 000000000..4d326c0a2 --- /dev/null +++ b/samples/python/apidocs/ee_geometry_multilinestring_geodesic.py @@ -0,0 +1,35 @@ +# Copyright 2023 The Google Earth Engine Community Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# [START earthengine__apidocs__ee_geometry_multilinestring_geodesic] +# 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 geodesic method to the MultiLineString object. +multilinestring_geodesic = multilinestring.geodesic() + +# Print the result. +display('multilinestring.geodesic(...) =', multilinestring_geodesic) + +# Display relevant geometries on the map. +m = geemap.Map() +m.set_center(-122.085, 37.422, 15) +m.add_ee_layer( + multilinestring, {'color': 'black'}, 'Geometry [black]: multilinestring' +) +m +# [END earthengine__apidocs__ee_geometry_multilinestring_geodesic] diff --git a/samples/python/apidocs/ee_geometry_multilinestring_geometries.py b/samples/python/apidocs/ee_geometry_multilinestring_geometries.py new file mode 100644 index 000000000..cbf15df7c --- /dev/null +++ b/samples/python/apidocs/ee_geometry_multilinestring_geometries.py @@ -0,0 +1,35 @@ +# Copyright 2023 The Google Earth Engine Community Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# [START earthengine__apidocs__ee_geometry_multilinestring_geometries] +# 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 geometries method to the MultiLineString object. +multilinestring_geometries = multilinestring.geometries() + +# Print the result. +display('multilinestring.geometries(...) =', multilinestring_geometries) + +# Display relevant geometries on the map. +m = geemap.Map() +m.set_center(-122.085, 37.422, 15) +m.add_ee_layer( + multilinestring, {'color': 'black'}, 'Geometry [black]: multilinestring' +) +m +# [END earthengine__apidocs__ee_geometry_multilinestring_geometries] diff --git a/samples/python/apidocs/ee_geometry_multilinestring_getinfo.py b/samples/python/apidocs/ee_geometry_multilinestring_getinfo.py new file mode 100644 index 000000000..5c40e29a9 --- /dev/null +++ b/samples/python/apidocs/ee_geometry_multilinestring_getinfo.py @@ -0,0 +1,35 @@ +# Copyright 2023 The Google Earth Engine Community Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# [START earthengine__apidocs__ee_geometry_multilinestring_getinfo] +# 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 getInfo method to the MultiLineString object. +multilinestring_get_info = multilinestring.getInfo() + +# Print the result. +display('multilinestring.getInfo(...) =', multilinestring_get_info) + +# Display relevant geometries on the map. +m = geemap.Map() +m.set_center(-122.085, 37.422, 15) +m.add_ee_layer( + multilinestring, {'color': 'black'}, 'Geometry [black]: multilinestring' +) +m +# [END earthengine__apidocs__ee_geometry_multilinestring_getinfo] diff --git a/samples/python/apidocs/ee_geometry_multilinestring_intersection.py b/samples/python/apidocs/ee_geometry_multilinestring_intersection.py new file mode 100644 index 000000000..3f06126bb --- /dev/null +++ b/samples/python/apidocs/ee_geometry_multilinestring_intersection.py @@ -0,0 +1,46 @@ +# Copyright 2023 The Google Earth Engine Community Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# [START earthengine__apidocs__ee_geometry_multilinestring_intersection] +# 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]], +]) + +# Define other inputs. +input_geom = ee.Geometry.BBox(-122.085, 37.415, -122.075, 37.425) + +# Apply the intersection method to the MultiLineString object. +multilinestring_intersection = multilinestring.intersection( + right=input_geom, maxError=1 +) + +# Print the result. +display('multilinestring.intersection(...) =', multilinestring_intersection) + +# Display relevant geometries on the map. +m = geemap.Map() +m.set_center(-122.085, 37.422, 15) +m.add_ee_layer( + multilinestring, {'color': 'black'}, 'Geometry [black]: multilinestring' +) +m.add_ee_layer(input_geom, {'color': 'blue'}, 'Parameter [blue]: input_geom') +m.add_ee_layer( + multilinestring_intersection, + {'color': 'red'}, + 'Result [red]: multilinestring.intersection', +) +m +# [END earthengine__apidocs__ee_geometry_multilinestring_intersection] diff --git a/samples/python/apidocs/ee_geometry_multilinestring_intersects.py b/samples/python/apidocs/ee_geometry_multilinestring_intersects.py new file mode 100644 index 000000000..d4c465352 --- /dev/null +++ b/samples/python/apidocs/ee_geometry_multilinestring_intersects.py @@ -0,0 +1,41 @@ +# Copyright 2023 The Google Earth Engine Community Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# [START earthengine__apidocs__ee_geometry_multilinestring_intersects] +# 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]], +]) + +# Define other inputs. +input_geom = ee.Geometry.BBox(-122.085, 37.415, -122.075, 37.425) + +# Apply the intersects method to the MultiLineString object. +multilinestring_intersects = multilinestring.intersects( + right=input_geom, maxError=1 +) + +# Print the result. +display('multilinestring.intersects(...) =', multilinestring_intersects) + +# Display relevant geometries on the map. +m = geemap.Map() +m.set_center(-122.085, 37.422, 15) +m.add_ee_layer( + multilinestring, {'color': 'black'}, 'Geometry [black]: multilinestring' +) +m.add_ee_layer(input_geom, {'color': 'blue'}, 'Parameter [blue]: input_geom') +m +# [END earthengine__apidocs__ee_geometry_multilinestring_intersects] diff --git a/samples/python/apidocs/ee_geometry_multilinestring_isunbounded.py b/samples/python/apidocs/ee_geometry_multilinestring_isunbounded.py new file mode 100644 index 000000000..b70dbee93 --- /dev/null +++ b/samples/python/apidocs/ee_geometry_multilinestring_isunbounded.py @@ -0,0 +1,35 @@ +# Copyright 2023 The Google Earth Engine Community Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# [START earthengine__apidocs__ee_geometry_multilinestring_isunbounded] +# 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 isUnbounded method to the MultiLineString object. +multilinestring_is_unbounded = multilinestring.isUnbounded() + +# Print the result. +display('multilinestring.isUnbounded(...) =', multilinestring_is_unbounded) + +# Display relevant geometries on the map. +m = geemap.Map() +m.set_center(-122.085, 37.422, 15) +m.add_ee_layer( + multilinestring, {'color': 'black'}, 'Geometry [black]: multilinestring' +) +m +# [END earthengine__apidocs__ee_geometry_multilinestring_isunbounded] diff --git a/samples/python/apidocs/ee_geometry_multilinestring_length.py b/samples/python/apidocs/ee_geometry_multilinestring_length.py new file mode 100644 index 000000000..c3ba73d47 --- /dev/null +++ b/samples/python/apidocs/ee_geometry_multilinestring_length.py @@ -0,0 +1,35 @@ +# Copyright 2023 The Google Earth Engine Community Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# [START earthengine__apidocs__ee_geometry_multilinestring_length] +# 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 length method to the MultiLineString object. +multilinestring_length = multilinestring.length() + +# Print the result. +display('multilinestring.length(...) =', multilinestring_length) + +# Display relevant geometries on the map. +m = geemap.Map() +m.set_center(-122.085, 37.422, 15) +m.add_ee_layer( + multilinestring, {'color': 'black'}, 'Geometry [black]: multilinestring' +) +m +# [END earthengine__apidocs__ee_geometry_multilinestring_length] diff --git a/samples/python/apidocs/ee_geometry_multilinestring_perimeter.py b/samples/python/apidocs/ee_geometry_multilinestring_perimeter.py new file mode 100644 index 000000000..61eafaf05 --- /dev/null +++ b/samples/python/apidocs/ee_geometry_multilinestring_perimeter.py @@ -0,0 +1,35 @@ +# Copyright 2023 The Google Earth Engine Community Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# [START earthengine__apidocs__ee_geometry_multilinestring_perimeter] +# 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 perimeter method to the MultiLineString object. +multilinestring_perimeter = multilinestring.perimeter(maxError=1) + +# Print the result. +display('multilinestring.perimeter(...) =', multilinestring_perimeter) + +# Display relevant geometries on the map. +m = geemap.Map() +m.set_center(-122.085, 37.422, 15) +m.add_ee_layer( + multilinestring, {'color': 'black'}, 'Geometry [black]: multilinestring' +) +m +# [END earthengine__apidocs__ee_geometry_multilinestring_perimeter] diff --git a/samples/python/apidocs/ee_geometry_multilinestring_projection.py b/samples/python/apidocs/ee_geometry_multilinestring_projection.py new file mode 100644 index 000000000..8849a17c6 --- /dev/null +++ b/samples/python/apidocs/ee_geometry_multilinestring_projection.py @@ -0,0 +1,35 @@ +# Copyright 2023 The Google Earth Engine Community Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# [START earthengine__apidocs__ee_geometry_multilinestring_projection] +# 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 projection method to the MultiLineString object. +multilinestring_projection = multilinestring.projection() + +# Print the result. +display('multilinestring.projection(...) =', multilinestring_projection) + +# Display relevant geometries on the map. +m = geemap.Map() +m.set_center(-122.085, 37.422, 15) +m.add_ee_layer( + multilinestring, {'color': 'black'}, 'Geometry [black]: multilinestring' +) +m +# [END earthengine__apidocs__ee_geometry_multilinestring_projection] diff --git a/samples/python/apidocs/ee_geometry_multilinestring_serialize.py b/samples/python/apidocs/ee_geometry_multilinestring_serialize.py new file mode 100644 index 000000000..81f83bd91 --- /dev/null +++ b/samples/python/apidocs/ee_geometry_multilinestring_serialize.py @@ -0,0 +1,35 @@ +# Copyright 2023 The Google Earth Engine Community Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# [START earthengine__apidocs__ee_geometry_multilinestring_serialize] +# 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 serialize method to the MultiLineString object. +multilinestring_serialize = multilinestring.serialize() + +# Print the result. +display('multilinestring.serialize(...) =', multilinestring_serialize) + +# Display relevant geometries on the map. +m = geemap.Map() +m.set_center(-122.085, 37.422, 15) +m.add_ee_layer( + multilinestring, {'color': 'black'}, 'Geometry [black]: multilinestring' +) +m +# [END earthengine__apidocs__ee_geometry_multilinestring_serialize] diff --git a/samples/python/apidocs/ee_geometry_multilinestring_simplify.py b/samples/python/apidocs/ee_geometry_multilinestring_simplify.py new file mode 100644 index 000000000..6671699c2 --- /dev/null +++ b/samples/python/apidocs/ee_geometry_multilinestring_simplify.py @@ -0,0 +1,40 @@ +# Copyright 2023 The Google Earth Engine Community Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# [START earthengine__apidocs__ee_geometry_multilinestring_simplify] +# 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 simplify method to the MultiLineString object. +multilinestring_simplify = multilinestring.simplify(maxError=1) + +# Print the result. +display('multilinestring.simplify(...) =', multilinestring_simplify) + +# Display relevant geometries on the map. +m = geemap.Map() +m.set_center(-122.085, 37.422, 15) +m.add_ee_layer( + multilinestring, {'color': 'black'}, 'Geometry [black]: multilinestring' +) +m.add_ee_layer( + multilinestring_simplify, + {'color': 'red'}, + 'Result [red]: multilinestring.simplify', +) +m +# [END earthengine__apidocs__ee_geometry_multilinestring_simplify] diff --git a/samples/python/apidocs/ee_geometry_multilinestring_symmetricdifference.py b/samples/python/apidocs/ee_geometry_multilinestring_symmetricdifference.py new file mode 100644 index 000000000..bc5201e69 --- /dev/null +++ b/samples/python/apidocs/ee_geometry_multilinestring_symmetricdifference.py @@ -0,0 +1,49 @@ +# Copyright 2023 The Google Earth Engine Community Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# [START earthengine__apidocs__ee_geometry_multilinestring_symmetricdifference] +# 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]], +]) + +# Define other inputs. +input_geom = ee.Geometry.BBox(-122.085, 37.415, -122.075, 37.425) + +# Apply the symmetricDifference method to the MultiLineString object. +multilinestring_symmetric_difference = multilinestring.symmetricDifference( + right=input_geom, maxError=1 +) + +# Print the result. +display( + 'multilinestring.symmetricDifference(...) =', + multilinestring_symmetric_difference, +) + +# Display relevant geometries on the map. +m = geemap.Map() +m.set_center(-122.085, 37.422, 15) +m.add_ee_layer( + multilinestring, {'color': 'black'}, 'Geometry [black]: multilinestring' +) +m.add_ee_layer(input_geom, {'color': 'blue'}, 'Parameter [blue]: input_geom') +m.add_ee_layer( + multilinestring_symmetric_difference, + {'color': 'red'}, + 'Result [red]: multilinestring.symmetricDifference', +) +m +# [END earthengine__apidocs__ee_geometry_multilinestring_symmetricdifference] diff --git a/samples/python/apidocs/ee_geometry_multilinestring_togeojson.py b/samples/python/apidocs/ee_geometry_multilinestring_togeojson.py new file mode 100644 index 000000000..dd79b5322 --- /dev/null +++ b/samples/python/apidocs/ee_geometry_multilinestring_togeojson.py @@ -0,0 +1,35 @@ +# Copyright 2023 The Google Earth Engine Community Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# [START earthengine__apidocs__ee_geometry_multilinestring_togeojson] +# 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 toGeoJSON method to the MultiLineString object. +multilinestring_to_geojson = multilinestring.toGeoJSON() + +# Print the result. +display('multilinestring.toGeoJSON(...) =', multilinestring_to_geojson) + +# Display relevant geometries on the map. +m = geemap.Map() +m.set_center(-122.085, 37.422, 15) +m.add_ee_layer( + multilinestring, {'color': 'black'}, 'Geometry [black]: multilinestring' +) +m +# [END earthengine__apidocs__ee_geometry_multilinestring_togeojson] diff --git a/samples/python/apidocs/ee_geometry_multilinestring_togeojsonstring.py b/samples/python/apidocs/ee_geometry_multilinestring_togeojsonstring.py new file mode 100644 index 000000000..30d254667 --- /dev/null +++ b/samples/python/apidocs/ee_geometry_multilinestring_togeojsonstring.py @@ -0,0 +1,37 @@ +# Copyright 2023 The Google Earth Engine Community Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# [START earthengine__apidocs__ee_geometry_multilinestring_togeojsonstring] +# 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 toGeoJSONString method to the MultiLineString object. +multilinestring_to_geojson_string = multilinestring.toGeoJSONString() + +# Print the result. +display( + 'multilinestring.toGeoJSONString(...) =', multilinestring_to_geojson_string +) + +# Display relevant geometries on the map. +m = geemap.Map() +m.set_center(-122.085, 37.422, 15) +m.add_ee_layer( + multilinestring, {'color': 'black'}, 'Geometry [black]: multilinestring' +) +m +# [END earthengine__apidocs__ee_geometry_multilinestring_togeojsonstring] diff --git a/samples/python/apidocs/ee_geometry_multilinestring_type.py b/samples/python/apidocs/ee_geometry_multilinestring_type.py new file mode 100644 index 000000000..409635443 --- /dev/null +++ b/samples/python/apidocs/ee_geometry_multilinestring_type.py @@ -0,0 +1,35 @@ +# Copyright 2023 The Google Earth Engine Community Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# [START earthengine__apidocs__ee_geometry_multilinestring_type] +# 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 type method to the MultiLineString object. +multilinestring_type = multilinestring.type() + +# Print the result. +display('multilinestring.type(...) =', multilinestring_type) + +# Display relevant geometries on the map. +m = geemap.Map() +m.set_center(-122.085, 37.422, 15) +m.add_ee_layer( + multilinestring, {'color': 'black'}, 'Geometry [black]: multilinestring' +) +m +# [END earthengine__apidocs__ee_geometry_multilinestring_type] diff --git a/samples/python/apidocs/ee_geometry_multilinestring_union.py b/samples/python/apidocs/ee_geometry_multilinestring_union.py new file mode 100644 index 000000000..cf67f5006 --- /dev/null +++ b/samples/python/apidocs/ee_geometry_multilinestring_union.py @@ -0,0 +1,44 @@ +# Copyright 2023 The Google Earth Engine Community Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# [START earthengine__apidocs__ee_geometry_multilinestring_union] +# 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]], +]) + +# Define other inputs. +input_geom = ee.Geometry.BBox(-122.085, 37.415, -122.075, 37.425) + +# Apply the union method to the MultiLineString object. +multilinestring_union = multilinestring.union(right=input_geom, maxError=1) + +# Print the result. +display('multilinestring.union(...) =', multilinestring_union) + +# Display relevant geometries on the map. +m = geemap.Map() +m.set_center(-122.085, 37.422, 15) +m.add_ee_layer( + multilinestring, {'color': 'black'}, 'Geometry [black]: multilinestring' +) +m.add_ee_layer(input_geom, {'color': 'blue'}, 'Parameter [blue]: input_geom') +m.add_ee_layer( + multilinestring_union, + {'color': 'red'}, + 'Result [red]: multilinestring.union', +) +m +# [END earthengine__apidocs__ee_geometry_multilinestring_union] diff --git a/samples/python/apidocs/ee_geometry_multilinestring_withindistance.py b/samples/python/apidocs/ee_geometry_multilinestring_withindistance.py new file mode 100644 index 000000000..e2d1fe07d --- /dev/null +++ b/samples/python/apidocs/ee_geometry_multilinestring_withindistance.py @@ -0,0 +1,43 @@ +# Copyright 2023 The Google Earth Engine Community Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# [START earthengine__apidocs__ee_geometry_multilinestring_withindistance] +# 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]], +]) + +# Define other inputs. +input_geom = ee.Geometry.Point(-122.090, 37.423) + +# Apply the withinDistance method to the MultiLineString object. +multilinestring_within_distance = multilinestring.withinDistance( + right=input_geom, distance=500, maxError=1 +) + +# Print the result. +display( + 'multilinestring.withinDistance(...) =', multilinestring_within_distance +) + +# Display relevant geometries on the map. +m = geemap.Map() +m.set_center(-122.085, 37.422, 15) +m.add_ee_layer( + multilinestring, {'color': 'black'}, 'Geometry [black]: multilinestring' +) +m.add_ee_layer(input_geom, {'color': 'blue'}, 'Parameter [blue]: input_geom') +m +# [END earthengine__apidocs__ee_geometry_multilinestring_withindistance]