gemgis.utils.to_section_dict
gemgis.utils.to_section_dict#
- gemgis.utils.to_section_dict(gdf: geopandas.geodataframe.GeoDataFrame, section_column: str = 'section_name', resolution: List[int] = None) dict #
Converting custom sections stored in Shape files to GemPy section_dicts
- Parameters
gdf (gpd.geodataframe.GeoDataFrame) – GeoDataFrame containing the points or lines of custom sections
section_column (str) – String containing the name of the column containing the section names, e.g.
section_column='section_name'
, default is'section_name'
List[int] (resolution -) – List containing the x,y resolution of the custom section, e.g.
resolution=[80,80]
- Returns
section_dict – Dict containing the section names, coordinates and resolution
- Return type
dict
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') >>> gdf id geometry Section 0 None POINT (695.467 3.226) Section1 1 None POINT (669.284 1060.822) Section1
>>> # Creating Section dict >>> section_dict = gg.utils.to_section_dict(gdf=gdf, section_column='Section') >>> section_dict {'Section1': ([695.4667461080886, 3.2262250771374283], [669.2840030245482, 1060.822026058724], [100, 80])}