1

I tried to change the projection of AMSR-2 in Python using:

'gdalwarp -geoloc -t_srs EPSG:4326 C:\GW1AM2_201301311114_050A_L1SGBTBR_1110110.vrt C:\test100.tif'

It said there are something wrong with 'EPSG:4326'(Invalid syntax). I do not know why?

2
  • what do you get if you put a quote around the EPSG:4326 string like "EPSG:4326"
    – nmtoken
    Mar 25 '16 at 8:32
  • 1) Would it depend what Python version you are using? 2) Assuming you are running the command in a command shell, and you typed Python in the shell to engage Python interpreter: I've ran into the syntax issue when executing a command while Python interpreter is engaged. I fix the issue when I open in the OSGeo4W.bat command shell and then run the command straight away, and not type Python first to engage Python. So maybe try that..?
    – Joe
    Mar 26 '16 at 2:37
1

Maybe python does not find the EPSG file in your file system.

Try "+proj=longlat +datum=WGS84 +no_defs" (with the quotes) instead.

3
  • Thank you for your advice. I have tried it, but it still does not work. It said that there are "SyntaxError: invalid syntax" in the place of " which is at the end of "+proj=longlat +datum=WGS84 +no_defs". Mar 25 '16 at 12:04
  • Can you try the same in a command line box? Maybe you have to double the quotes in your python call.
    – AndreJ
    Mar 25 '16 at 12:51
  • This might help too: gis.stackexchange.com/questions/37821/…. can you add a part of your python code?
    – AndreJ
    Mar 25 '16 at 12:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.