Greetings
I’m building a GRASS Python Script to automatically import a set of data to my location. At GRASS book (chapter 3.3.3) it uses g.proj -wf to to check current location projection. Can I use the same command in Python to retrieve the same?
And how about calling gdalwarp in a Python-GRASS Script? can it be called and used by a Python_GRASS Script? if so, is there any Python example with that?
Regarding “g.proj -wf” command. I get a lot of information. I suppose GDALWARP can read this right ? If not, How can I obtain current Location EPSG code?
Thanks
Best regards,
Kim
Michael, regarding the use of regiondict = grass.region() , Does this retrieves Projection EPSG code?
Kim
2010/5/25 Kim Besson <kimbesson1981@gmail.com>
Greetings
I’m building a GRASS Python Script to automatically import a set of data to my location. At GRASS book (chapter 3.3.3) it uses g.proj -wf to to check current location projection. Can I use the same command in Python to retrieve the same?
And how about calling gdalwarp in a Python-GRASS Script? can it be called and used by a Python_GRASS Script? if so, is there any Python example with that?
Regarding “g.proj -wf” command. I get a lot of information. I suppose GDALWARP can read this right ? If not, How can I obtain current Location EPSG code?
Thanks
Best regards,
Kim
Kim Besson wrote:
regarding the use of regiondict = grass.region() , Does this
retrieves Projection EPSG code?
No. You can get projection information as a Python dictionary with
e.g.:
s = grass.read_command("g.proj", flags='j')
kv = grass.parse_key_val(s)
In 7.0, use:
fgrep g.proj $GISBASE/scripts/*.py
for examples.
However: I don't know whether the EPSG code is actually stored in the
PROJ_INFO file, or whether it just stores the parameters. If it's the
latter, then there's no way to retrieve an EPSG code. And that's
assuming that the location was created using an EPSG code in the first
place, which isn't guaranteed.
--
Glynn Clements <glynn@gclements.plus.com>