[GRASS-user] partial vector copy to smaller territory
jeir at hi.is
Wed Oct 31 04:35:48 PDT 2018
The following partial script may be helpful (having the source map in shape format):
assume folder in home directory containing source map - in this case contours.shp
v_w,v_s,v_e,v_n are string variables with destination region
the commands create a subset defined by the destination region: contours.shp
note that the identical naming of input and output is perhaps confusing but harmless
as long as the home directory does not contain files named contours.*
importing required modules
from array import array
from grass.script import core as grass
from grass.script import db as grass
cmd = 'ogr2ogr -clipsrc' + ' ' + v_w + ' ' + v_s + ' ' + v_e + ' ' + v_n
cmd = cmd + ' ' + '~/contours.shp' + ' ~/folder_name/contours.shp'
subprocess.call(cmd, shell = True)
grass.run_command('v.in.ogr', input='contours.shp', layer='contours', output='contours')
On 31 Oct 2018, at 10:12, Frank David wrote:
What is the best and fast way to make a copy of a part of vector map (national) to get a smaller territory ? (partial copy).
Thank you for your advice !
grass-user mailing list
grass-user at lists.osgeo.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the grass-user