Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/api_reference/eoproduct.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ Conversion
----------

.. automethod:: EOProduct.as_dict
.. automethod:: EOProduct.from_geojson
.. automethod:: EOProduct.from_dict
.. automethod:: EOProduct.from_file

Interface
---------
Expand Down
6 changes: 3 additions & 3 deletions docs/api_reference/searchresult.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ Conversion

.. autosummary::

SearchResult.from_geojson
SearchResult.as_geojson_object
SearchResult.from_dict
SearchResult.as_dict
SearchResult.as_shapely_geometry_object
SearchResult.as_wkt_object

Expand All @@ -60,5 +60,5 @@ Interface

.. autoclass:: SearchResult
:members: crunch, filter_date, filter_latest_intersect, filter_latest_by_name, filter_overlap, filter_property,
filter_online, from_geojson, as_geojson_object, as_shapely_geometry_object, as_wkt_object, next_page,
filter_online, from_dict, as_dict, as_shapely_geometry_object, as_wkt_object, next_page,
__geo_interface__
16 changes: 9 additions & 7 deletions docs/notebooks/api_user_guide/3_search.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1940,7 +1940,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"An [EOProduct](../../api_reference/eoproduct.rst#eodag.api.product._product.EOProduct) has an [as_dict()](../../api_reference/eoproduct.rst#eodag.api.product._product.EOProduct.as_dict) to convert it into a GeoJSON-like dictionary and a [from_geojson()](../../api_reference/eoproduct.rst#eodag.api.product._product.EOProduct.from_geojson) method to create an [EOProduct](../../api_reference/eoproduct.rst#eodag.api.product._product.EOProduct) from a GeoJSON dictionary."
"An [EOProduct](../../api_reference/eoproduct.rst#eodag.api.product._product.EOProduct) has an [as_dict()](../../api_reference/eoproduct.rst#eodag.api.product._product.EOProduct.as_dict) to convert it into a GeoJSON-like dictionary and a [from_dict()](../../api_reference/eoproduct.rst#eodag.api.product._product.EOProduct.from_dict) method to create an [EOProduct](../../api_reference/eoproduct.rst#eodag.api.product._product.EOProduct) from a GeoJSON dictionary."
]
},
{
Expand Down Expand Up @@ -2120,20 +2120,20 @@
"source": [
"from eodag import EOProduct\n",
"product_geojson_structure = one_product.as_dict()\n",
"recreated_product = EOProduct.from_geojson(product_geojson_structure)\n",
"recreated_product = EOProduct.from_dict(product_geojson_structure)\n",
"recreated_product"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Since [EOProduct](../../api_reference/eoproduct.rst#eodag.api.product._product.EOProduct)s have a way to convert themselves to a GeoJSON dictionary, it is natural to be able to convert a [SearchResult](../../api_reference/searchresult.rst#eodag.api.search_result.SearchResult) object to a GeoJSON *FeatureCollection* ([as_geojson_object()](../../api_reference/searchresult.rst#eodag.api.search_result.SearchResult.as_geojson_object)). It is also possible to create a [SearchResult](../../api_reference/searchresult.rst#eodag.api.search_result.SearchResult) from a dictionary structured as a *FeatureCollection* with [from_geojson()](../../api_reference/searchresult.rst#eodag.api.search_result.SearchResult.from_geojson)."
"Since [EOProduct](../../api_reference/eoproduct.rst#eodag.api.product._product.EOProduct)s have a way to convert themselves to a GeoJSON dictionary, it is natural to be able to convert a [SearchResult](../../api_reference/searchresult.rst#eodag.api.search_result.SearchResult) object to a GeoJSON *FeatureCollection* ([as_dict()](../../api_reference/searchresult.rst#eodag.api.search_result.SearchResult.as_dict)). It is also possible to create a [SearchResult](../../api_reference/searchresult.rst#eodag.api.search_result.SearchResult) from a dictionary structured as a *FeatureCollection* with [from_dict()](../../api_reference/searchresult.rst#eodag.api.search_result.SearchResult.from_dict)."
]
},
{
"cell_type": "code",
"execution_count": 23,
"execution_count": null,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -2483,16 +2483,18 @@
],
"source": [
"from eodag import SearchResult\n",
"feature_collection = all_products.as_geojson_object()\n",
"recreated_search_result = SearchResult.from_geojson(feature_collection)\n",
"feature_collection = all_products.as_dict()\n",
"recreated_search_result = SearchResult.from_dict(feature_collection)\n",
"recreated_search_result[:2]"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"You can also convert a [SearchResult](../../api_reference/searchresult.rst#eodag.api.search_result.SearchResult) object to other formats, like `shapely.geometry.GeometryCollection` ([as_shapely_geometry_object()](../../api_reference/searchresult.rst#eodag.api.search_result.SearchResult.as_shapely_geometry_object)), and `WKT` ([as_wkt_object()](../../api_reference/searchresult.rst#eodag.api.search_result.SearchResult.as_wkt_object))."
"You can also convert a [SearchResult](../../api_reference/searchresult.rst#eodag.api.search_result.SearchResult) object to other formats, like `shapely.GeometryCollection` ([as_shapely_geometry_object()](../../api_reference/searchresult.rst#eodag.api.search_result.SearchResult.as_shapely_geometry_object)), and `WKT` ([as_wkt_object()](../../api_reference/searchresult.rst#eodag.api.search_result.SearchResult.as_wkt_object)).\n",
"\n",
"For more information on conversion methods, see [Serialize/Deserialize](./5_serialize_deserialize.ipynb) from API User Guide."
]
},
{
Expand Down
Loading
Loading