GDALSetProjection使用的一个注意事项

GDALSetProjection使用注意事项
GDALSetProjection用于设定数据集的投影信息,支持OGC WKT或PROJ.4格式。由于它是虚函数,具体实现因数据格式而异,可能导致错误,如数据集不可写或不支持特定投影。某些格式如GTiff支持PROJ.4,而MBTiles可能只支持WKT,并且通常对地理或投影坐标有限制。OGC WKT格式通常最通用,而PROJ.4则较宽松但不做验证。

GDALSetProjection 简述

GDALSetProjection是用来给GDALDataset设定投影信息(坐标系统)的接口,实际上是GDALDataset::SetProjection这个虚函数的转调而已。官网文档描述如下:

CPLErr GDALDataset::SetProjection (const char * pszProjection )
Set the projection reference string for this dataset.
The string should be in OGC WKT or PROJ.4 format. An error may occur because of incorrectly specified projection strings, because the dataset is not writable, or because the dataset does not support the indicated projection. Many formats do not support writing projections.
This method is the same as the C GDALSetProjection() function.
Parameters
pszProjection projection reference string.
Returns
CE_Failure if an error occurs, otherwise CE_None.

按照这里描述的,传入的参数可以是OG

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值