MCPcopy Create free account
hub / github.com/OSGeo/gdal / GDALDatasetCreateLayer

Function GDALDatasetCreateLayer

gcore/gdaldataset.cpp:5822–5849  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5820*/
5821
5822OGRLayerH GDALDatasetCreateLayer(GDALDatasetH hDS, const char *pszName,
5823 OGRSpatialReferenceH hSpatialRef,
5824 OGRwkbGeometryType eGType,
5825 CSLConstList papszOptions)
5826
5827{
5828 VALIDATE_POINTER1(hDS, "GDALDatasetCreateLayer", nullptr);
5829
5830 if (pszName == nullptr)
5831 {
5832 CPLError(CE_Failure, CPLE_ObjectNull,
5833 "Name was NULL in GDALDatasetCreateLayer");
5834 return nullptr;
5835 }
5836
5837 OGRLayerH hLayer =
5838 OGRLayer::ToHandle(GDALDataset::FromHandle(hDS)->CreateLayer(
5839 pszName, OGRSpatialReference::FromHandle(hSpatialRef), eGType,
5840 const_cast<char **>(papszOptions)));
5841
5842#ifdef OGRAPISPY_ENABLED
5843 if (bOGRAPISpyEnabled)
5844 OGRAPISpy_DS_CreateLayer(hDS, pszName, hSpatialRef, eGType,
5845 const_cast<char **>(papszOptions), hLayer);
5846#endif
5847
5848 return hLayer;
5849}
5850
5851/************************************************************************/
5852/* GDALDatasetCreateLayerFromGeomFieldDefn() */

Callers 1

Calls 5

CPLErrorFunction · 0.85
OGRAPISpy_DS_CreateLayerFunction · 0.85
ToHandleFunction · 0.70
FromHandleFunction · 0.70
CreateLayerMethod · 0.45

Tested by

no test coverage detected