{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# 提取空间数据\n", "\n", "参考:[extract](https://pygis.io/docs/e_.html)\n", "\n", "当希望根据特征的位置、属性或与另一个数据集的空间关系选择或分析数据集的一部分时,划分和提取数据非常有用。\n", "\n", "探索三种方式,从 GeoDataFrame 的数据可以被子集化和提取:剪辑,按属性选择位置,和按位置选择。\n", "\n", "## 设置" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import geopandas as gpd\n", "import matplotlib.pyplot as plt\n", "import pandas as pd\n", "from shapely.geometry import Polygon" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "利用旧金山湾区县边界和湾区内及周边 50 公里内的井的形状文件。\n", "\n", "首先加载数据并重新投影数据。\n", "\n", "```{important}\n", "所有数据必须具有相同的坐标系统,以便提取工作正常进行。\n", "```" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3.10.4 ('tvmx': conda)", "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.10.4" }, "orig_nbformat": 4, "vscode": { "interpreter": { "hash": "e579259ee6098e2b9319de590d145b4b096774fe457bdf04260e3ba5c171e887" } } }, "nbformat": 4, "nbformat_minor": 2 }