1.GeoJSON 数据
1.1 经纬度数据(EPSG:4326)
gdal_grid -a invdist:power=2.0 -txe 102.620777 102.7881 -tye 24.931334 25.125699 -a_srs EPSG:4326 -outsize 300 259 -zfield c10 -of GTiff -ot Float64 -l dem D:dem.geojson D:dem.tiff
1.2 Web墨卡托数据(EPSG:3857)
gdal_grid -a invdist:power=2.0 -txe 11423692.6404500808566809 11442318.9516080822795630 -tye 2867312.9072038829326630 2891191.8293626653030515 -a_srs EPSG:3857 -outsize 300 259 -zfield c10 -of GTiff -ot Float64 -l dem_3857 D:dem_3857.geojson D:dem_3857.tiff
2.VRT数据
2.1 编辑csv与vrt文件
1.csv文件未指定列名
dem.csv文件:
102.711483,25.05689,0.123
102.662463,25.052893,0.677
102.650627,25.071291,0.296
...
dem.vrt文件:
<OGRVRTDataSource>
<OGRVRTLayer name="dem">
<LayerSRS>EPSG:4326</LayerSRS>
<SrcDataSource>D:dem.csv</SrcDataSource>
<GeometryType>wkbPoint</GeometryType>
<GeometryField encoding="PointFromColumns" x="field_1" y="field_2" z="field_3"/>
<Field name="x" src="field_1" type="Real" />
<Field name="y" src="field_2" type="Real"/>
<Field name="z" src="field_3" type="Real" />
</OGRVRTLayer>
</OGRVRTDataSource>
2.csv文件指定列名
dem.csv文件:
Easting,Northing,Elevation
102.711483,25.05689,0.123
102.662463,25.052893,0.677
102.650627,25.071291,0.296
...
dem.vrt文件:
<OGRVRTDataSource>
<OGRVRTLayer name="dem">
<LayerSRS>EPSG:4326</LayerSRS>
<SrcDataSource>D:dem.csv</SrcDataSource>
<GeometryType>wkbPoint</GeometryType>
<GeometryField encoding="PointFromColumns" x="Easting" y="Northing" z="Elevation" />
<Field name="x" src="Easting" type="Real" />
<Field name="y" src="Northing" type="Real" />
<Field name="z" src="Elevation" type="Real" />
</OGRVRTLayer>
</OGRVRTDataSource>
2.2 执行命令
gdal_grid -a invdist:power=2.0 -txe 102.620777 102.7881 -tye 24.931334 25.125699 -a_srs EPSG:4326 -outsize 300 259 -of GTiff -ot Float64 -l dem D:dem.vrt D:dem.tiff