Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DOCS] Fix geometry object creation #484

Merged
merged 5 commits into from
Apr 19, 2023
Merged
Changes from 2 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
42 changes: 27 additions & 15 deletions docs/tutorials/item-search-intersects.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@
"cell_type": "code",
"execution_count": null,
"id": "98942e75",
"metadata": {},
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"from pystac_client import Client\n",
Expand Down Expand Up @@ -69,7 +71,9 @@
"cell_type": "code",
"execution_count": null,
"id": "d8af6334",
"metadata": {},
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"# AOI around Delfzijl, in northern Netherlands\n",
Expand Down Expand Up @@ -97,7 +101,7 @@
" 6,\n",
" 53\n",
" ]\n",
" ]\n",
" ],\n",
jsignell marked this conversation as resolved.
Show resolved Hide resolved
" ]\n",
"}\n",
"\n",
Expand All @@ -122,7 +126,9 @@
"cell_type": "code",
"execution_count": null,
"id": "9a7c9336",
"metadata": {},
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"aoi_as_str: str = json.dumps(aoi_as_dict)\n",
Expand All @@ -138,7 +144,7 @@
},
{
"cell_type": "markdown",
"id": "9da4956b",
"id": "f22ffb5a",
"metadata": {},
"source": [
"## Item Search with AOI as a Shapely Geometry Object"
Expand All @@ -147,8 +153,10 @@
{
"cell_type": "code",
"execution_count": null,
"id": "9a7c9336",
"metadata": {},
"id": "a44598ef",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"import shapely.geometry\n",
Expand Down Expand Up @@ -176,7 +184,7 @@
},
{
"cell_type": "markdown",
"id": "9da4956b",
"id": "8f236254",
"metadata": {},
"source": [
"## Item Search with AOI as a \"geojson\" library object"
Expand All @@ -185,8 +193,10 @@
{
"cell_type": "code",
"execution_count": null,
"id": "9a7c9336",
"metadata": {},
"id": "84ce4395",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"import geojson\n",
Expand All @@ -204,7 +214,7 @@
},
{
"cell_type": "markdown",
"id": "9da4956b",
"id": "3fe9c255",
"metadata": {},
"source": [
"## Item Search with AOI as a pygeoif Object"
Expand All @@ -214,11 +224,13 @@
"cell_type": "code",
"execution_count": null,
"id": "a27dcb72",
"metadata": {},
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"import pygeoif\n",
"aoi_as_pygeoif_polygon = pygeoif.geometry.Polygon(aoi_as_dict[\"coordinates\"])\n",
"aoi_as_pygeoif_polygon = pygeoif.geometry.Polygon(aoi_as_dict[\"coordinates\"][0])\n",
gadomski marked this conversation as resolved.
Show resolved Hide resolved
"\n",
"search = client.search(\n",
" max_items = 25,\n",
Expand All @@ -235,7 +247,7 @@
"hash": "6b6313dbab648ff537330b996f33bf845c0da10ea77ae70864d6ca8e2699c7ea"
},
"kernelspec": {
"display_name": "Python 3.9.11 ('.venv': venv)",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -249,7 +261,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.11"
"version": "3.11.3"
}
},
"nbformat": 4,
Expand Down