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
import os
import sys
import subprocess
from array import array
import string
import math
from grass.script import core as grass
from grass.script import db as grass
excerpt
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')
Jon
On 31 Oct 2018, at 10:12, Frank David wrote:
Hello,
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 !
Frank
_______________________________________________
grass-user mailing list
[email protected]
https://lists.osgeo.org/mailman/listinfo/grass-user
_______________________________________________
grass-user mailing list
[email protected]
https://lists.osgeo.org/mailman/listinfo/grass-user