diff --git a/src/grid_map_geo.cpp b/src/grid_map_geo.cpp index 82f617e..6e31e2f 100644 --- a/src/grid_map_geo.cpp +++ b/src/grid_map_geo.cpp @@ -78,6 +78,13 @@ bool GridMapGeo::initializeFromGeotiff(const std::string &path, bool align_terra } const char *pszProjection = dataset->GetProjectionRef(); + + if (strlen(pszProjection) == 0) { + // https://gdal.org/user/raster_data_model.html#coordinate-system + std::cerr << std::endl << "Wkt ProjectionRef is unknown!" << std::endl; + return false; + } + std::cout << std::endl << "Wkt ProjectionRef: " << pszProjection << std::endl; // Get image metadata