GRASS logo

Note: A new GRASS GIS stable version has been released: GRASS GIS 7, available here. And see the new manual page here

NAME

v.mkgrid - Creates a GRASS vector map of a user-defined grid.

KEYWORDS

vector, geometry

SYNOPSIS

v.mkgrid
v.mkgrid help
v.mkgrid [-plq] map=name grid=rows,columns [position=string] [coor=x,y] [box=width,height] [angle=float] [breaks=integer] [--overwrite] [--verbose] [--quiet]

Flags:

-p
Create grid of points instead of areas and centroids
-l
Create grid as lines, instead of areas
-q
Quiet; No chatter
--overwrite
Allow output files to overwrite existing files
--verbose
Verbose module output
--quiet
Quiet module output

Parameters:

map=name
Name for output vector map
grid=rows,columns
Number of rows and columns in grid
position=string
Where to place the grid
Options: region,coor
Default: region
region: current region
coor: use 'coor' and 'box' options
coor=x,y
Lower left easting and northing coordinates of map
box=width,height
Width and height of boxes in grid
angle=float
Angle of rotation (in degrees counter-clockwise)
Default: 0
breaks=integer
Number of vertex points per grid cell
Options: 0-60
Default: 3

DESCRIPTION

v.mkgrid will create a vector map representation of a regular coordinate grid. Both point and area vector grids can be created.

NOTES

Grid points created with the -p flag will be placed at the center of each grid cell, not at the grid line nodes.

This is NOT to be used to generate a vector map of USGS quadrangles, because USGS quads are not exact rectangles.

EXAMPLES

1) Create a grid in a latitude-longitude location (WGS84):
# use g.region to easily calculate rows and column for 'grid':
g.region n=90 s=-90 w=-180 e=180 res=10 -p
projection: 3 (Latitude-Longitude)
zone:       0
datum:      wgs84
ellipsoid:  wgs84
north:      90N
south:      90S
west:       180W
east:       180E
nsres:      10
ewres:      10
rows:       18
cols:       36
cells:      648

# create 10 degree size grid:
v.mkgrid map=grid_10deg grid=18,36

2) Make a 4x3 grid, cells 20km a side, with lower left corner at 2716500,6447000:

v.mkgrid map=coro_grid grid=4,3 position=coor coor=2716500,6447000 box=20000,20000

3) Make a 10x12 lat/lon grid, cells 2 arc-min a side, with lower left corner at 167deg 52min east, 47deg 6min south. For use with e.g. QGIS you can then pull this grid into a projected location with v.proj before exporting as a Shapefile with v.out.ogr (within GRASS you could just use d.grid -w from the projected location for the same effect):

v.mkgrid map=p2min_grid grid=10,12 position=coor coor=167:52E,47:06S box=0:02,0:02

SEE ALSO

v.patch, d.grid

AUTHORS

Michael Higgins, U.S.Army Construction Engineering Research Laboratory

Update for new vectors Radim Blazek 10/2004

Last changed: $Date: 2014-08-18 07:25:39 -0700 (Mon, 18 Aug 2014) $


Main index - vector index - Full index

© 2003-2016 GRASS Development Team