zooniverse / floatingforests

Apache License 2.0
4 stars 3 forks source link

Projection of Landsat image tiles #52

Open kyleccav opened 8 years ago

kyleccav commented 8 years ago

While validating some classifications we have noticed that the corner coordinates for each coastal image tile are not accurate. I believe the problem is the assumption that the full Landsat scene is a flat square. This is not the case and so we cannot simply divide the bounding box into equal lat/lon increments (i.e. lines 68-69 and 99-104 in process-functions.rb).

However, the geotiff format contains referencing information for each pixel in the image, so it should be fairly straightforward to pull the lat/lon of the corners of each coastal tile directly from the geotiff. Here is some python code I found that does this transformation.

Moving forward, the processing pipeline probably needs to be updated to accurately retrieve the corners of each tile. It would also help our validation efforts if we could find a way to retroactively calculate the correct corner coordinates for each tile based on the geotiff they came from.

kyleccav commented 8 years ago

Sorry, here is that python code: http://zacharybears.com/using-python-to-translate-latlon-locations-to-pixels-on-a-geotiff/

jebyrnes commented 8 years ago

For old images, we can likely scroll through the subjects database and, knowing the geotiff the subject came from, backtransform using the reverse of the process-functions.rb code in lines 99-104, and then get the true upper_left and lower_right corner lat/longs from the geotiff. If you guys want to send me a test subject with new corner lat/longs so I can test it against a coastline shapefile and see if it matches, I'm more than happy to, as I've written the methods (see my FloatingForests github repo).

aliburchard commented 8 years ago

Sorry, what do you mean send you a test subject with "new" corner lat/longs?

jebyrnes commented 8 years ago

Oh, any image will do with new lat/long coordinates for the corners. I can run it against the coastline shape file I have and see if they match. Sorry for sounding obtuse!

On Jul 18, 2015, at 6:06 PM, ali notifications@github.com<mailto:notifications@github.com> wrote:

Sorry, what do you mean send you a test subject with "new" corner lat/longs?

— Reply to this email directly or view it on GitHubhttps://github.com/zooniverse/kelp/issues/52#issuecomment-122601421.