zkwurst / GSoC2017-GRASS-GIS

GNU General Public License v2.0
2 stars 1 forks source link

use gdalwarp to workaround NAIP issue #17

Open petrasovaa opened 7 years ago

petrasovaa commented 7 years ago

I am not sure when that NAIP import is going to be fixed and since the ortho is pretty important dataset, I would suggest to use gdalwarp to reproject it. An example of calling gdalwarp:

 gdalwarp -of GTiff -t_srs "+proj=lcc +lat_1=36.16666666666666 +lat_2=34.33333333333334 +lat_0=33.75 +lon_0=-79 +x_0=609601.22 +y_0=0 +no_defs +a=6378137 +rf=298.257222101 +towgs84=0.000,0.000,0.000 +to_meter=1" m_3507811_se_17_1_20140618_20141118.jp2 test_naip.tif

the PROJ4 string can be obtained with g.region -jf

The gdalwarp can be called using subprocess package https://docs.python.org/2/library/subprocess.html#subprocess.call