We knew that all images for training are present in 2528C.tif so we had extracted imaged from latitudes and longitudes. But for additional dataset, how do we know from which tif file to extract the images.
Look at the coordinates of the shape file when you plot it. If you look carefully you will get the answer to this question or atleast it will minimize the search. Also keep in mind the useful tif file will be the one which has all the points generated from shape file.
There is no single tile that covers that entire boundary.
What you have to do is to first clip the shapefile to a boundary where you can get a tile .
All the tiles are named to make it easy to know which tile to open for a boundary you have clipped.
For example:
1) if a tile is named 2528A
It means the tile has a boundary of
Latitude: -25.00 to 25.50 and longitude: 28.00 to 28.50
2) if it is 2528B
Latitude: 25.00 to 25.50
Longtitude: 28.50 to 29.00
3) if it is 2528C
Latitude: 25.50 to 26.00
Longitude: 28.00 to 28.50
4) if it is 2528D
Latitude: 25.50 to 26.00
Longitude: 28.50 to 29.00
You can use this to know the boundaries of the other tiles with their names. Just follow the A, B, C, D notation and add 0.5. A, B, C and D are quadrants of a unit square visually.
That should be done using the Shapefiles.
Link - https://www.twitch.tv/videos/648634668
I can get the latitude and longitude from shape file, but which tif file to search for each of these pairs is the issue.
Yeah, that I agree you have to do a bit of hit and trial.
Ya maybe but we have a lot of records...and hit and trial for each row in different tifs is I guess not feasible.
Look at the coordinates of the shape file when you plot it. If you look carefully you will get the answer to this question or atleast it will minimize the search. Also keep in mind the useful tif file will be the one which has all the points generated from shape file.
so in order to be able to label data from other tiff files is only from matching it with data from the shape file ?
The name (2728A) encodes the latitude and longitude. You can also see the raster extent with dataset.bounds if you've opened it with rasterio.
It's lat (degrees south) lon then quadrant - each TIF is 0.5 degrees a side, so four make a full degree square:
A. B.
C. D.
The shapefile has these boundaries:
Latitude: between -26.87477 and -25.270592
Longitude: between 27.50211 and 28.7726
There is no single tile that covers that entire boundary.
What you have to do is to first clip the shapefile to a boundary where you can get a tile .
All the tiles are named to make it easy to know which tile to open for a boundary you have clipped.
For example:
1) if a tile is named 2528A
It means the tile has a boundary of
Latitude: -25.00 to 25.50 and longitude: 28.00 to 28.50
2) if it is 2528B
Latitude: 25.00 to 25.50
Longtitude: 28.50 to 29.00
3) if it is 2528C
Latitude: 25.50 to 26.00
Longitude: 28.00 to 28.50
4) if it is 2528D
Latitude: 25.50 to 26.00
Longitude: 28.50 to 29.00
You can use this to know the boundaries of the other tiles with their names. Just follow the A, B, C, D notation and add 0.5. A, B, C and D are quadrants of a unit square visually.
I hope this helps.
Perfect explanation