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

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. 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. 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?

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?

3. The command Vector > Develop Vector Map > Dissolve boundaries appears to
give different results as to what I get in Esri. I chose the same column to
do the statistics on. Has anyone else had disparate results between the two
applications? Or I am doing something wrong in the initial preparation of
the data?

Thank You for any assistance
Ben

--
View this message in context: http://n2.nabble.com/Convert-OGR-vector-layer-to-GRASS-vector-map-tp3260449p3260449.html
Sent from the Grass - Users mailing list archive at Nabble.com.

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

Markus Wrote:

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. ... Are there lines or polygons in the shapefile to be
imported?

The shapefile that I used is a shapefile of polygons, does this pass for an
area with a centroid?

What v.in.ogr command did you use?

This is the command I used ... v.in.ogr --overwrite --verbose dsn=V:\lcu.shp
output=lcu

Have you imported boundaries or lines?

I am hoping that I have imported boundaries, can you tell from my v.in.ogr
command?

Thank You
Ben
--
View this message in context: http://n2.nabble.com/Convert-OGR-vector-layer-to-GRASS-vector-map-tp3260449p3261719.html
Sent from the Grass - Users mailing list archive at Nabble.com.

benton101 wrote:

The shapefile that I used is a shapefile of polygons, does this pass for an
area with a centroid?
  

Yes, shapefile polygons are equivalent to grass areas with centroid

This is the command I used ... v.in.ogr --overwrite --verbose dsn=V:\lcu.shp
output=lcu

I am hoping that I have imported boundaries, can you tell from my v.in.ogr
command?
  

Not really, but everything should be fine. The last output message of
v.in.ogr would help more: number of points, lines, boundaries, areas,
isles, areas without centroid, incorrect boundaries if any.

Markus

Hi Markus,

After reading this post through I have completed the process again and have
had a successful outcome creating a file with statistics using v.rast.stats.
I have no idea where I went wrong in the previously but I have a feeling
adding centroids was the point where things went a rye.

But I do have one comment;
I had success using 6.4.0svn with xp, but when I carried out the same
process using 6.4.0R5C I ran into the "no categories found in raster map
error" problem I posted in a July 15 post. The raster was the same in both
instances. My intent in both instances was to use v.rast.stats and it is
this command that produced the problem in 6.4.0R5C.

Thank You
Ben
--
View this message in context: http://n2.nabble.com/Convert-OGR-vector-layer-to-GRASS-vector-map-tp3260449p3266681.html
Sent from the Grass - Users mailing list archive at Nabble.com.