![](/img/trans.png)
[英]Getting the shortest path geometry using python networkx
如何從 .networkx 獲取路徑作為幾何圖形? 下面是我的工作示例,它返回nx.shortest_path_length 這給出了最短路徑長度223.964 ,我如何獲得這條最短路徑的實際路徑幾何? 路徑在edges ,但如何為這條路徑提取正確的路徑? ...
[英]Getting the shortest path geometry using python networkx
如何從 .networkx 獲取路徑作為幾何圖形? 下面是我的工作示例,它返回nx.shortest_path_length 這給出了最短路徑長度223.964 ,我如何獲得這條最短路徑的實際路徑幾何? 路徑在edges ,但如何為這條路徑提取正確的路徑? ...
[英]How to use plotly with geodataframe geometry
我想要 plot geojson/geometry map 和 plotly 滑塊(時間)。 這是我的 gdf 的樣子: 我有幾個不同年份和月份的文件,它們的不同值對應於鍵/幾何對。 我想要 plot 的東西所以我有一個時間 slider 並且可以很容易地可視化每個區域的值隨時間的變化。 我看到 p ...
[英]Convert pandas column with featurecollection to GeoJSON
我下載了一個 CSV,其中包含一個具有 GeoJSON 格式的列,並將其導入為 pandas dataframe。如何將其轉換為 GeoJSON (.geojson)? 我有大約 10,000 行,每行的信息如下所示: 這是列中單元格的示例:{"type":"FeatureCollection", ...
[英]How to get one uniform colorbar and color scale for multiple GeoPandas plots
我有 3 個 geopandas 圖,我想要一個顏色條和所有三個圖的相同(顏色)限制。 這是我的情節代碼: 這是我現在的 plot: 在此處輸入圖像描述任何幫助將不勝感激。 我嘗試將 fig.colorbar() 與各種不同的 arguments 一起使用。我遇到了屬性錯誤和類型錯誤。 我也嘗試使用 ...
[英]Calculate the length of a polygon in python
我有一個 geopandas dataframe: 我從所有這些點中創建了一個多邊形,如下所示: output 是一個多邊形: 我怎樣才能得到以米為單位的長度? 例如,獲取 map 上第一個零售商和最后一個零售商之間的距離,以便它呈現一條可以測量的形狀。 我試過這段代碼: 它給出了:5.04009 ...
[英]How to parallelize a pandas UDF in polars (h3 polyfill) for string typed UDF outputs?
我想在 Polars 中將以下 python 代碼行作為 UDF 執行: 在大熊貓/大熊貓中: 這工作超級快速和容易。 但是,從 pandas 調用的 polyfill function 作為 UDF 應用對於我的數據集的大小來說太慢了。 相反,我很想使用 polars 但我遇到了幾個問題: 不理 ...
[英]Getting "AttributeError: module 'shapely.geos' has no attribute 'lgeos'"
我正在嘗試從 momepy ( https://github.com/pysal/momepy/blob/main/docs/user_guide/getting_started.ipynb ) 做這個練習,但是在第三個代碼塊上 我收到以下錯誤 不完全確定我是否缺少模塊或庫不兼容 ...
[英]Using geopandas to explore a geojson LineString
我有以下 python 代碼: 當我運行它時,它會生成警告: UserWarning:GeoJsonTooltip 未配置為呈現 GeoJson GeometryCollection 幾何圖形。 請考慮重新設計這些功能:[{'provider': 'MyProvider'}] 到 MultiPo ...
[英]How to create polygon from bbox data in python?
我在 R 中創建了一個代碼,它從點列表中提取bbox ,然后使用st_as_sfc創建一個多邊形。 現在我試圖在 python 中做同樣的事情,在那里我能夠從點數據列表中獲取bbox坐標,然后嘗試借助拋出錯誤的shapely.geometry使用這兩個點創建多邊形。 st_as_sfc中是否有 ...
[英]Fastest way to plot geopandas map
我有一個 Streamlit 應用程序,我想在其中 plot 一個由 14 個國家/地區組成的等值線 map。 我有使用 Geopandas 加載的 .shp 文件。 我嘗試使用 plot plotly.express choropleth map 對數據進行 plot,但渲染大約需要 2-3 分鍾 ...
[英]deep copy of GeoDataFrame becomes Pandas DataFrame
當我geopandas.GeoDataFrame沒有“幾何”列的geopandas.GeoDataFrame時,副本變為pandas.DataFrame 。 為什么會這樣? 我查看了 Github 上的主要分支,Pandas 和 Geopandas 都沒有覆蓋__deepcopy__ 。 Out ...
[英]error while assigning new geometry in geodataframe
我在嘗試在地理數據框中分配新幾何體時遇到了一些問題。 我的原始地理數據框幾何是 LINESTRING Z,我確實將其轉換為 LINESTRING,但我無法評估新幾何。 我的代碼: 我得到:Value should be either a BaseGeometry or None, got LINES ...
[英]How to convert convert one column in csv to two separate files: a shape file and an osm file in Python?
我有一個包含出租車行程的.csv文件,其中一列稱為trip_coordinates ,存儲為字符串,例如,一個行程坐標如下所示(存儲為字符串:): 使用這些坐標,我能夠創建一個 LINESTRING 並將其存儲回原始.csv文件中名為route_linestring的列中,方法如下: 上面的數組或 ...
[英]Converting Compound Geometry class to Geopandas dataframe
我想將使用section-properties創建的幾何圖形轉換為 geopandas 數據框以進行進一步處理。 但是我很難相應地解析結構。 這是對文檔中示例 07的修改。 請注意,我必須在多個位置將 from shapely 替換from shapely from shapely.geometr ...
[英]Retrieve campsites within a specific radius around a gpx route from OSM
即將到來 spring 我將從阿姆斯特丹步行到羅馬。 我已經計划好了路線。 現在我想在路線周圍找到露營地,並找到我永遠不必在路線周圍的露營地之間步行超過 35 公里的最佳方式。 有沒有人有什么建議? ...
[英]Matplotlib pick_event not working with geopandas dataframe
這是我的Jupyer Notebook 源代碼。 但是下面是一個硬編碼的可重現示例。 (您需要從我的 Github 或真實來源訪問 UK.geojson 文件: http://geoportal1-ons.opendata.arcgis.com/datasets/687f346f5023410b ...
[英]Simple check for projected crs
我如何輕松檢查 crs 是否是 geopandas 的預測? 基本上是一個 function: 返回 True 或 False。 我需要它,因為我正在編寫一些代碼來避免來自 geopandas 的警告: ...
[英]Find point where touching geometries touch each other
我有一個帶有 LineStrings 的 GeoDataFrame 並且想要獲取幾何圖形相互接觸的所有坐標。 到目前為止,我可以找到相互接觸的人,但是如何獲得接觸點的坐標? 它應該盡可能快,因為我有很多數據。 ...
[英]I want to add a legend in folium map to the code below
此代碼顯示以下 output 我想制作一個圖例,藍色標記代表“其他醫院”,紅色標記代表“代頓” ...
[英]How read .shp files in databricks from filestore?
我正在使用 Databricks 社區,並將 a.shp 保存在 FileStore 中,但是當我嘗試讀取時出現此錯誤: 這是我的代碼 我也試過 ...