Initialize on an OGR C pointer to the Layer and the `DataSource` object that owns this layer. The `DataSource` object is required so that a reference to it is kept with this Layer. This prevents garbage collection of the `DataSource` while this Layer is still active.
(self, layer_ptr, ds)
| 25 | """ |
| 26 | |
| 27 | def __init__(self, layer_ptr, ds): |
| 28 | """ |
| 29 | Initialize on an OGR C pointer to the Layer and the `DataSource` object |
| 30 | that owns this layer. The `DataSource` object is required so that a |
| 31 | reference to it is kept with this Layer. This prevents garbage |
| 32 | collection of the `DataSource` while this Layer is still active. |
| 33 | """ |
| 34 | if not layer_ptr: |
| 35 | raise GDALException("Cannot create Layer, invalid pointer given") |
| 36 | self.ptr = layer_ptr |
| 37 | self._ds = ds |
| 38 | self._ldefn = capi.get_layer_defn(self._ptr) |
| 39 | # Does the Layer support random reading? |
| 40 | self._random_read = self.test_capability(b"RandomRead") |
| 41 | |
| 42 | def __getitem__(self, index): |
| 43 | "Get the Feature at the specified index." |
nothing calls this directly
no test coverage detected