Skip to content
Open
Show file tree
Hide file tree
Changes from 9 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
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ python3 -m mypy tests
Using the config file `mypy.ini`, you can suppress missing stub errors for external libraries.
You can ignore a library by adding two lines to the config file. For example, suppressing matplotlib would look like this:

```
```ini
[mypy-matplotlib.*]
ignore_missing_imports = True

Expand Down Expand Up @@ -171,11 +171,11 @@ Start a python terminal and try it out:
import geoengine as ge
from datetime import datetime

ge.initialize("https://nightly.peter.geoengine.io/api")
ge_client = ge.create_client("https://nightly.peter.geoengine.io/api")

time = datetime.strptime('2014-04-01T12:00:00.000Z', "%Y-%m-%dT%H:%M:%S.%f%z")

workflow = ge.workflow_by_id('4cdf1ffe-cb67-5de2-a1f3-3357ae0112bd')
workflow = ge_client.workflow_by_id('4cdf1ffe-cb67-5de2-a1f3-3357ae0112bd')

print(workflow.get_result_descriptor())

Expand All @@ -186,7 +186,7 @@ workflow.get_dataframe(ge.Bbox([-60.0, 5.0, 61.0, 6.0], [time, time]))

If the Geo Engine server requires authentication, you can set your credentials in the following ways:

1. in the initialize method: `ge.initialize("https://nightly.peter.geoengine.io/api", ("email", "password"))`
1. in the initialize method: `ge.create_client("https://nightly.peter.geoengine.io/api", ("email", "password"))`
2. as environment variables `export GEOENGINE_EMAIL="email"` and `export GEOENGINE_PASSWORD="password"`
3. in a .env file in the current working directory with the content:

Expand Down
1,122 changes: 1,095 additions & 27 deletions examples/add_public_raster_dataset.ipynb

Large diffs are not rendered by default.

64 changes: 34 additions & 30 deletions examples/add_public_vector_dataset.ipynb

Large diffs are not rendered by default.

32 changes: 17 additions & 15 deletions examples/colorizer.ipynb

Large diffs are not rendered by default.

38 changes: 26 additions & 12 deletions examples/interpolation.ipynb

Large diffs are not rendered by default.

232 changes: 129 additions & 103 deletions examples/layers.ipynb

Large diffs are not rendered by default.

41 changes: 21 additions & 20 deletions examples/ndvi_ports.ipynb

Large diffs are not rendered by default.

170 changes: 83 additions & 87 deletions examples/permissions.ipynb

Large diffs are not rendered by default.

42 changes: 22 additions & 20 deletions examples/plots.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -29,33 +29,34 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
"ge.initialize(\"http://localhost:3030/api\")"
"client = ge.create_client(\"http://localhost:3030/api\")"
]
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Server: http://localhost:3030/api\n",
"Session Id: 18fec623-6600-41af-b82b-24ccf47cb9f9"
"User Id: a5f4b68c-f766-4674-a38c-1557c0fff98f\n",
"Session Id: 94b8f705-d723-4079-a427-8aadcab31d3f\n",
"Session valid until: 2023-12-01T15:08:57.799Z"
]
},
"execution_count": 3,
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"session = ge.get_session()\n",
"session"
"client.get_session()"
]
},
{
Expand All @@ -68,7 +69,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 6,
"metadata": {},
"outputs": [
{
Expand All @@ -77,13 +78,13 @@
"80c1417d-b2fa-56bc-90cf-d9651ba8ec37"
]
},
"execution_count": 4,
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"workflow = ge.register_workflow({\n",
"workflow = client.workflow_register({\n",
"\t\"type\": \"Plot\",\n",
"\t\"operator\": {\n",
"\t\t\"type\": \"Histogram\",\n",
Expand All @@ -110,7 +111,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 7,
"metadata": {},
"outputs": [
{
Expand All @@ -119,7 +120,7 @@
"Plot Result"
]
},
"execution_count": 5,
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -138,19 +139,19 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 8,
"metadata": {},
"outputs": [
{
"data": {
"application/javascript": "const spec = {\"$schema\": \"https://vega.github.io/schema/vega-lite/v4.json\", \"data\": {\"values\": [{\"Frequency\": 11243, \"binEnd\": 13.7, \"binStart\": 1.0}, {\"Frequency\": 295370, \"binEnd\": 26.4, \"binStart\": 13.7}, {\"Frequency\": 66337, \"binEnd\": 39.099999999999994, \"binStart\": 26.4}, {\"Frequency\": 101637, \"binEnd\": 51.8, \"binStart\": 39.099999999999994}, {\"Frequency\": 144761, \"binEnd\": 64.5, \"binStart\": 51.8}, {\"Frequency\": 90730, \"binEnd\": 77.2, \"binStart\": 64.5}, {\"Frequency\": 90168, \"binEnd\": 89.9, \"binStart\": 77.2}, {\"Frequency\": 91465, \"binEnd\": 102.60000000000001, \"binStart\": 89.9}, {\"Frequency\": 75286, \"binEnd\": 115.30000000000001, \"binStart\": 102.60000000000001}, {\"Frequency\": 62159, \"binEnd\": 128.0, \"binStart\": 115.30000000000001}, {\"Frequency\": 66335, \"binEnd\": 140.7, \"binStart\": 128.0}, {\"Frequency\": 68688, \"binEnd\": 153.39999999999998, \"binStart\": 140.7}, {\"Frequency\": 66999, \"binEnd\": 166.09999999999997, \"binStart\": 153.39999999999998}, {\"Frequency\": 59499, \"binEnd\": 178.79999999999995, \"binStart\": 166.09999999999997}, {\"Frequency\": 64618, \"binEnd\": 191.49999999999994, \"binStart\": 178.79999999999995}, {\"Frequency\": 70166, \"binEnd\": 204.19999999999993, \"binStart\": 191.49999999999994}, {\"Frequency\": 65502, \"binEnd\": 216.89999999999992, \"binStart\": 204.19999999999993}, {\"Frequency\": 50421, \"binEnd\": 229.5999999999999, \"binStart\": 216.89999999999992}, {\"Frequency\": 29428, \"binEnd\": 242.2999999999999, \"binStart\": 229.5999999999999}, {\"Frequency\": 4908781, \"binEnd\": 254.9999999999999, \"binStart\": 242.2999999999999}]}, \"encoding\": {\"x\": {\"axis\": {\"title\": \"vegetation\"}, \"bin\": {\"binned\": true, \"step\": 12.7}, \"field\": \"binStart\"}, \"x2\": {\"field\": \"binEnd\"}, \"y\": {\"field\": \"Frequency\", \"type\": \"quantitative\"}}, \"mark\": \"bar\"};\nconst opt = {};\nconst type = \"vega-lite\";\nconst id = \"6683a7db-b092-477b-a13e-4a5822d5d52c\";\n\nconst output_area = this;\n\nrequire([\"jupyter-vega\"], function(vega) {\n const target = document.createElement(\"div\");\n target.id = id;\n target.className = \"vega-embed\";\n\n const style = document.createElement(\"style\");\n style.textContent = [\n \".vega-embed .error p {\",\n \" color: firebrick;\",\n \" font-size: 14px;\",\n \"}\",\n ].join(\"\\\\n\");\n\n // element is a jQuery wrapped DOM element inside the output area\n // see http://ipython.readthedocs.io/en/stable/api/generated/\\\n // IPython.display.html#IPython.display.Javascript.__init__\n element[0].appendChild(target);\n element[0].appendChild(style);\n\n vega.render(`#$6683a7db-b092-477b-a13e-4a5822d5d52c`, spec, type, opt, output_area);\n}, function (err) {\n if (err.requireType !== \"scripterror\") {\n throw(err);\n }\n});\n",
"application/javascript": "const spec = {\"$schema\": \"https://vega.github.io/schema/vega-lite/v4.json\", \"data\": {\"values\": [{\"Frequency\": 11243, \"binEnd\": 13.7, \"binStart\": 1.0}, {\"Frequency\": 295370, \"binEnd\": 26.4, \"binStart\": 13.7}, {\"Frequency\": 66337, \"binEnd\": 39.099999999999994, \"binStart\": 26.4}, {\"Frequency\": 101637, \"binEnd\": 51.8, \"binStart\": 39.099999999999994}, {\"Frequency\": 144761, \"binEnd\": 64.5, \"binStart\": 51.8}, {\"Frequency\": 90730, \"binEnd\": 77.2, \"binStart\": 64.5}, {\"Frequency\": 90168, \"binEnd\": 89.9, \"binStart\": 77.2}, {\"Frequency\": 91465, \"binEnd\": 102.60000000000001, \"binStart\": 89.9}, {\"Frequency\": 75286, \"binEnd\": 115.30000000000001, \"binStart\": 102.60000000000001}, {\"Frequency\": 62159, \"binEnd\": 128.0, \"binStart\": 115.30000000000001}, {\"Frequency\": 66335, \"binEnd\": 140.7, \"binStart\": 128.0}, {\"Frequency\": 68688, \"binEnd\": 153.39999999999998, \"binStart\": 140.7}, {\"Frequency\": 66999, \"binEnd\": 166.09999999999997, \"binStart\": 153.39999999999998}, {\"Frequency\": 59499, \"binEnd\": 178.79999999999995, \"binStart\": 166.09999999999997}, {\"Frequency\": 64618, \"binEnd\": 191.49999999999994, \"binStart\": 178.79999999999995}, {\"Frequency\": 70166, \"binEnd\": 204.19999999999993, \"binStart\": 191.49999999999994}, {\"Frequency\": 65502, \"binEnd\": 216.89999999999992, \"binStart\": 204.19999999999993}, {\"Frequency\": 50421, \"binEnd\": 229.5999999999999, \"binStart\": 216.89999999999992}, {\"Frequency\": 29428, \"binEnd\": 242.2999999999999, \"binStart\": 229.5999999999999}, {\"Frequency\": 4908781, \"binEnd\": 254.9999999999999, \"binStart\": 242.2999999999999}]}, \"encoding\": {\"x\": {\"axis\": {\"title\": \"vegetation\"}, \"bin\": {\"binned\": true, \"step\": 12.7}, \"field\": \"binStart\"}, \"x2\": {\"field\": \"binEnd\"}, \"y\": {\"field\": \"Frequency\", \"type\": \"quantitative\"}}, \"mark\": \"bar\"};\nconst opt = {};\nconst type = \"vega-lite\";\nconst id = \"b9f4719b-1b6b-4ad0-be3d-eba23571ccaf\";\n\nconst output_area = this;\n\nrequire([\"jupyter-vega\"], function(vega) {\n const target = document.createElement(\"div\");\n target.id = id;\n target.className = \"vega-embed\";\n\n const style = document.createElement(\"style\");\n style.textContent = [\n \".vega-embed .error p {\",\n \" color: firebrick;\",\n \" font-size: 14px;\",\n \"}\",\n ].join(\"\\\\n\");\n\n // element is a jQuery wrapped DOM element inside the output area\n // see http://ipython.readthedocs.io/en/stable/api/generated/\\\n // IPython.display.html#IPython.display.Javascript.__init__\n element[0].appendChild(target);\n element[0].appendChild(style);\n\n vega.render(`#$b9f4719b-1b6b-4ad0-be3d-eba23571ccaf`, spec, type, opt, output_area);\n}, function (err) {\n if (err.requireType !== \"scripterror\") {\n throw(err);\n }\n});\n",
"text/plain": [
"<vega.vegalite.VegaLite at 0x7f2f9317f970>"
"<vega.vegalite.VegaLite at 0x7fa79886d960>"
]
},
"execution_count": 6,
"execution_count": 8,
"metadata": {
"jupyter-vega": "#6683a7db-b092-477b-a13e-4a5822d5d52c"
"jupyter-vega": "#b9f4719b-1b6b-4ad0-be3d-eba23571ccaf"
},
"output_type": "execute_result"
}
Expand All @@ -159,7 +160,8 @@
"time = datetime.strptime(\n",
" '2014-04-01T12:00:00.000Z', \"%Y-%m-%dT%H:%M:%S.%f%z\")\n",
"\n",
"workflow.plot_chart(\n",
"client.workflow_plot_chart(\n",
" workflow,\n",
" ge.QueryRectangle(\n",
" ge.BoundingBox2D(-180.0, -90.0, 180.0, 90.0),\n",
" ge.TimeInterval(time, time),\n",
Expand All @@ -185,7 +187,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.6"
"version": "3.10.12"
},
"vscode": {
"interpreter": {
Expand Down
Loading