tif without SRS?

classic Classic list List threaded Threaded
9 messages Options
Johnson prem Johnson prem
Reply | Threaded
Open this post in threaded view
|

tif without SRS?

Hi

I am using OSGOptions to display tif file which is not having any SRS(raw).
Getting skewed display. OSGOptions expects SRS with Bounds.
Though it could be done in osg directly, the performance goes very bad.
I am not sure how to display plain tif without SRS and with only line, pixel informaton?



The code is:


        MapOptions mapOpt;
        mapOpt.coordSysType() = MapOptions::CSTYPE_PROJECTED;  
        mapOpt.profile() = ProfileOptions("plate-carre");
        Map* map = new Map(mapOpt);
        OSGOptions osgOpt;
        osgOpt.url() = "../data/Image.tif";
        osgOpt.profile()->srsString() = "wgs84";
        ImageLayer* layer = new ImageLayer("test", osgOpt);
        map->addLayer( layer );

               
        MPTerrainEngineOptions terrainOptions;
        MapNodeOptions mapNodeOptions(terrainOptions);
        mapnode = new MapNode( map, mapNodeOptions );

        viewer.setSceneData( mapnode);



the output comes out like,



Thanks
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: tif without SRS?

What are you expecting it to look like?
Glenn Waldron / Pelican Mapping
Johnson prem Johnson prem
Reply | Threaded
Open this post in threaded view
|

Re: tif without SRS?

I expect the display to be simply based on line, pixel information of the image.Like single 2D image display.
it should not be projected. I am aware osgEarth requires SRS.

gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: tif without SRS?

You have to give osgEarth a valid Profile for the image. The one you defined indicates "WGS84" with no extents, and so will stretch the image to cover the whole earth.

It sounds like you want to make a "fake" profile. Something like this would work:

        <profile>
            <srs>+proj=eqc +units=m +no_defs</srs>
            <xmin>0</xmin>
            <xmax>20000</xmax>
            <ymin>0</ymin>
            <ymax>20000</ymax>
        </profile>

Where the min/max extents are equal to the width/height of the image.
Glenn Waldron / Pelican Mapping
Johnson prem Johnson prem
Reply | Threaded
Open this post in threaded view
|

Re: tif without SRS?

Yes. it works.

Rendering is slower than rendering properly projected tif.
I tried,

        imagelayerOpt.tileSize() = 32;

but not much improvement.
Another thing is that even on properly projected tif file display, setting tilesize to 32 renders clumpsy.
in the sense, though rendering tiles look faster, unless zoom too close i dont get clear picture.

gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: tif without SRS?

There are tips on improving the read time of GeoTIFFs here:

http://docs.osgearth.org/en/latest/data.html#tips-for-preparing-your-own-data
Glenn Waldron / Pelican Mapping
Johnson prem Johnson prem
Reply | Threaded
Open this post in threaded view
|

Re: tif without SRS?

That's correct. I am aware all those options.
But particularly in this case, my map is in plate-carre and
the image is in dummy projection eqc.
I think there will be re-projection on-fly and doesn't reduce the performance?

And, in this case, as I dont require any accuracy, want to avoid any re-projection, if happen so.

One more thing, what is your opinion about plate-carre and its accuracy,
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: tif without SRS?

Why use Plate Carrée? If you don't want reprojection or mosacing, give your map the same profile as your data.

Plate Carrée is just a special case of the EQC (equidistant cylindrical) projection, in which the latitude and longitude (angles) are re-interpreted as linear units. It is primarily useful for 2D overview maps. (I am not sure how to answer your question about accurary.)
Glenn Waldron / Pelican Mapping
Johnson prem Johnson prem
Reply | Threaded
Open this post in threaded view
|

Re: tif without SRS?

eqc-wgs84 looks to be valid map profile in version 2.8.
To my image layer, i am providing fake profile wherein the projection is mentioned just "ëqc"(+proj=eqc +units=m +no_defs).
I think both must be same and equivalent to EPSG:4087.
There must not be any further reprojection.

I got the confusion as some version of osgearth takes just "ëqc" as map projection.