1

So I read in a .tif image with rasterio and what I get out when printing dataset.read(1) is what I understood a coordinate system in the "red" band of the image.

The coordinate system is in UTM, the bottom is mostly 0's and to the top I get thousands like so:

array([[1389,  831, 1017, ..., 2221, 2869, 2729],
       [1109,  693,  831, ..., 2683, 2499, 2823],
       [ 877,  785,  693, ..., 2037, 2683, 2683],
       ...,
       [   0,    0,    0, ...,    0,    0,    0],
       [   0,    0,    0, ...,    0,    0,    0],
       [   0,    0,    0, ...,    0,    0,    0]]

I am trying to make sense of it what confuses me more is if I do read(2) which I'm guessing should correspond to the green channel I get:

array([[1249,  831,  925, ..., 2221, 2591, 2453],
       [1063,  739,  785, ..., 2591, 2407, 2591],
       [ 925,  785,  693, ..., 2129, 2545, 2499],
       ...,
       [   0,    0,    0, ...,    0,    0,    0],
       [   0,    0,    0, ...,    0,    0,    0],
       [   0,    0,    0, ...,    0,    0,    0]], dtype=uint16)

Slightly different values, but they should be the same if they correspond to the same location?

This is the images bounding box:

BoundingBox(left=246000.00000000035, bottom=9855098.500000004, right=251000.00000000035, top=9860000.000000004)

It's a tile of Nairobi, Kenya.

5
  • 1
    Maybe you're not familiar with how rasters operate? The high numbers are the top and low at the bottom aren't coordinates, they're values. Coordinates are implicit, based on the corners of the raster, and the number of cells across and down to the values.
    – Vince
    Commented Oct 11, 2021 at 15:39
  • @Vince, thank you, I really am not, I am working on a sort of volunteer project with geo images. While experienced in ML and lot's of different types of data, I've never worked with gis before. I'm sorry for my slow uptake, what are these values of? I didn't quite understand? Do they relate to the tiles I have or nodes?
    – Oliver
    Commented Oct 11, 2021 at 15:49
  • @Vince could you point me to some good ressource in where I can learn more about how rasters operate or how to read this information? Thank you very much!
    – Oliver
    Commented Oct 11, 2021 at 15:51
  • 1
    @user199590 docs.qgis.org/2.8/en/docs/gentle_gis_introduction/…
    – Kartograaf
    Commented Oct 11, 2021 at 16:33
  • @Kartograaf thanks a lot!!
    – Oliver
    Commented Oct 11, 2021 at 16:53

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.