当前位置: 首页 > news >正文

专业做汽车的网站/百度浏览器网址链接

专业做汽车的网站,百度浏览器网址链接,hpsocket 网站开发,开发一个app最少需要多少钱有没有办法在python中合并两个重叠的GEOJSON多边形,返回一个合并的GEOJSON对象?解决方法:这就是我能够使用functools中的包/模块json,geojson,shapely,pyproj和partial来实现它的方法:import jsonimport geojsonfrom functools import partialimport pyp…

有没有办法在python中合并两个重叠的GEOJSON多边形,返回一个合并的GEOJSON对象?

解决方法:

这就是我能够使用functools中的包/模块json,geojson,shapely,pyproj和partial来实现它的方法:

import json

import geojson

from functools import partial

import pyproj

import shapely.geometry

import shapely.ops

# reading into two geojson objects, in a GCS (WGS84)

with open('file1.json') as geojson1:

poly1_geojson = json.load(geojson1)

with open('file2.json') as geojson2:

poly2_geojson = json.load(geojson2)

# pulling out the polygons

poly1 = shapely.geometry.asShape(poly1_geojson['features'][2]['geometry'])

poly2 = shapely.geometry.asShape(poly2_geojson['features'][2]['geometry'])

# checking to make sure they registered as polygons

print poly1.geom_type

print poly2.geom_type

# merging the polygons - they are feature collections, containing a point, a polyline, and a polygon - I extract the polygon

# for my purposes, they overlap, so merging produces a single polygon rather than a list of polygons

mergedPolygon = poly1.union(poly2)

# using geojson module to convert from WKT back into GeoJSON format

geojson_out = geojson.Feature(geometry=mergedPolygon, properties={})

# outputting the updated geojson file - for mapping/storage in its GCS format

with open('Merged_Polygon.json', 'w') as outfile:

json.dump(geojson_out.geometry, outfile, indent=3, encoding="utf-8")

outfile.close()

# reprojecting the merged polygon to determine the correct area

# it is a polygon covering much of the US, and dervied form USGS data, so using Albers Equal Area

project = partial(

pyproj.transform,

pyproj.Proj(init='epsg:4326'),

pyproj.Proj(init='epsg:5070'))

mergedPolygon_proj = shapely.ops.transform(project,mergedPolygon)

标签:python,geojson

http://www.jmfq.cn/news/4948309.html

相关文章:

  • 网页模板是已经做好的/公众号排名优化软件
  • 我要做网站推广/搜索大全搜索引擎
  • 网站建设费会计账务处理/在线代理浏览国外网站
  • 如何找做网站的公司/微营销软件
  • 怎样做网站备案/竞价推广账户竞价托管
  • 收益网站制作/百度seo搜索引擎优化方案
  • 津南做网站的公司/百度小说排行榜总榜
  • 如何用模版做网站/公司网址
  • wordpress文章提交/武汉seo 网络推广
  • 大城b2c网站建设价格/seo优化的主要任务包括
  • 怎样做视频网站/网络营销的特点包括
  • 做班级玩网站做哪些方面/硬件工程师培训机构哪家好
  • 做网站建设网站制作/企业网站建设方案策划
  • 网站名称和备案名称不一样/网站策划书模板
  • 淮安市建设工程施工图审查处网站/chatgpt 网站
  • 网站关键词越多越好吗/网址查询域名
  • 免费个人网站模板/郑州计算机培训机构哪个最好
  • 沈阳做网站的公司推荐/广告投放平台
  • 公司做网站找谁做网站的公司/天津seo霸屏
  • 四川省的住房和城乡建设厅网站/上海最新政策
  • 个人网站 服务器/需要推广的app在哪里找
  • 做网站横幅 的网站推荐几个/超八成搜索网站存在信息泄露问题
  • 用来做区位分析的地图网站/最快新闻资讯在哪看
  • 自己建网站做推广/无锡百度公司王东
  • jsp网站开发教学/百度网站推广申请
  • 北京最大网站建设公司排名/全网投放广告的渠道有哪些
  • 电商网站方案/百度关键词排名点击
  • 做网站用微软雅黑侵权吗/怎么做网站推广多少钱
  • 晋州做网站/视频号下载器手机版
  • 做网站用笔记本做服务器吗/网络推广软文范文