Primary competition visual

SANSA AWS Informal Settlements in South Africa by #ZindiWeekendz

Helping South Africa
$1 000 USD
Completed (almost 6 years ago)
Classification
Earth Observation
182 joined
77 active
Starti
Jun 12, 20
Closei
Jun 14, 20
Reveali
Jun 14, 20
Additional dataset error
Help ยท 13 Jun 2020, 03:35 ยท 3

When I try to infer dataset from the shape file, my model shows

im[:,:,i] = band[row-100:row+100, col-100:col+100] ValueError: could not broadcast input array from shape (200,133) into shape (200,200)

Any help would be appreciated.

Discussion 3 answers

That particular location must be near the edge of the image tile, such that getting imagery for 100px either side isn't possible. I think this is my bad on the coding side - make sure all points fall inside the bounds of the image tile you're working with.

13 Jun 2020, 03:51
Upvotes 0

If you are using the 2528C tif, the dimension is 35000 by 35000. To fit a 200 by 200 image into that bound, you need to introduce a condition first such that your row and column values are greater 100 and less than 34900.

after: row, col = dataset.index(lon, lat)

You can introduce a condition:

If (row > 100) and (row < 34900) and (col > 100) and (col < 34900).

This way, you can exclude coordinates that can't get the pixel values of points 100 before or after them. And you won't get that error.

13 Jun 2020, 07:42
Upvotes 0

Thank you so much for the help guys...u have helped transform it into a much bigger learning experience..kudos to future hackathons as well

13 Jun 2020, 15:49
Upvotes 0