zooniverse / floatingforests

Apache License 2.0
4 stars 3 forks source link

Record UTM coords, calculate correct latlongs for coastal intersection #57

Closed itsravenous closed 8 years ago

itsravenous commented 8 years ago

Previously, latlongs for each tile were calculated with linear interpolation, leading to inaccuracies. This results in non-coast tiles being reported as coastal. This PR:

Caveats I couldn't get ruby-gdal to read GeoTIFFs properly, so I used python's bindings to create a small script (geotiff.py, wrapped by geotiff.rb) to read various data (coords, projection etc) from GeoTIFFs. This has two implications:

1) The script ends up being called multiple times for the same image. It could do with having an option to output, for example, the geoTransform for a file to avoid this. 2) Because colour calibration (for LANDSAT 4/5/7 images) and levelling (for LANDSAT 8), which destroy the coordinate data in the GeoTIFF, are called before tiling, we have to create these corrected images as copies, so that we can later extract the various coordinate information we need from the original GeoTIFFs. This will have diskspace implications, but I don't know how much of a concern that is.

To download the smallest dataset I could get the API to return (~650 scenes) would have taken me several days, so I just tested with one scene, but there shouldn't be any issues processing mulltiple scenes.

@aliburchard I think FF are best off reviewing the results of this before this is merged in, what with me not being totally familiar with the dataset. Ran out of time before creating a scenes manifest, but let me know if that's a dealbreaker and I can find the time somewhere.

jebyrnes commented 8 years ago

So excited about this. Do you think you can test this on a single scene? We've done a lot of our calibration work with scene LE70440351999204EDC01. We can even send you a MATLAB file of calibrated data of where the forests are as a test. Would be great to check the coordinates for those subjects against the calibration file.

adammcmaster commented 8 years ago

@jebyrnes With the code the way it is I don't think I can easily download a specific scene. Would you be able to send me the coordinates instead?

jebyrnes commented 8 years ago

Sure - here's the meta-data for the scene:

sceneID sensor acquisitionDate upperLeftCornerLatitude upperLeftCornerLongitude upperRightCornerLatitude upperRightCornerLongitude lowerLeftCornerLatitude lowerLeftCornerLongitude lowerRightCornerLatitude lowerRightCornerLongitude sceneCenterLatitude sceneCenterLongitude
LE70440351999204EDC01 LANDSAT_ETM 7.24.1999 37.003 -123.374 36.6948 -121.264 35.3808 -123.822 35.0789 -121.754 36.044 -122.553

The scene name should be in the tif filename.