qgis / qgis4.0_api

Tracker for QGIS 4.0 API related issues and developer discussion
3 stars 1 forks source link

Remove formatting methods from QgsPoint #12

Closed nyalldawson closed 6 years ago

nyalldawson commented 8 years ago

QgsPoint has a bunch of methods for formatting a point to various strings, eg toDegreesMinutes. These should ideally be moved out of QgsPoint into a new QgsCoordinateFormatter class, with static methods for converting QgsPoint/V2/x & y doubles to the various formats.

Furthermore, the methods in QgsPoint are restrictive in that they always return both formatted latitude and longitude. Composer grids (and I suspect other code areas) need to then manually attempt to split the string back into separate lat/long components for rendering. It's inefficient and fragile, and there should be a way to retrieve just the formatted latitude or longitude.

nyalldawson commented 6 years ago

Fixed in master