[Qgis-developer] Improving QGIS Measure tool
wonder.sk at gmail.com
Fri Nov 12 04:35:35 EST 2010
On Mon, Nov 8, 2010 at 9:41 PM, Alexander Bruy <alexander.bruy at gmail.com> wrote:
> Hi devs,
> We want to improve the QGIS measure tool to make possible distance
> measurements in unprojected sessions when latlong data is loaded.
> This is helpful when you don't want to project your data for some
> reason, but still would like to measure distance in meters. For this
> we were willing to use QgsDistanceArea::computeDistanceBearing()
> which already has Vincenty formulae.
> But, at this time QgsDistanceArea::computeDistanceBearing() requires
> projection and ellipsoid to be already set before calling it.
> We want to modify QgsDistanceArea::computeDistanceBearing() to add
> ability to do measurements without reprojection or coordinate transform,
> but passing Ellipsoid as one of the parameters. But we unsure is this
> safe because Measure tool doesn't create it's own instance of
> QgsDistanceArea but get it from map renderer.
> Any thoughts on this?
You can create your own instance of QgsDistanceArea and use it with
any parameters you like. The idea of having an instance within map
renderer was to have a convenience instance of it which has the same
settings (crs, projections on/off) as the map renderer. But now it
seems to me that it wasn't that good idea and it will be probably
removed in a future version - e.g. when using threaded rendering it's
not clear what should be the result.
So I think you should create your own QgsDistanceArea instance and set
the parameters as you need.
More information about the Qgis-developer