<div dir="ltr">Hi,<div><br></div><div>I have a problem with getting spatial reference of one layer in MS SQL Server. When I run following command everything is just file, I'm getting WKT description of layer's spatial reference.</div>
<div><br></div><div>ogrinfo -so MSSQL:server=ORASRV;database=uap;uid=xxx;pwd=xxx SDE.USES_p --config GDAL_DATA D:\projekty\GDAL\install\data</div><div><br></div><div>But when I do something similar with C++ API, I'm getting NULL :-(</div>
<div><br></div><div>OGRDataSource *ds;<br></div><div>OGRLayer *layer;</div><div>OGRSpatialReference *sr;</div><div><br></div><div>CPLSetConfigOption("GDAL_DATA", "D:\projekty\GDAL\install\data");<br></div>
<div>ds = OGRSFDriverRegistrar::Open("MSSQL:server=ORASRV;database=uap;uid=xxx;pwd=xxx");<br></div><div>layer = ds->GetLayerByName("SDE.USES_p");</div><div>sr = layer->GetSpatialRef();</div><div>
<br></div><div>Am I doing something wrong?</div><div><br></div><div>Thanks a lot for your help.</div><div><br></div><div>Michal</div><div><br></div><div><br></div></div>