OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Geopandas estimating UTM for very small sliver polygon results in `RuntimeError: Unable to determine UTM CRS`

  • Thread starter Thread starter learncode
  • Start date Start date
L

learncode

Guest
I have a geometry that forms a very small narrow polygon in LL CRS, I am trying to use geopandas.GeoDataFrame.estimate_utm_crs() function to convert the geometry to UTM but I an encountering a RuntimeError: Unable to determine UTM CRS

enter image description here

Code:
import geopandas as gpd
from shapely.geometry import Polygon

poly = Polygon([(-91.10097928589327, 89.73568045613413), (-91.09949547975252, 89.73568045604588), (-91.09949519028643, 89.73568904992091), (-91.10097904467153, 89.73568905000914), (-91.10097928589327, 89.73568045613413)])
gdf = gpd.GeoDataFrame(gpd.GeoSeries(poly), columns=['geometry'], crs='EPSG:4326')
display(gdf.crs)
gdf

gdf.estimate_utm_crs()

Used Packages:

  • python 3.10.13
  • geos 3.8.0
  • geopandas 0.14.3
  • shapely 2.0.1
  • proj 9.3.1
<p>I have a geometry that forms a very small narrow polygon in LL CRS, I am trying to use <a href="https://geopandas.org/en/stable/docs/reference/api/geopandas.GeoDataFrame.estimate_utm_crs.html" rel="nofollow noreferrer">geopandas.GeoDataFrame.estimate_utm_crs()</a> function to convert the geometry to UTM but I an encountering a <code>RuntimeError: Unable to determine UTM CRS</code></p>
<p><a href="https://i.sstatic.net/GPkU7yxQ.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/GPkU7yxQ.png" alt="enter image description here" /></a></p>
<pre><code>import geopandas as gpd
from shapely.geometry import Polygon

poly = Polygon([(-91.10097928589327, 89.73568045613413), (-91.09949547975252, 89.73568045604588), (-91.09949519028643, 89.73568904992091), (-91.10097904467153, 89.73568905000914), (-91.10097928589327, 89.73568045613413)])
gdf = gpd.GeoDataFrame(gpd.GeoSeries(poly), columns=['geometry'], crs='EPSG:4326')
display(gdf.crs)
gdf

gdf.estimate_utm_crs()
</code></pre>
<p>Used Packages:</p>
<ul>
<li>python 3.10.13</li>
<li>geos 3.8.0</li>
<li>geopandas 0.14.3</li>
<li>shapely 2.0.1</li>
<li>proj 9.3.1</li>
</ul>
 

Latest posts

Top