Beispiel #1
0
"""

import matplotlib.pyplot as plt
from geoist.others.gdal import GDALGrid
from geoist.others.utils import map2DGrid, Grid2xyz

import warnings
warnings.simplefilter("ignore")

filename1 = 'D:\\research-work\\Topex\\WGM2012\\WGM2012_ETOPO1_ponc_2min.grd'
filename2 = 'D:\\research-work\\Topex\\WGM2012\\WGM2012_Freeair_ponc_2min.grd'
filename3 = 'D:\\research-work\\Topex\\WGM2012\\WGM2012_Bouguer_ponc_2min.grd'
filename4 = 'D:\\research-work\\Topex\\WGM2012\\WGM2012_Isostatic_ponc_2min.grd'

# 通过GDAL库读取网格数据
gd1, ff = GDALGrid.getFileGeoDict(filename1)
gd2, ff = GDALGrid.getFileGeoDict(filename2)
gd3, ff = GDALGrid.getFileGeoDict(filename3)

print(gd1)
gd1.xmin = 70.0
gd1.xmax = 105.0
gd1.ymin = 15.0
gd1.ymax = 45.0
gd1.nx = 800
gd1.ny = 600

# 读取指定区域
topo = GDALGrid.load(filename1, samplegeodict=gd1, resample=True)
f*g = GDALGrid.load(filename2, samplegeodict=gd1, resample=True)
bug = GDALGrid.load(filename3, samplegeodict=gd1, resample=True)
Beispiel #2
0
"""
Created on Sun Apr 12 22:46:16 2020

@author: chens
"""

import matplotlib.pyplot as plt
from pathlib import Path
from geoist import DATA_PATH
from geoist.others.gdal import GDALGrid
from geoist.others.utils import map2DGrid, Grid2Xyz, xyz2Grid, grid2srf

# 1.读取数据

filename1 = Path(DATA_PATH, 'ynyx_elev.grd')
gd1, ff = GDALGrid.getFileGeoDict(filename1)
grid1 = GDALGrid.load(filename1, gd1)
filename2 = Path(DATA_PATH, 'ynyx_fga.grd')
gd2, ff = GDALGrid.getFileGeoDict(filename2)
grid2 = GDALGrid.load(filename2, gd2)
filename3 = Path(DATA_PATH, 'ynyx_bgas.grd')
gd3, ff = GDALGrid.getFileGeoDict(filename3)
grid3 = GDALGrid.load(filename3, gd3)
filename4 = Path(DATA_PATH, 'ynyx_bgar.grd')
gd4, ff = GDALGrid.getFileGeoDict(filename4)
grid4 = GDALGrid.load(filename4, gd4)

from geoist.pfm import pftrans
from geoist.vis import giplt

x, y, elev = Grid2Xyz(grid1)