[GRASS-dev] [GRASS GIS] #2320: PyGRASS doesn't write 3D vector map

GRASS GIS trac at osgeo.org
Mon Jun 2 23:43:17 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 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))
 }}}

 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.

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

-- 
Ticket URL: <http://trac.osgeo.org/grass/ticket/2320#comment:1>
GRASS GIS <http://grass.osgeo.org>



More information about the grass-dev mailing list