0

I converted an ascii raster to GeoTIFF (for the first time), then inspected the result in QGIS seeking confidence in my achievement.

  1. What fails: "Identify Features" returns different band values from the GeoTiff depending how far zoomed out I am . When I zoom in close enough, band values from both layers are aligned. Please see screenshots below.
  2. What works: "sample raster values" using half a dozen Points all return the same band value for both the ascii and GeoTiff.

What is it that I do not understand about either QGIS or GeoTIFF ?

Scale 1:8601 (identify features on Point A)

enter image description here

Scale 1:134 (identify features on Point A)

enter image description here

Source files can be downloaded at the link below, all very small
points.geojson
raster_ascii_vs_geotiff.qgz
sx9090_DSM_2M_ASCII.asc
sx9090_DSM_2M_TIFF.tif

https://www.dropbox.com/sh/w3thtv825wfhhl2/AADGpwHZTUTvNvGnQ7Pc-USXa?dl=0

gdal_translate -of GTiff -a_srs EPSG:27700 -strict sx9090_DSM_2M.asc sx9090_DSM_2M.tif
QGIS 3.22.0-Białowieża
OSGeo4W GDAL 3.3.3, released 2021/10/25
Open source data https://environment.data.gov.uk/dataset/e9edb9f6-d563-4a5e-a425-c72c5eac919c
gdalinfo sx9090_DSM_2M_ASCII.asc
Driver: AAIGrid/Arc/Info ASCII Grid
Files: sx9090_DSM_2M_ASCII.asc
Size is 500, 500
Origin = (290000.000000000000000,91000.000000000000000)
Pixel Size = (2.000000000000000,-2.000000000000000)
Corner Coordinates:
Upper Left  (  290000.000,   91000.000)
Lower Left  (  290000.000,   90000.000)
Upper Right (  291000.000,   91000.000)
Lower Right (  291000.000,   90000.000)
Center      (  290500.000,   90500.000)
Band 1 Block=500x1 Type=Float32, ColorInterp=Undefined
  NoData Value=-9999
gdalinfo sx9090_DSM_2M_TIFF.tif
Driver: GTiff/GeoTIFF
Files: sx9090_DSM_2M_TIFF.tif
Size is 500, 500
Coordinate System is:
PROJCRS["OSGB36 / British National Grid",
    BASEGEOGCRS["OSGB36",
        DATUM["Ordnance Survey of Great Britain 1936",
            ELLIPSOID["Airy 1830",6377563.396,299.3249646,
                LENGTHUNIT["metre",1]]],
        PRIMEM["Greenwich",0,
            ANGLEUNIT["degree",0.0174532925199433]],
        ID["EPSG",4277]],
    CONVERSION["British National Grid",
        METHOD["Transverse Mercator",
            ID["EPSG",9807]],
        PARAMETER["Latitude of natural origin",49,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8801]],
        PARAMETER["Longitude of natural origin",-2,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8802]],
        PARAMETER["Scale factor at natural origin",0.9996012717,
            SCALEUNIT["unity",1],
            ID["EPSG",8805]],
        PARAMETER["False easting",400000,
            LENGTHUNIT["metre",1],
            ID["EPSG",8806]],
        PARAMETER["False northing",-100000,
            LENGTHUNIT["metre",1],
            ID["EPSG",8807]]],
    CS[Cartesian,2],
        AXIS["(E)",east,
            ORDER[1],
            LENGTHUNIT["metre",1]],
        AXIS["(N)",north,
            ORDER[2],
            LENGTHUNIT["metre",1]],
    USAGE[
        SCOPE["Engineering survey, topographic mapping."],
        AREA["United Kingdom (UK) - offshore to boundary of UKCS within 49┬░45'N to 61┬░N and 9┬░W to 2┬░E; onshore Great Britain (England, Wales and Scotland). Isle of Man onshore."],
        BBOX[49.75,-9,61.01,2.01]],
    ID["EPSG",27700]]
Data axis to CRS axis mapping: 1,2
Origin = (290000.000000000000000,91000.000000000000000)
Pixel Size = (2.000000000000000,-2.000000000000000)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  (  290000.000,   91000.000) (  3d33'28.97"W, 50d42'27.51"N)
Lower Left  (  290000.000,   90000.000) (  3d33'27.90"W, 50d41'55.15"N)
Upper Right (  291000.000,   91000.000) (  3d32'38.00"W, 50d42'28.19"N)
Lower Right (  291000.000,   90000.000) (  3d32'36.94"W, 50d41'55.82"N)
Center      (  290500.000,   90500.000) (  3d33' 2.95"W, 50d42'11.67"N)
Band 1 Block=500x4 Type=Float32, ColorInterp=Gray
  NoData Value=-9999
3
  • 1
    Using the raster calculator to subtract one raster from the other results in an output raster comprised entirely of zero values so there is no difference in your two rasters. Since neither of the two rasters have lower resolution overviews, it's probably just a slight difference in how the identify tool queries pixels at small scales (zoomed out).
    – user2856
    Nov 6 '21 at 4:52
  • As per the help center please do not include chit chat like thanks and other statements of appreciation within your posts.
    – PolyGeo
    Nov 6 '21 at 21:17
  • Bug report opened for this issue github.com/qgis/QGIS/issues/45944#issuecomment-963980701
    – golfalot
    Nov 17 '21 at 15:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.