UTMLabelingEngine and UTMGraticule questions

classic Classic list List threaded Threaded
5 messages Options
krzysief krzysief
Reply | Threaded
Open this post in threaded view
|

UTMLabelingEngine and UTMGraticule questions

This post was updated on .
Hello,

[Question 1 (UTMLabelingEngine)]
I am trying to display UTM labels for my application. To do so I am using UTMLabelingEngine like that:

UTMGraticuleOptions utm_graticule_options;
osg::ref_ptr<UTMLabelingEngine> utm_labeler = new UTMLabelingEngine(map_node->getMapSRS());
double maxRes = 100000.0;
utm_labeler->setMaxResolution(maxRes);

osg::ref_ptr<UTMGraticule> utm_graticule = new UTMGraticule(utm_graticule_options);
utm_graticule->getOrCreateNode()->asGroup()->addChild(utm_labeler);

For some reason this doesn't work, can you point me where I am mistaken?

[Question 2 (UTMGraticule)]
My second question: is there any way to make UTMGraticule more precise? At this point it only shows the gzd zones which is not enough for my application, if there's no osgEarth utility for this, maybe someone can share an algorithm that solves this problem?

using osgEarth 2.9

Cheers, Kris!
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: UTMLabelingEngine and UTMGraticule questions

Kris,
Just create your UTMGraticule and add it to the Map as a layer (see osgearth_graticule.cpp for an example).

UTMGraticule "is what it is" .. it was built to a certain requirement and that's all it does. You can look into the MGRSGraticule, which supercedes the UTMGraticule, and will subdivide further. The graticules.earth example shows an example of this.
Glenn Waldron / Pelican Mapping
krzysief krzysief
Reply | Threaded
Open this post in threaded view
|

Re: UTMLabelingEngine and UTMGraticule questions

Glenn,
 adding the layer as in osgearth_graticule example is exactly what I do. The layer is visible but the UTMLabelinEngine does not appear.

 One more question, any chances that in short period of time GeodeticGraticule will evolve and satisfy the cases when the zoom is lower than 4 kilometers?
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: UTMLabelingEngine and UTMGraticule questions

Kris,
Use the MGRSGraticule instead -- it supports the higher resolution and edge-labels.

There are no funded projects to work on the geodetic graticule at this time. Have you tried adding more resolution levels in the earth file?
Glenn Waldron / Pelican Mapping
krzysief krzysief
Reply | Threaded
Open this post in threaded view
|

Re: UTMLabelingEngine and UTMGraticule questions

Glenn,
 tried this through code with line:
wgs_graticule_options.resolutions() = "10 5 2.5 1.0 0.5 0.25 0.125 0.0625 0.3125 0.15625 0.078125 0.0390625 0.01953125";

but it changes nothing.