[GRASS-user] Convert OGR vector layer to GRASS vector map

Markus Metz markus.metz.giswork at googlemail.com
Wed Jul 15 03:07:39 EDT 2009


benton101 wrote:
> Hi
> I have an esri shape file that I would like to import into GRASS. I want to
> use the boundaries of this file to create statistics using the values from a
> raster. 
You should use areas not boundaries. A GRASS area consists of a set of
boundaries plus a centroid. Areas without centroids are usually (part
of) isles aka holes.
> I will use v.rast.stats as advised previously to do this. I have the
> following questions regards this operation;
>
> 1. I note that when I import it, the output pane comments that there are 0
> centroids, but there is an attribute table. 
Are there lines or polygons in the shapefile to be imported? What
v.in.ogr command did you use? Have you imported boundaries or lines? How
many areas and isles were built?
> I have then used the Vector >
> Develop Vector Map > Add Centroids. Is this correct in light of the fact
> that I want to use v.rast.stats?
>   
If a shapefile with polygons was imported, there must be areas, i.e.
centroids in the grass vector, otherwise something went wrong. When you
attach centroids, make sure the category number starting value is larger
than the largest value currently present in the vector, otherwise there
may be unexpected results.
> 2. The command output pane states "Datum <GDA_1994> not recognised by GRASS
> and no parameters found". How can I give imported data the correct meta data
> for projection? I gather that this will be an EPSG identifier?
>   
v.in.ogr does not reproject, but it can create a new location based on
any projection information that comes with the vector to be imported.
Maybe the *.prj file has some useful information, e.g. an EPSG
identifier that can be used to manually define a new location.

Markus M



More information about the grass-user mailing list