gemgis.vector.calculate_azimuth#

gemgis.vector.calculate_azimuth(gdf: Union[geopandas.geodataframe.GeoDataFrame, List[shapely.geometry.linestring.LineString]]) List[Union[int, float]]#

Calculating the azimuth for an orientation Geodataframe represented by LineStrings

Parameters

gdf (Union[gpd.geodataframe.GeoDataFrame, List[shapely.geometry.linestring.LineString]) – GeoDataFrame or list containing the LineStrings of orientations

Returns

azimuth_list – List containing the azimuth values of the orientation LineString

Return type

List[Union[float, int]]

New in version 1.0.x.

Example

>>> # Loading Libraries and creating LineString
>>> import gemgis as gg
>>> from shapely.geometry import LineString
>>> import geopandas as gpd
>>> linestring1 = LineString([(0, 0), (20, -20)])
>>> linestring1.wkt
'LINESTRING (0 0, 20 -20)'
>>> # Creating second LineString
>>> linestring2 = LineString([(0, 0), (20, -10)])
>>> linestring2.wkt
'LINESTRING (0 0, 20 -10)'
>>> # Creating GeoDataFrame from LineStrings
>>> gdf = gpd.GeoDataFrame(geometry=[linestring1, linestring2])
>>> gdf
    geometry
0       LINESTRING (0.0 0.0, 20.0 -20.0)
1       LINESTRING (0.0 0.0, 20.0 -10.0)
>>> # Calculating the azimuths of the LineStrings
>>> azimuths = gg.vector.calculate_azimuth(gdf=gdf)
>>> azimuths
[135.0, 116.56505117707799]

See also

create_linestring_from_points

Create LineString from points

create_linestring_gdf

Create GeoDataFrame with LineStrings from points

extract_orientations_from_map

Extracting orientations from a map

calculate_distance_linestrings

Calculating the distance between LineStrings

calculate_orientations_from_strike_lines

Calculating the orientations from strike lines