Coder Social home page Coder Social logo

Comments (3)

jratike80 avatar jratike80 commented on July 23, 2024

Maybe you are testing something else than what you believe, but I cannot directly say what happens. However, I made the most simple test that I could.

Create couple of images with the same geolocation, one with pixel value=100, the other with pixel value=200

gdal_create -of GTiff -ot byte -outsize 100 100 -bands 1 -burn 100 -a_srs epsg:3067 -a_ullr 500000 600000 500500 599500 image1.tif

gdal_create -of GTiff -ot byte -outsize 100 100 -bands 1 -burn 200 -a_srs epsg:3067 -a_ullr 500000 600000 500500 599500 image2.tif

Create couple of vrt files with different image orders

gdalbuildvrt vrttest1.vrt image1.tif image2.tif
gdalbuildvrt vrttest2.vrt image2.tif image1.tif

Now vrttest1.vrt has image2 with value=200 at the bottom, and vrttest2.vrt has image1 with value=100 at the bottom. A test with gdallocationinfo gives expected results:

gdallocationinfo vrttest1.vrt 0 0
Report:
  Location: (0P,0L)
  Band 1:
    <LocationInfo><File>image1.tif</File><File>image2.tif</File></LocationInfo>
    Value: 200

C:\data\000\gdaltest\vrt>gdallocationinfo vrttest2.vrt 0 0
Report:
  Location: (0P,0L)
  Band 1:
    <LocationInfo><File>image2.tif</File><File>image1.tif</File></LocationInfo>
    Value: 100

from gdal.

jratike80 avatar jratike80 commented on July 23, 2024

Because you have source images with different resolutions you should read this https://gdal.org/programs/gdalbuildvrt.html#cmdoption-gdalbuildvrt-resolution and try

gdalbuildvrt index2.vrt Copernicus_DSM_COG_30_N51_00_E000_00_DEM.tif ALPSMLC30_N051E000_DSM.tif -resolution highest

gdallocationinfo -wgs84 index2.vrt  0 51.4
Report:
  Location: (2P,2161L)
  Band 1:
    <LocationInfo><File>Copernicus_DSM_COG_30_N51_00_E000_00_DEM.tif</File><File>ALPSMLC30_N051E000_DSM.tif</File></LocationInfo>
    Value: 64

Looks correct, but I have never done this before myself.

from gdal.

dzfranklin avatar dzfranklin commented on July 23, 2024

Thank you.

from gdal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.