Skip to main content
added 2 characters in body; edited title
Source Link
Taras
  • 33.9k
  • 4
  • 73
  • 148

Calculate Calculating Azimuth from polygon in GeoPandas

Is there a simple way / ready-to-go function to calculate the azimuth of 2D-polygons polygons in a GeoPandas DataFrameDataFrame? My goal is to eventually compute azimuth angles of building footprints.

Most of the functions I have found explicitly calculate the azimuth for a line, which is not what I am looking for. I have been thinking along the following lines to calculate the azimuth of a polygon using its normal vector (2 dimensions). Is my approach going intoin the right directionsdirection? 

I am a bit unsure how to adjust for the quadrants, also my results seem a bit odd.

azimuth = 90 - math.degrees(math.atan2(normal[1], normal[0]))
if azimuth >= 360.0:
    azimuth -= 360.0
elif azimuth < 0.0:
    azimuth += 360.0

Calculate Azimuth from polygon in GeoPandas

Is there a simple way / ready-to-go function to calculate the azimuth of 2D-polygons in a GeoPandas DataFrame? My goal is to eventually compute azimuth angles of building footprints.

Most of the functions I have found explicitly calculate the azimuth for a line, which is not what I am looking for. I have been thinking along the following lines to calculate the azimuth of a polygon using its normal vector (2 dimensions). Is my approach going into the right directions? I am a bit unsure how to adjust for the quadrants, also my results seem a bit odd.

azimuth = 90 - math.degrees(math.atan2(normal[1], normal[0]))
if azimuth >= 360.0:
    azimuth -= 360.0
elif azimuth < 0.0:
    azimuth += 360.0

Calculating Azimuth from polygon in GeoPandas

Is there a simple way / ready-to-go function to calculate the azimuth of 2D polygons in a GeoPandas DataFrame? My goal is to eventually compute azimuth angles of building footprints.

Most of the functions I have found explicitly calculate the azimuth for a line, which is not what I am looking for. I have been thinking along the following lines to calculate the azimuth of a polygon using its normal vector (2 dimensions). Is my approach going in the right direction? 

I am a bit unsure how to adjust for the quadrants, also my results seem a bit odd.

azimuth = 90 - math.degrees(math.atan2(normal[1], normal[0]))
if azimuth >= 360.0:
    azimuth -= 360.0
elif azimuth < 0.0:
    azimuth += 360.0
Tweeted twitter.com/StackGIS/status/1335464023945580549
Became Hot Network Question
edited tags
Link
gene
  • 55.4k
  • 3
  • 113
  • 191
deleted 10 characters in body
Source Link
Kadir Şahbaz
  • 78k
  • 57
  • 257
  • 404

Is there a simple way / ready-to-go function to calculate the azimuth of 2D-polygons in a GeoPandas DataFrame? My goal is to eventually compute azimuth angles of building footprints.

Most of the functions I have found explicitly calculate the azimuth for a line, which is not what I am looking for. I have been thinking along the following lines to calculate the azimuth of a polygon using its normal vector (2 dimensions). Is my approach going into the right directions? I am a bit unsure how to adjust for the quadrants, also my results seem a bit odd.

azimuth = 90 - math.degrees(math.atan2(normal[1], normal[0]))
if azimuth >= 360.0:
    azimuth -= 360.0
elif azimuth < 0.0:
    azimuth += 360.0
azimuth = 90 - math.degrees(math.atan2(normal[1], normal[0]))
if azimuth >= 360.0:
    azimuth -= 360.0
elif azimuth < 0.0:
    azimuth += 360.0

Is there a simple way / ready-to-go function to calculate the azimuth of 2D-polygons in a GeoPandas DataFrame? My goal is to eventually compute azimuth angles of building footprints.

Most of the functions I have found explicitly calculate the azimuth for a line, which is not what I am looking for. I have been thinking along the following lines to calculate the azimuth of a polygon using its normal vector (2 dimensions). Is my approach going into the right directions? I am a bit unsure how to adjust for the quadrants, also my results seem a bit odd.

azimuth = 90 - math.degrees(math.atan2(normal[1], normal[0]))
if azimuth >= 360.0:
    azimuth -= 360.0
elif azimuth < 0.0:
    azimuth += 360.0

Is there a simple way / ready-to-go function to calculate the azimuth of 2D-polygons in a GeoPandas DataFrame? My goal is to eventually compute azimuth angles of building footprints.

Most of the functions I have found explicitly calculate the azimuth for a line, which is not what I am looking for. I have been thinking along the following lines to calculate the azimuth of a polygon using its normal vector (2 dimensions). Is my approach going into the right directions? I am a bit unsure how to adjust for the quadrants, also my results seem a bit odd.

azimuth = 90 - math.degrees(math.atan2(normal[1], normal[0]))
if azimuth >= 360.0:
    azimuth -= 360.0
elif azimuth < 0.0:
    azimuth += 360.0
naming; removed help appreciation
Source Link
Vince
  • 20.3k
  • 16
  • 48
  • 65
Loading
Source Link
inneb
  • 175
  • 2
  • 5
Loading