Loading...
Loading...
Compare original and translation side by side
import gemgis as gg
import geopandas as gpdimport gemgis as gg
import geopandas as gpdundefinedundefined| Module | Purpose |
|---|---|
| Vector data processing, XYZ extraction |
| Raster/DEM processing, sampling, interpolation |
| Utility functions, extent management |
| Model postprocessing |
| 模块 | 用途 |
|---|---|
| 矢量数据处理、XYZ坐标提取 |
| 栅格/DEM处理、采样、插值 |
| 工具函数、范围管理 |
| 模型后处理 |
contacts = gpd.read_file('contacts.shp')
interfaces = gg.vector.extract_xyz(gdf=contacts, dem='dem.tif')
interfaces['formation'] = contacts['formation']contacts = gpd.read_file('contacts.shp')
interfaces = gg.vector.extract_xyz(gdf=contacts, dem='dem.tif')
interfaces['formation'] = contacts['formation']undefinedundefinedmeasurements = gpd.read_file('structural_measurements.shp')
orientations = gg.vector.extract_xyz(gdf=measurements, dem='dem.tif')
orientations['dip'] = measurements['dip']
orientations['azimuth'] = measurements['strike'] + 90 # strike to dip direction
orientations['formation'] = measurements['formation']measurements = gpd.read_file('structural_measurements.shp')
orientations = gg.vector.extract_xyz(gdf=measurements, dem='dem.tif')
orientations['dip'] = measurements['dip']
orientations['azimuth'] = measurements['strike'] + 90 # 走向转倾向方位角
orientations['formation'] = measurements['formation']profile = gg.raster.sample_from_raster(
raster='dem.tif',
line=[(500000, 5600000), (510000, 5605000)],
n_samples=100
)profile = gg.raster.sample_from_raster(
raster='dem.tif',
line=[(500000, 5600000), (510000, 5605000)],
n_samples=100
)undefinedundefinedundefinedundefinedundefinedundefinedfrom shapely.geometry import box
extent_poly = box(500000, 5600000, 510000, 5610000)
gdf_clipped = gdf.clip(extent_poly)from shapely.geometry import box
extent_poly = box(500000, 5600000, 510000, 5610000)
gdf_clipped = gdf.clip(extent_poly)undefinedundefinedundefinedundefinedundefinedundefined| Format | Extension | Read | Write |
|---|---|---|---|
| Shapefile | .shp | Yes | Yes |
| GeoJSON | .geojson | Yes | Yes |
| GeoPackage | .gpkg | Yes | Yes |
| GeoTIFF | .tif | Yes | Yes |
| ASCII Grid | .asc | Yes | Yes |
| 格式 | 扩展名 | 读取 | 写入 |
|---|---|---|---|
| Shapefile | .shp | 是 | 是 |
| GeoJSON | .geojson | 是 | 是 |
| GeoPackage | .gpkg | 是 | 是 |
| GeoTIFF | .tif | 是 | 是 |
| ASCII Grid | .asc | 是 | 是 |
| EPSG | Description |
|---|---|
| 4326 | WGS84 (lat/lon) |
| 32632 | UTM Zone 32N |
| 32633 | UTM Zone 33N |
| EPSG | 描述 |
|---|---|
| 4326 | WGS84(经纬度) |
| 32632 | UTM 32N带 |
| 32633 | UTM 33N带 |
| Scenario | Recommendation |
|---|---|
| Prepare GIS data for GemPy modelling | GemGIS - purpose-built bridge between GIS and GemPy |
| General geospatial analysis in Python | geopandas + rasterio - more flexible, larger community |
| GUI-based geological map processing | QGIS - visual, interactive, plugin ecosystem |
| Extract XYZ + elevation from shapefiles and DEMs | GemGIS - one-liner with |
| Complex raster analysis pipelines | rasterio + xarray - more control and scalability |
| 场景 | 推荐方案 |
|---|---|
| 为GemPy建模准备GIS数据 | GemGIS - 专为GIS与GemPy搭建的桥梁工具 |
| Python中通用地理空间分析 | geopandas + rasterio - 灵活性更高,社区更庞大 |
| 基于GUI的地质图处理 | QGIS - 可视化、交互式,拥有插件生态系统 |
| 从shapefile和DEM中提取XYZ坐标与高程 | GemGIS - 一行代码调用 |
| 复杂栅格分析流水线 | rasterio + xarray - 可控性与扩展性更强 |
gpd.read_file()gdf.to_crs()gg.utils.set_extent()gg.vector.clip_by_extent()gg.vector.extract_xyz(gdf, dem)gpd.read_file()gdf.to_crs()gg.utils.set_extent()gg.vector.clip_by_extent()gg.vector.extract_xyz(gdf, dem)