[GRASS-user] pygrass : creation of an area in a vector map

Pietro peter.zamb at gmail.com
Tue Dec 9 22:20:18 PST 2014

Hi Laurent,

On Tue, Dec 9, 2014 at 9:13 PM, Laurent C. <lrntct at gmail.com> wrote:
> I'm trying to write a new area to a new vector map, without success.

I have no solution for that right now. At the moment you can only read
the areas.

> If I do the following :
> new_boundary = Boundary(points=coordinates)
> new_centroid = Point(point_x,point_y)
> new_area = Area(boundary = new_boundary, centroid=new_centroid)
> new_vect_map.write(new_area)
> I get this error:
> AttributeError: 'VectorTopo' object has no attribute '_write_area'
> But if I write the boundary and centroids independently, the areas are not
> properly created, and centroids are just recognized as "points", not
> centroids.
> I should I proceed to have the vector map properly written?

You should go a step inside the C API of GRASS through ctypes and
write your own function, I was not directly interested on write areas
and therefore as far as I no, there is not an high level interface to
do this task.

Probably there is some error when pygrass write the centroids that are
just simple points without the topology meaning...

All the best


More information about the grass-user mailing list