How to add a plain GeoTIFF file to the correct position in an XYZ layer? #2405
Answered
by
ZzWDlyy
ZzWDlyy
asked this question in
Support Q&A
-
Beta Was this translation helpful? Give feedback.
Answered by
ZzWDlyy
Dec 18, 2023
Replies: 1 comment 1 reply
-
Can you provide the file you're trying to load so we can take a look at it?
…On Sun, Dec 17, 2023 at 10:16 PM ZzWDlyy ***@***.***> wrote:
When I try to add an image to an offline XYZ tile layer using GDAL, it
seems to be misaligned.
std::string addFile = fileName.toStdString();
osgEarth::GDALImageLayer::Options gdalOpt;
gdalOpt.url() = addFile;
osg::ref_ptr<osgEarth::GDALImageLayer> imgLayer = new osgEarth::GDALImageLayer(gdalOpt);
mapNode->getMap()->addLayer(imgLayer);
image.png (view on web)
<https://github.com/gwaldron/osgearth/assets/112188036/77ad32a5-b729-41d2-8c70-769fc037f07a>
However, when I open it in QGIS and other GIS software, the position
appears to be fine.
image.png (view on web)
<https://github.com/gwaldron/osgearth/assets/112188036/c3a33646-0834-4f1c-b6eb-22e8d10f45a8>
Initially, I thought it might be due to the image using the wrong
coordinate system, but even after converting it from EPSG:4326 to
EPSG:3857, the issue persists. The tile map I'm using is from Google Maps.
What should I do? Are there any specific parameters I need to set?
Please help me !
My environment is osgEarth 3.4 with osg 3.6.5.
—
Reply to this email directly, view it on GitHub
<#2405>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACPXYVX3V5NYL4IZQNSIHDYJ6YSVAVCNFSM6AAAAABAY3PCMSVHI2DSMVQWIX3LMV43ERDJONRXK43TNFXW4OZVHE3TGMJXGA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you for your reply. I have identified the issue. The different services of Google Maps may have slight variations in the alignment of their maps.