I have come to a place in some personal-project code where I need to use skimage.transform.warp and I keep tabbing over to the documentation, sighing, and tabbing away.

I want to map from a small input to a large output with interpolation in the output and I’m going to be able to figure it out but it’s going to feel like doing my taxes the whole time.

Show thread

@vruba Depending on the nature of the transform, this may be possible with gdalwarp. I'm pretty well versed in its esoteric features, so consider me nerd sniped if you want to send something along.

gdalwarp directly supports an affine transform, and I think PROJ supports a homography. A geolocation array opens up lots of possibilities depending on what can be placed in DST_SRS.

Follow

@geowurster So I sort of talked myself out of GDAL at the beginning of thinking about this, but maybe it’s been the obvious choice all along.

I’m just trying to reproject PACE OCI L1B data, which does the weather satellite thing of having bands for longitude and latitude values, so it’s essentially one GCP per pixel.

· · Web · 1 · 0 · 0

@geowurster The thing is that it’s so oblique at the edges that the terrain correction baked into the GCPs (or whatever the better name is) matters quite a bit. So the common sense thing would be to discard most of them, but I’d rather not do that. Therefore it’s order 1e6 GCPs, which feels like a lot to ask even GDAL, but I haven’t tested!

@geowurster I guess this is what geolocation arrays are for, through. Obviously it’s my first time dealing seriously with this style of georeferencing.

@vruba @sgillies This is indeed exactly what geolocation arrays are for, and I have used geolocation arrays larger than that, so I think GDAL can handle this. The highly oblique pixels do matter, but the only way to get a good lat/lon is to intersect with a terrain model, so for orthoing purposes an elevation value is either inherently present, or the lat/lon values are inherently suspect.

@vruba @sgillies Some things to be aware of when using geolocation arrays with Rasterio. I _think_ this comment is still right.

https://github.com/rasterio/rasterio/pull/2884#discussion_r1306104069

Sign in to participate in the conversation
Horsin' Around

This is a hometown instance run by Sam and Ingrid, for some friends.