There is no topic on the forum for this competition. Can someone from please create it?
As usual in such competitions, at first you need to convert the geotiff pixels to latitude / longitude.
I remember successfully doing so with code like this:
def polygon_to_tuples(polygon): x, y = polygon.exterior.coords.xy x = list(x) y = list(y) return list(zip(x, y)) def coordinates_to_pixels(x, y, transform): """ The Affine object is a named tuple with elements a, b, c, d, e, f corresponding to the elements in the matrix equation below, in which a pixel’s image coordinates are x, y and its world coordinates are x', y'.: | x' | | a b c | | x | | y' | = | d e f | | y | | 1 | | 0 0 1 | | 1 | """ rev = ~transform return rev * (x, y) polygon = df.loc.geometry tuples = polygon_to_tuples(polygon) pixels = [coordinates_to_pixels(tup, tup, transform) for tup in tuples]
The coordinates of individual polygons seem to be more or less in line with house coordinates on Google Maps, but when I try to convert them to geo-tiff pixels, I get strange values.
Has anyone faced this issue?
I also tried using
geoio with similar results.