gemgis.vector.set_dtype#

gemgis.vector.set_dtype(gdf: geopandas.geodataframe.GeoDataFrame, dip: str = 'dip', azimuth: str = 'azimuth', formation: str = 'formation', polarity: str = 'polarity', x: str = 'X', y: str = 'Y', z: str = 'Z') geopandas.geodataframe.GeoDataFrame#

Checking and setting the dtypes of the input data GeoDataFrame

Parameters
  • gdf (gpd.geodataframe.GeoDataFrame) – GeoDataFrame containing the input vector data with uncorrected dtypes

  • dip (str) – Name of the column containing the dip data, e.g dip='dip'

  • azimuth (str) – Name of the column containing the azimuth data, e.g azimuth='azimuth'

  • formation (str) – Name of the column containing the formation data, e.g formation='formation'

  • polarity (str) – Name of the column containing the polarity data, e.g polarity='polarity'

  • x (str) – Name of the column containing the x coordinates, e.g x='X'

  • y (str) – Name of the column containing the y coordinates, e.g y='Y'

  • z (str) – Name of the column containing the z coordinates, e.g z='Z'

Returns

gdf – GeoDataFrame containing the input vector data with corrected dtypes

Return type

gpd.geodataframe.GeoDataFrame

New in version 1.0.x.

Example

>>> # Loading Libraries and File
>>> import gemgis as gg
>>> import geopandas as gpd
>>> gdf = gpd.read_file(filename='file.shp')
>>> # Setting the data types
>>> gdf_dtypes = gg.vector.set_dtype(gdf=gdf)