[GRASS-user] Export Centroids

gridcell dustin.sampson at timberline.ca
Tue Oct 7 11:48:30 EDT 2008


Is there a way to export centroids (v.out.ogr) from a GRASS layer?

I have a layer that was originally overlapping polygons in a shapefile.  I
imported the shapefile into GRASS and build/clean geometry, resulting in 4
polygons.  I want to export the centroids of these polygons, and was hoping
to have returned the polygon's attributes and a point geometry representing
the centroid (4 features).   I tried the following but the command never get
any results....

v.out.ogr input=blk at PERMANENT type=point,centroid 'dsn=PG: host=localhost
user=postgres dbname=test' olayer=blk layer=1 format=PostgreSQL 

I get the following in my output...

6 Boundary(ies) found, but not requested to be exported. Verify 'type'
parameter.

Exporting 9 points/lines...

ERROR 1: INSERT command for new feature failed.
ERROR:  geometry requires more points

Command: INSERT INTO "blk" (wkb_geometry , "cat", "comments") VALUES
(GeomFromEWKT('SRID=32768;LINESTRING (1361422.480504325358197
586604.790284495218657)'::TEXT) , 1, 'Polygon 1')
ERROR 1: INSERT command for new feature failed.
ERROR:  geometry requires more points

Command: INSERT INTO "blk" (wkb_geometry , "cat", "comments") VALUES
(GeomFromEWKT('SRID=32768;LINESTRING (1361632.899105372838676
586307.90450647752732)'::TEXT) , 2, 'Polygon 2')

ERROR 1: INSERT command for new feature failed.
ERROR:  geometry requires more points

Command: INSERT INTO "blk" (wkb_geometry , "cat", "comments") VALUES
(GeomFromEWKT('SRID=32768;LINESTRING (1361538.573653233936056
586446.606141098076478)'::TEXT) , 1, 'Polygon 1')
ERROR 1: INSERT command for new feature failed.
ERROR:  geometry requires more points

Command: INSERT INTO "blk" (wkb_geometry , "cat", "comments") VALUES
(GeomFromEWKT('SRID=32768;LINESTRING (1361538.573653233936056
586446.606141098076478)'::TEXT) , 2, 'Polygon 2')

4 features written


http://www.nabble.com/file/p19861164/blocks.png 

-- 
View this message in context: http://www.nabble.com/Export-Centroids-tp19861164p19861164.html
Sent from the Grass - Users mailing list archive at Nabble.com.



More information about the grass-user mailing list