Ticket #1885 (closed defect: fixed)

Opened 6 years ago

Last modified 6 years ago

OGR Features don't have a 'keys()', 'items()' interface

Reported by: crschmidt Owned by: hobu
Priority: normal Milestone: 1.5.0
Component: SWIG (all bindings) Version: unspecified
Severity: normal Keywords:
Cc: warmardam

Description

It would be nice to be able to do:

for key, value in feature.items():

print key, value

in Python.

for key in feature.keys() would be handy as well.

If neither of these is possible, a method to return a list of the keys which can be passed to getattr:

getattr(feature, key)

ould be good.

Change History

Changed 6 years ago by hobu

  • status changed from new to closed
  • resolution set to fixed

Added in r12312

Changed 6 years ago by hobu

  • milestone set to 1.5.0
Note: See TracTickets for help on using tickets.