Yeah, ditch the String class. Lots of reasons here, required reading here.
But, since you're intent on shooting yourself in the foot:
double stringToDouble(String & str) <-- notice the "&"
{
return atof( str.c_str() );
}
You might be interested in my NeoGPS library. It's smaller, faster, more reliable and more accurate than all other GPS libraries, and the examples are properly structured. It's available from the Arduino IDE Library Manager, under the menu Sketch -> Include Library -> Manage Libraries. Even if you don't use it, there is lots of information on the Installation and Troubleshooting pages.
Specifically, NeoGPS retains more significant digits (10) than other libraries (~7), so if you really want the full precision reported by your device, take a look. The distance and bearing calculations in the Location class use these extra digits in their calculations, making the results much more accurate than the naive implementations in other libaries. This is especially important at small distances (<1km).
Cheers,
/dev