python - Geopandas 空间连接不返回任何行
问题描述
我正在尝试对我的地理数据框进行空间连接,其中每一行都是访问者
我的 GeoJSON 在这里
import geopandas as gpd
geo_json = gpd.read_file('http://geoportal1-ons.opendata.arcgis.com/datasets/01fd6b2d7600446d8af768005992f76a_0.geojson?outSR={%22latestWkid%22:27700,%22wkid%22:27700}')
几何看起来像这样 - 它不是坐标
多面体(((398583.804 653093.703, 398601....
crs看起来像这样
<Geographic 2D CRS: EPSG:4326>
Name: WGS 84
Axis Info [ellipsoidal]:
- Lat[north]: Geodetic latitude (degree)
- Lon[east]: Geodetic longitude (degree)
Area of Use:
- name: World
- bounds: (-180.0, -90.0, 180.0, 90.0)
Datum: World Geodetic System 1984
- Ellipsoid: WGS 84
- Prime Meridian: Greenwich
我的访问者数据中的坐标如下所示 POINT (-2.64185 53.55189)
如果我运行空间连接,并保持与地理 json 相同的 crs,我将没有行
customers = pd.DataFrame({'visitor':[1],'geometry':[Point(0.26371,51.15565)]})
customers_geo = gpd.GeoDataFrame(customers,
crs = geo_json.crs,
geometry = customers.geometry)
customers_geo.head()
spatial_join = gpd.sjoin(geo_json, customers_geo, op = 'contains')
spatial_join
为什么会这样?如果我使用其他 GeoJSON,我会得到行
解决方案
推荐阅读
- nearprotocol - 获取 storaged u64 的默认值
- c++ - 如何从屏幕坐标中获取世界空间坐标
- c# - 在 .NET 4.5 应用程序中启用 TLS1.2
- html - 怎么只有 1 个 div 不会与 flexbox 中的其他 div 一起收缩?
- asp.net - oracle.dataaccess.dll 与 oracle.manageddataaccess.dll 有什么区别以及托管 dll 相对于数据访问 dll 的优势是什么
- html - GO SDK for Google Translation api 返回 HTML 而不是 JSON 响应
- c++ - 如何让循环移动到下一行?
- amazon-web-services - 如何拥有具有多个公共 IP 的单个 NAT 网关?
- macos - 为什么在“applicationDidEnterBackground”之后单击关闭按钮会调用“applicationWillTerminate”,而单击最小化按钮却没有?
- excel - 仅对表格中的行着色,而不是对所有行着色