ethz-asl / grid_map_geo

Geolocalization for grid map using GDAL.
BSD 3-Clause "New" or "Revised" License
141 stars 19 forks source link

Validate projection is valid #47

Closed Ryanf55 closed 9 months ago

Ryanf55 commented 9 months ago

Purpose

When calling dataset->GetProjectionRef, there is a chance it will return an empty string. This means the projection is invalid. If that's true, the grid map should not be loaded. Without validation, later code may be invalid.

Risks

Low, I tested it on the TIF and SRTM data files, and they both return valid projections.

Reference

https://gdal.org/user/raster_data_model.html#coordinate-system