Hi,<div>I want to change North, East, South and West extent values of a raster map using python. In GUI I've used g.region function like this:</div><div><div><br></div><div><div>g.region -g -a rast=band1_2005_etm@PERMANENT n=4256115 s=4045185 e=831315 w=601785</div>
<div>n=4256115</div><div>s=4045185</div><div>w=601785</div><div>e=831315</div></div></div><div><br></div><div>As you see what I got is what I set. But I couldn't do the same in python:</div><div><br></div><div><div>def loadMap(inputMapPath, outBandName):</div>
<div> mapLoaded = grass.run_command('r.in.gdal', input=inputMapPath, output=outBandName, flags='o', overwrite=True)</div><div> if(mapLoaded == 0):</div><div> print "Map Loaded From " + inputMapPath + " to " + outBandName</div>
<div> else:</div><div> print "ERROR: Map Loaded >From " + inputMapPath + " to " + outBandName</div><div> regionizeMap(outBandName)</div><div> print ""</div><div><br></div><div>
def regionizeMap(bandName):</div><div> mapRegionized = grass.run_command('g.region', rast=bandName, n=4256115, s=4045185, e=831315, w=601785, flags='a', overwrite=True)</div><div> if(mapRegionized == 0):</div>
<div> print "Map Regionized: " + bandName</div><div> else:</div><div> print "ERROR: Map Regionized: " + bandName</div><div> print ""</div><div><br></div><div>def showRegionInfo(bandName):</div>
<div> r = grass.read_command('g.region', rast=bandName, flags='g', verbose=True)</div><div> print bandName</div><div> print r</div><div> print ""</div></div><div><br></div><div>The output is:</div>
<div><br></div><div><div>Map Loaded From D:\gis\data\l71175034_03420050627_b10histeqmatched.tif to band1_2005_etm</div><div>Map Regionized: band1_2005_etm</div><div><br></div><div><br></div><div>band1_2005_etm</div><div>n=4257015</div>
<div>s=4043385</div><div>w=601785</div><div>e=844215</div></div><div><br></div><div>You can see the differnce here, I set east to 831315 but what i got is 844215. What can I do the achieve same result with GUI?</div><div>
Thanks in advance.</div>