Refs #28569 -- Fixed gis_tests.inspectapp.tests.OGRInspectTest.test_time_field.
This commit is contained in:
parent
ac756f16c5
commit
c2ecef869c
|
@ -87,8 +87,9 @@ class DataSource(GDALBase):
|
||||||
def __getitem__(self, index):
|
def __getitem__(self, index):
|
||||||
"Allows use of the index [] operator to get a layer at the index."
|
"Allows use of the index [] operator to get a layer at the index."
|
||||||
if isinstance(index, str):
|
if isinstance(index, str):
|
||||||
|
try:
|
||||||
layer = capi.get_layer_by_name(self.ptr, force_bytes(index))
|
layer = capi.get_layer_by_name(self.ptr, force_bytes(index))
|
||||||
if not layer:
|
except GDALException:
|
||||||
raise IndexError('Invalid OGR layer name given: %s.' % index)
|
raise IndexError('Invalid OGR layer name given: %s.' % index)
|
||||||
elif isinstance(index, int):
|
elif isinstance(index, int):
|
||||||
if 0 <= index < self.layer_count:
|
if 0 <= index < self.layer_count:
|
||||||
|
|
|
@ -28,7 +28,7 @@ destroy_ds = void_output(lgdal.OGR_DS_Destroy, [c_void_p], errcheck=False)
|
||||||
release_ds = void_output(lgdal.OGRReleaseDataSource, [c_void_p])
|
release_ds = void_output(lgdal.OGRReleaseDataSource, [c_void_p])
|
||||||
get_ds_name = const_string_output(lgdal.OGR_DS_GetName, [c_void_p])
|
get_ds_name = const_string_output(lgdal.OGR_DS_GetName, [c_void_p])
|
||||||
get_layer = voidptr_output(lgdal.OGR_DS_GetLayer, [c_void_p, c_int])
|
get_layer = voidptr_output(lgdal.OGR_DS_GetLayer, [c_void_p, c_int])
|
||||||
get_layer_by_name = voidptr_output(lgdal.OGR_DS_GetLayerByName, [c_void_p, c_char_p], errcheck=False)
|
get_layer_by_name = voidptr_output(lgdal.OGR_DS_GetLayerByName, [c_void_p, c_char_p])
|
||||||
get_layer_count = int_output(lgdal.OGR_DS_GetLayerCount, [c_void_p])
|
get_layer_count = int_output(lgdal.OGR_DS_GetLayerCount, [c_void_p])
|
||||||
|
|
||||||
# Layer Routines
|
# Layer Routines
|
||||||
|
|
Loading…
Reference in New Issue