[GRASS-user] Polygon2Point

Moritz Lennert mlennert at club.worldonline.be
Wed May 23 10:20:40 EDT 2007


On 23/05/07 15:50, Salvator*eL*arosa wrote:
> 
> 
> hajhouse wrote:
>> På 2007-05-22, skrev Salvator*eL*arosa:
>>> hi,
>>> i need a little help!
>>> How can to export a point shapefile from a polygon layer in Grass
>>> (Convert
>>> Polygon2Point)?
>>> So, i can have in table (point file) all informations of the layer
>>> polygon
>>> table!
>>>
>>> Sorry my english!
>>>
>>> Thanks! 
>> In GRASS terminology polygons can be lines, boundaries, or areas (when
>> conbined with a centroid [= center point]). So assuming you have areas
>> and you want to export just the centroids, I believe something like:
>>
>> v.type type=centroid,point in=mymap out=mymap_converted
>> v.out.ogr in=mymap_converted dsn=myshapefile.shp 
>>
>> would meet your needs.
>>
>>
>>
>>
> 
> Thank u for reply!
> 
> Unfortunately it doesn't work, yet. It export always shp polygon!
> I need of a point shapefile!
> 

You need to use the type= option of v.out.ogr:

v.type type=centroid,point in=mymap out=mymap_converted
v.out.ogr in=mymap_converted dsn=myshapefile.shp type=point

Then you get a point file with attributes.

Moritz







More information about the grass-user mailing list