[GRASS-dev] [GRASS GIS] #2320: PyGRASS doesn't write 3D vector map
GRASS GIS
trac at osgeo.org
Tue Jun 3 06:56:03 PDT 2014
#2320: PyGRASS doesn't write 3D vector map
-------------------------+--------------------------------------------------
Reporter: annakrat | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Python | Version: svn-trunk
Keywords: pygrass | Platform: All
Cpu: Unspecified |
-------------------------+--------------------------------------------------
Comment(by annakrat):
Replying to [comment:1 zarch]:
> Thanks to look into it!
>
> I have 2 doubts:
>
> * I'm not sure if it is correct to silently switch the vector map from
2D to 3D when the user try to write a geometry feature. Maybe we should
move the patch from the write method to open (in abstract/Info), in this
way we don't have to check if the geo_obj.is2D for each call to the
writing method and user have to open the vector map explicity with 3D
enabled. So user could write something like:
>
> {{{
> with VectorTopo("new3D", mode="w", is2D=False) as vect:
> vect.write(Point(10, 20, 100))
> }}}
>
Yes, that's much better.
> Actually I don't like too much the is2D parameter in the open method,
perhaps is3D could be clearer, but we should change the attribute of the
geometry features from is2D to is3D for consistency.
Yes, I definitely agree, is3D would be much more intuitive.
>
> * Do you know if there is a function in the GRASS API to enable 3D on
vector map instead of directly modifying the c_mapinfo structure? If not
your approach it looks fine to me.
>
Probably we don't need to change 2D/3D, user specifies 3D when opening the
vector map and there is already a parameter for that in
```Vect_open_new```.
See also the other ticket (#2311) which deals with reading 3D points from
a vector map.
--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2320#comment:2>
GRASS GIS <http://grass.osgeo.org>
More information about the grass-dev
mailing list