Cartopy-Installation ==================== .. tab:: Spack Mit :doc:`python4datascience:productive/envs/spack/index` könnt ihr Cartopy in eurem Kernel bereitstellen, :abbr:`z.B. (zum Beispiel)` mit: .. code-block:: console $ spack env activate python-311 $ spack install py-cartopy~epsg~ows~plotting Dies installiert Cartopy mit Unterstützung von: * `epsg `_ * `Open Geospatial Consortium (OGC) `_ * Plot-Funktionalität Zusätzlich werden folgende Pakete mitinstalliert: * `gdal `_ * :doc:`/matplotlib/index` * `OWSLib `_ * `Pillow `_ * `pyepsg `_ * `PyShp `_ * `shapely `_ * `six `_ .. tab:: Linux Cartopy kann alternativ auch mit Linux-Paketmanagern installiert werden, :abbr:`z.B. (zum Beispiel)` für Debian≥9 (Stretch) mit: .. code-block:: console $ sudo apt install proj-bin $ sudo apt install libproj-dev $ sudo apt install libgeos-dev .. tab:: macOS .. code-block:: console $ brew install proj $ brew install geos Anschließend kann Cartopy für euren Kernel installiert werden, :abbr:`z.B. (zum Beispiel)` mit: .. code-block:: console $ export PIP_NO_BINARY=:shapely: $ pipenv install cython numpy cartopy Für die :doc:`examples` benötigt ihr dann zusätzlich die folgenden beiden Python-Pakete: .. code-block:: console $ pipenv install matplotlib scipy Optionale Anforderungen ----------------------- * `rtree `_ für `libspatialindex `_ * `psycopg2 `_ für `PostGIS `_ * `geopy `_ Anforderungen zum Plotten ------------------------- * :doc:`/matplotlib/index` * `descartes `_ * `mapclassify `_ Überprüfen ---------- Schließlich könnt ihr die Installation überprüfen mit: .. code-block:: python >>> import cartopy