{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Usage as a Python library" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This library can be used as a python library. The following examples intended to demonstrate the library usage." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This example shows how to extract bounding box from a single file" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "scrolled": true }, "outputs": [ { "data": { "text/plain": [ "{'format': 'application/geojson',\n", " 'crs': 4326,\n", " 'bbox': [7.60168075561523,\n", " 51.9488147720619,\n", " 7.64725685119629,\n", " 51.9746240298775]}" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import geoextent.lib.extent as geoextent\n", "\n", "geoextent.fromFile('tests/testdata/geojson/muenster_ring_zeit.geojson', True, False)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "([source of file muenster_ring_zeit.geojson](https://github.com/o2r-project/geoextent/blob/master/tests/testdata/geojson/muenster_ring_zeit.geojson))\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This example shows how to extract time interval from a single file" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "scrolled": true }, "outputs": [ { "data": { "text/plain": [ "{'format': 'application/geojson', 'tbox': ['2018-11-14', '2018-11-14']}" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import geoextent.lib.extent as geoextent\n", "\n", "geoextent.fromFile('tests/testdata/geojson/muenster_ring_zeit.geojson', False, True)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "([source of file muenster_ring_zeit.geojson](https://github.com/o2r-project/geoextent/blob/master/tests/testdata/geojson/muenster_ring_zeit.geojson))" ] }, { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "This example shows how to extract both bounding box and time interval from a single file" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "scrolled": true }, "outputs": [ { "data": { "text/plain": [ "{'format': 'application/geojson',\n", " 'tbox': ['2018-11-14', '2018-11-14'],\n", " 'crs': 4326,\n", " 'bbox': [7.60168075561523,\n", " 51.9488147720619,\n", " 7.64725685119629,\n", " 51.9746240298775]}" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import geoextent.lib.extent as geoextent\n", "\n", "geoextent.fromFile('tests/testdata/geojson/muenster_ring_zeit.geojson', True, True)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "([source of file muenster_ring_zeit.geojson](https://github.com/o2r-project/geoextent/blob/master/tests/testdata/geojson/muenster_ring_zeit.geojson))" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.9" } }, "nbformat": 4, "nbformat_minor": 4 }