| 5820 | */ |
| 5821 | |
| 5822 | OGRLayerH 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() */ |
no test coverage detected