给SHP文件定义投影
文件 定义 投影 shp
2023-09-11 14:19:52 时间
#!/usr/bin/env python # -*- coding: utf-8 -*- import urllib.request import os def get_epsg_code(epsg): """ Get the ESRI formatted .prj definition usage get_epsg_code(4326) We use the http://spatialreference.org/ref/epsg/4326/esriwkt/ """ f=urllib.request.urlopen("http://spatialreference.org/ref/epsg/{0}/esriwkt/".format(epsg)) return (f.read()) # Shapefile filename must equal the new .prj filename shp_filename = "UTM_Zone_Boundaries" # path to where Shapefile with no .prj is located os.chdir("../geodata/") # Here we write out a new .prj file with the same name # as our Shapefile named "schools" in this example with open("%s.prj" % shp_filename, "wb") as prj: epsg_code = get_epsg_code(4326) print(epsg_code) prj.write(epsg_code) print("done writing projection definition " + prj.name + "to EPSG:" + str(epsg_code)) # now change abck to our code directory os.chdir("../code/")
相关文章
- Webstorm/Phpstorm中设置连接FTP,并快速进行文件比较,上传下载,同步等操作
- 弹性文件服务解密 -- 应用场景区分
- 在Python中操作文件之truncate()方法的使用教程
- Linux基础之linux服务器服务器间拷贝文件
- user.config.ts文件里定义的配置是如何合并到SAP Spartacus的标准配置里去的
- SAP CRM content management中文件下载的调试
- SAP UI5 如何通过 manifest.json 文件定义第三方库依赖关系
- GraphQL的schema定义文件加载到内存里的例子
- Android 文件按时间,大小,修改日期,类型的排序
- 第37篇 QML中导入定义的JS文件
- 习题 8.5 将本章的例8.4改写为一个多文件的程序:1.将类定义放在头文件arraymax.h中;2.将成员函数定义放在源文件arraymax.cpp中;3.主函数放在源文件file1.cpp中。
- 习题 12.1 在例12.1程序基础上作一些修改。定义Point类,由Point类派生出Circle类,再由Circle类派生出Cylinder类。将类的定义部分分别作为3个头文件,对它们的成员。。。
- 【Groovy】闭包 Closure ( 闭包定义 | 闭包类型 | 查看编译后的字节码文件中的闭包类型变量 )
- Win10之防止删除正常文件
- C语言之读/写(fread/fwrite)文件(五十八)
- Matlab使用笔记(一): m文件中定义多个函数直接运行
- VMware 恢复快照出现 无法创建 5040 MB 的匿名分页文件: 系统资源不足,无法完成请求的服务