# python-shapefile-operate **Repository Path**: fungiser/python-shapefile-operate ## Basic Information - **Project Name**: python-shapefile-operate - **Description**: 利用Python语言对Shapefile进行读写操作。 - **Primary Language**: Python - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 4 - **Forks**: 2 - **Created**: 2021-11-30 - **Last Updated**: 2025-01-06 ## Categories & Tags **Categories**: Uncategorized **Tags**: Python, GIS ## README # python操作矢量文件工具集 [^作者:fungis 描述:一个热带生活、乐于分享、努力搬砖的giser ]: #### 介绍 本文利用Python语言对Shapefile数据进行读写操作,主要工具集有: #### 开发准备 [安装Miniconda软件](https://docs.conda.io/en/latest/miniconda.html#)。Miniconda是一款小巧的python环境管理工具,安装包大约只有55M多点,其安装程序中包含conda软件包管理器和Python。一旦安装了Miniconda,就可以使用conda命令安装任何其他软件工具包并创建环境等。本文是在Windows 10系统下进行下载和安装,在代码中已包含安装包,可以省去下载步骤。 配置清华源。此处需要配置一个清华的镜像服务器,以解决conda下载文件速度慢的问题。 在Anaconda Promot中依次输入以下两条命令: ```python conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ conda config --set show_channel_urls yes ``` 创建python3.8虚拟环境并使用,需要在Anaconda Promot中输入命令 ```python conda create -n python37 python=3.7 conda activate python37 conda install geopandas conda install pandas pip install geojson ... conda install contextily --channel conda-forge ``` ![image-20211130213136555](README.assets/image-20211130213136555.png) #### 工具集 1. 表格转shapefile 2. geojson转shapefile 3. WKT转shapefile 4. shapefile输出geojson 5. shapefile输出WKT