MarcYin / SIAC

A sensor invariant Atmospheric Correction (SIAC)
http://www2.geog.ucl.ac.uk/~ucfafyi/Atmo_Cor/
GNU Affero General Public License v3.0
61 stars 17 forks source link

Issue with MODIS processing #2

Closed jgomezdans closed 4 years ago

jgomezdans commented 5 years ago

As it stands, this is in MODIS coordinates, but it doesn't have a set projection, because the GeoJSON format only deals with EPSG-approved projections. As it stands, the GeoJSON has not coordinates, and by default it's assumed WGS84, which is BAD:

{ 
"type": "FeatureCollection", 
"name": "MODIS_h17v05_20170614_1135_AOI", 
"features": [ 
{ "type": "Feature", "properties": { "location": "\/data\/MODIS\/h17v05\/SIAC09GA\/2017\/MODIS_h17v05_20170614_1135_band3.tif
" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -1111950.52, 4447802.079 ], [ -0.000332999974489, 4447802.079 ], [
-0.000332999974489, 3335851.55933299986646 ], [ -1111950.52, 3335851.55933299986646 ], [ -1111950.52, 4447802.079 ] ] ] } } 
] 
}

If we forced the GeoJSON to be e.g. WGS84, it'd work, but then all the gdal.Warp statements would need to have an option to reproject to the native dataset projection (e.g. MODIS projection). For S2/L8, since the projections are in the EPSG database, this isn't a problem. ping @GerardoLopez

MarcYin commented 4 years ago

This has been solved in recent commits, which will force it to be wgs84, while the warp output will still be in original projection. The corresponding indexing between MODIS and input raster projection will be handled by: https://github.com/MarcYin/SIAC/blob/6ccb2534ea145c7db54366b2982e0b43df20b8a8/SIAC/the_aerosol.py#L591