Skip to Content

avec le module Python grass, dans le shell Grass

  1. >>> from grass.script import vector as grassv
  2. >>> grassv.vector_db('newcondZ')
  3. {1:
  4. {'layer': '1', 'name': '', 'database':
  5. '/Users/toto/grassdata/geol/moi/dbf/', 'driver': 'dbf', 'key':
  6. 'cat', 'table': 'newcondZ'}}
  7. >>> grassv.vector_info_topo('newcondZ')
  8. {'kernels':
  9. 0, 'lines': 0, 'centroids': 0, 'boundaries': 0, 'points': 533, 'faces':
  10. 0, 'primitives': 533, 'islands': 0, 'nodes': 533, 'map3d': 1, 'areas':
  11. 0}
  12. >>> grassv.vector_columns('newcondZ')
  13. {'int_3':
  14. 'INTEGER', 'int_2': 'INTEGER', 'int_1': 'INTEGER', 'cat': 'INTEGER',
  15. 'dbl_2': 'DOUBLE PRECISION', 'dbl_3': 'DOUBLE PRECISION', 'dbl_1':
  16. 'DOUBLE PRECISION', 'dbl_4': 'DOUBLE PRECISION'}
  17. >>> grass.vector_db_select('newcondZ')['values'][2]
  18. ['2', '169097.19', '113891.51', '189.76', '192', '80', '1', '0.5']
  19. >>>