SpatialException - Fix warnings
Fix the use of sprintf.
Additionally, 'delete []' does a nullptr check anyway, so checking it on your side increases the overhead and looks ugly. It is a very good practice to set the pointer to nullptr after delete (helps to avoid double delete and other similar memory corruption problems).
btw, why aren't you using std::string?