Created
December 12, 2017 10:18
-
-
Save heyarne/c37c6e52f496b6f408bcebd1fbca4518 to your computer and use it in GitHub Desktop.
fiona test output
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
============================= test session starts ============================== | |
platform darwin -- Python 2.7.10, pytest-3.3.1, py-1.5.2, pluggy-0.6.0 | |
rootdir: /Users/heyarne/tmp/Fiona, inifile: | |
plugins: cov-2.5.1 | |
collected 605 items | |
tests/test_bigint.py . [ 0%] | |
tests/test_bounds.py .... [ 0%] | |
tests/test_bytescollection.py FFFFFFFFFFsFFFFFFFFFFFFFFFFFFFFFFFFFFF. [ 7%] | |
tests/test_collection.py ............................................... [ 15%] | |
......................... [ 19%] | |
tests/test_collection_crs.py .. [ 19%] | |
tests/test_crs.py ............. [ 21%] | |
tests/test_drivers.py . [ 21%] | |
tests/test_feature.py ....... [ 22%] | |
tests/test_fio_bounds.py ........... [ 24%] | |
tests/test_fio_calc.py .... [ 25%] | |
tests/test_fio_cat.py ....... [ 26%] | |
tests/test_fio_collect.py ........ [ 27%] | |
tests/test_fio_distrib.py .. [ 28%] | |
tests/test_fio_dump.py .. [ 28%] | |
tests/test_fio_filter.py .. [ 28%] | |
tests/test_fio_info.py ...... [ 29%] | |
tests/test_fio_load.py ......... [ 31%] | |
tests/test_fio_ls.py ... [ 31%] | |
tests/test_geojson.py F.. [ 32%] | |
tests/test_geometry.py ......................... [ 36%] | |
tests/test_geopackage.py ss [ 36%] | |
tests/test_integration.py . [ 37%] | |
tests/test_layer.py .................................................... [ 45%] | |
..................................................... [ 54%] | |
tests/test_listing.py ....FF...... [ 56%] | |
tests/test_multiconxn.py ....... [ 57%] | |
tests/test_non_counting_layer.py ...... [ 58%] | |
tests/test_profile.py .. [ 58%] | |
tests/test_props.py ...... [ 59%] | |
tests/test_read_drivers.py .. [ 60%] | |
tests/test_remove.py .... [ 60%] | |
tests/test_revolvingdoor.py . [ 60%] | |
tests/test_rfc3339.py ........... [ 62%] | |
tests/test_schema.py .... [ 63%] | |
tests/test_slice.py ...... [ 64%] | |
tests/test_unicode.py ....x. [ 65%] | |
tests/test_vfs.py ...................................................... [ 74%] | |
...............FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF [ 86%] | |
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF [ 98%] | |
FFFFFFFFFFF [100%] | |
=================================== FAILURES =================================== | |
___________________________ ReadingTest.test_bounds ____________________________ | |
self = <tests.test_bytescollection.ReadingTest testMethod=test_bounds> | |
def setUp(self): | |
> with open('tests/data/coutwildrnp.json') as src: | |
E IOError: [Errno 2] No such file or directory: 'tests/data/coutwildrnp.json' | |
tests/test_bytescollection.py:16: IOError | |
_________________________ ReadingTest.test_closed_buf __________________________ | |
self = <tests.test_bytescollection.ReadingTest testMethod=test_closed_buf> | |
def setUp(self): | |
> with open('tests/data/coutwildrnp.json') as src: | |
E IOError: [Errno 2] No such file or directory: 'tests/data/coutwildrnp.json' | |
tests/test_bytescollection.py:16: IOError | |
_________________________ ReadingTest.test_closed_crs __________________________ | |
self = <tests.test_bytescollection.ReadingTest testMethod=test_closed_crs> | |
def setUp(self): | |
> with open('tests/data/coutwildrnp.json') as src: | |
E IOError: [Errno 2] No such file or directory: 'tests/data/coutwildrnp.json' | |
tests/test_bytescollection.py:16: IOError | |
________________________ ReadingTest.test_closed_driver ________________________ | |
self = <tests.test_bytescollection.ReadingTest testMethod=test_closed_driver> | |
def setUp(self): | |
> with open('tests/data/coutwildrnp.json') as src: | |
E IOError: [Errno 2] No such file or directory: 'tests/data/coutwildrnp.json' | |
tests/test_bytescollection.py:16: IOError | |
_________________________ ReadingTest.test_closed_len __________________________ | |
self = <tests.test_bytescollection.ReadingTest testMethod=test_closed_len> | |
def setUp(self): | |
> with open('tests/data/coutwildrnp.json') as src: | |
E IOError: [Errno 2] No such file or directory: 'tests/data/coutwildrnp.json' | |
tests/test_bytescollection.py:16: IOError | |
_______________________ ReadingTest.test_closed_no_iter ________________________ | |
self = <tests.test_bytescollection.ReadingTest testMethod=test_closed_no_iter> | |
def setUp(self): | |
> with open('tests/data/coutwildrnp.json') as src: | |
E IOError: [Errno 2] No such file or directory: 'tests/data/coutwildrnp.json' | |
tests/test_bytescollection.py:16: IOError | |
_________________________ ReadingTest.test_closed_repr _________________________ | |
self = <tests.test_bytescollection.ReadingTest testMethod=test_closed_repr> | |
def setUp(self): | |
> with open('tests/data/coutwildrnp.json') as src: | |
E IOError: [Errno 2] No such file or directory: 'tests/data/coutwildrnp.json' | |
tests/test_bytescollection.py:16: IOError | |
________________________ ReadingTest.test_closed_schema ________________________ | |
self = <tests.test_bytescollection.ReadingTest testMethod=test_closed_schema> | |
def setUp(self): | |
> with open('tests/data/coutwildrnp.json') as src: | |
E IOError: [Errno 2] No such file or directory: 'tests/data/coutwildrnp.json' | |
tests/test_bytescollection.py:16: IOError | |
_____________________ ReadingTest.test_closed_virtual_file _____________________ | |
self = <tests.test_bytescollection.ReadingTest testMethod=test_closed_virtual_file> | |
def setUp(self): | |
> with open('tests/data/coutwildrnp.json') as src: | |
E IOError: [Errno 2] No such file or directory: 'tests/data/coutwildrnp.json' | |
tests/test_bytescollection.py:16: IOError | |
_________________________ ReadingTest.test_collection __________________________ | |
self = <tests.test_bytescollection.ReadingTest testMethod=test_collection> | |
def setUp(self): | |
> with open('tests/data/coutwildrnp.json') as src: | |
E IOError: [Errno 2] No such file or directory: 'tests/data/coutwildrnp.json' | |
tests/test_bytescollection.py:16: IOError | |
_____________________________ ReadingTest.test_crs _____________________________ | |
self = <tests.test_bytescollection.ReadingTest testMethod=test_crs> | |
def setUp(self): | |
> with open('tests/data/coutwildrnp.json') as src: | |
E IOError: [Errno 2] No such file or directory: 'tests/data/coutwildrnp.json' | |
tests/test_bytescollection.py:16: IOError | |
_______________________ ReadingTest.test_crs_closed_crs ________________________ | |
self = <tests.test_bytescollection.ReadingTest testMethod=test_crs_closed_crs> | |
def setUp(self): | |
> with open('tests/data/coutwildrnp.json') as src: | |
E IOError: [Errno 2] No such file or directory: 'tests/data/coutwildrnp.json' | |
tests/test_bytescollection.py:16: IOError | |
___________________________ ReadingTest.test_crs_wkt ___________________________ | |
self = <tests.test_bytescollection.ReadingTest testMethod=test_crs_wkt> | |
def setUp(self): | |
> with open('tests/data/coutwildrnp.json') as src: | |
E IOError: [Errno 2] No such file or directory: 'tests/data/coutwildrnp.json' | |
tests/test_bytescollection.py:16: IOError | |
___________________________ ReadingTest.test_driver ____________________________ | |
self = <tests.test_bytescollection.ReadingTest testMethod=test_driver> | |
def setUp(self): | |
> with open('tests/data/coutwildrnp.json') as src: | |
E IOError: [Errno 2] No such file or directory: 'tests/data/coutwildrnp.json' | |
tests/test_bytescollection.py:16: IOError | |
____________________ ReadingTest.test_driver_closed_driver _____________________ | |
self = <tests.test_bytescollection.ReadingTest testMethod=test_driver_closed_driver> | |
def setUp(self): | |
> with open('tests/data/coutwildrnp.json') as src: | |
E IOError: [Errno 2] No such file or directory: 'tests/data/coutwildrnp.json' | |
tests/test_bytescollection.py:16: IOError | |
_________________________ ReadingTest.test_getitem_one _________________________ | |
self = <tests.test_bytescollection.ReadingTest testMethod=test_getitem_one> | |
def setUp(self): | |
> with open('tests/data/coutwildrnp.json') as src: | |
E IOError: [Errno 2] No such file or directory: 'tests/data/coutwildrnp.json' | |
tests/test_bytescollection.py:16: IOError | |
___________________________ ReadingTest.test_in_keys ___________________________ | |
self = <tests.test_bytescollection.ReadingTest testMethod=test_in_keys> | |
def setUp(self): | |
> with open('tests/data/coutwildrnp.json') as src: | |
E IOError: [Errno 2] No such file or directory: 'tests/data/coutwildrnp.json' | |
tests/test_bytescollection.py:16: IOError | |
____________________________ ReadingTest.test_iter _____________________________ | |
self = <tests.test_bytescollection.ReadingTest testMethod=test_iter> | |
def setUp(self): | |
> with open('tests/data/coutwildrnp.json') as src: | |
E IOError: [Errno 2] No such file or directory: 'tests/data/coutwildrnp.json' | |
tests/test_bytescollection.py:16: IOError | |
_______________________ ReadingTest.test_iter_items_list _______________________ | |
self = <tests.test_bytescollection.ReadingTest testMethod=test_iter_items_list> | |
def setUp(self): | |
> with open('tests/data/coutwildrnp.json') as src: | |
E IOError: [Errno 2] No such file or directory: 'tests/data/coutwildrnp.json' | |
tests/test_bytescollection.py:16: IOError | |
_______________________ ReadingTest.test_iter_keys_list ________________________ | |
self = <tests.test_bytescollection.ReadingTest testMethod=test_iter_keys_list> | |
def setUp(self): | |
> with open('tests/data/coutwildrnp.json') as src: | |
E IOError: [Errno 2] No such file or directory: 'tests/data/coutwildrnp.json' | |
tests/test_bytescollection.py:16: IOError | |
__________________________ ReadingTest.test_iter_list __________________________ | |
self = <tests.test_bytescollection.ReadingTest testMethod=test_iter_list> | |
def setUp(self): | |
> with open('tests/data/coutwildrnp.json') as src: | |
E IOError: [Errno 2] No such file or directory: 'tests/data/coutwildrnp.json' | |
tests/test_bytescollection.py:16: IOError | |
__________________________ ReadingTest.test_iter_one ___________________________ | |
self = <tests.test_bytescollection.ReadingTest testMethod=test_iter_one> | |
def setUp(self): | |
> with open('tests/data/coutwildrnp.json') as src: | |
E IOError: [Errno 2] No such file or directory: 'tests/data/coutwildrnp.json' | |
tests/test_bytescollection.py:16: IOError | |
_____________________________ ReadingTest.test_len _____________________________ | |
self = <tests.test_bytescollection.ReadingTest testMethod=test_len> | |
def setUp(self): | |
> with open('tests/data/coutwildrnp.json') as src: | |
E IOError: [Errno 2] No such file or directory: 'tests/data/coutwildrnp.json' | |
tests/test_bytescollection.py:16: IOError | |
_______________________ ReadingTest.test_len_closed_len ________________________ | |
self = <tests.test_bytescollection.ReadingTest testMethod=test_len_closed_len> | |
def setUp(self): | |
> with open('tests/data/coutwildrnp.json') as src: | |
E IOError: [Errno 2] No such file or directory: 'tests/data/coutwildrnp.json' | |
tests/test_bytescollection.py:16: IOError | |
____________________________ ReadingTest.test_meta _____________________________ | |
self = <tests.test_bytescollection.ReadingTest testMethod=test_meta> | |
def setUp(self): | |
> with open('tests/data/coutwildrnp.json') as src: | |
E IOError: [Errno 2] No such file or directory: 'tests/data/coutwildrnp.json' | |
tests/test_bytescollection.py:16: IOError | |
____________________________ ReadingTest.test_mode _____________________________ | |
self = <tests.test_bytescollection.ReadingTest testMethod=test_mode> | |
def setUp(self): | |
> with open('tests/data/coutwildrnp.json') as src: | |
E IOError: [Errno 2] No such file or directory: 'tests/data/coutwildrnp.json' | |
tests/test_bytescollection.py:16: IOError | |
____________________________ ReadingTest.test_name _____________________________ | |
self = <tests.test_bytescollection.ReadingTest testMethod=test_name> | |
def setUp(self): | |
> with open('tests/data/coutwildrnp.json') as src: | |
E IOError: [Errno 2] No such file or directory: 'tests/data/coutwildrnp.json' | |
tests/test_bytescollection.py:16: IOError | |
__________________________ ReadingTest.test_no_write ___________________________ | |
self = <tests.test_bytescollection.ReadingTest testMethod=test_no_write> | |
def setUp(self): | |
> with open('tests/data/coutwildrnp.json') as src: | |
E IOError: [Errno 2] No such file or directory: 'tests/data/coutwildrnp.json' | |
tests/test_bytescollection.py:16: IOError | |
__________________________ ReadingTest.test_open_repr __________________________ | |
self = <tests.test_bytescollection.ReadingTest testMethod=test_open_repr> | |
def setUp(self): | |
> with open('tests/data/coutwildrnp.json') as src: | |
E IOError: [Errno 2] No such file or directory: 'tests/data/coutwildrnp.json' | |
tests/test_bytescollection.py:16: IOError | |
____________________________ ReadingTest.test_path _____________________________ | |
self = <tests.test_bytescollection.ReadingTest testMethod=test_path> | |
def setUp(self): | |
> with open('tests/data/coutwildrnp.json') as src: | |
E IOError: [Errno 2] No such file or directory: 'tests/data/coutwildrnp.json' | |
tests/test_bytescollection.py:16: IOError | |
________________________ ReadingTest.test_re_iter_list _________________________ | |
self = <tests.test_bytescollection.ReadingTest testMethod=test_re_iter_list> | |
def setUp(self): | |
> with open('tests/data/coutwildrnp.json') as src: | |
E IOError: [Errno 2] No such file or directory: 'tests/data/coutwildrnp.json' | |
tests/test_bytescollection.py:16: IOError | |
___________________________ ReadingTest.test_schema ____________________________ | |
self = <tests.test_bytescollection.ReadingTest testMethod=test_schema> | |
def setUp(self): | |
> with open('tests/data/coutwildrnp.json') as src: | |
E IOError: [Errno 2] No such file or directory: 'tests/data/coutwildrnp.json' | |
tests/test_bytescollection.py:16: IOError | |
____________________ ReadingTest.test_schema_closed_schema _____________________ | |
self = <tests.test_bytescollection.ReadingTest testMethod=test_schema_closed_schema> | |
def setUp(self): | |
> with open('tests/data/coutwildrnp.json') as src: | |
E IOError: [Errno 2] No such file or directory: 'tests/data/coutwildrnp.json' | |
tests/test_bytescollection.py:16: IOError | |
_______________________ FilterReadingTest.test_filter_1 ________________________ | |
self = <tests.test_bytescollection.FilterReadingTest testMethod=test_filter_1> | |
def setUp(self): | |
> with open('tests/data/coutwildrnp.json') as src: | |
E IOError: [Errno 2] No such file or directory: 'tests/data/coutwildrnp.json' | |
tests/test_bytescollection.py:190: IOError | |
______________________ FilterReadingTest.test_filter_mask ______________________ | |
self = <tests.test_bytescollection.FilterReadingTest testMethod=test_filter_mask> | |
def setUp(self): | |
> with open('tests/data/coutwildrnp.json') as src: | |
E IOError: [Errno 2] No such file or directory: 'tests/data/coutwildrnp.json' | |
tests/test_bytescollection.py:190: IOError | |
_____________________ FilterReadingTest.test_filter_reset ______________________ | |
self = <tests.test_bytescollection.FilterReadingTest testMethod=test_filter_reset> | |
def setUp(self): | |
> with open('tests/data/coutwildrnp.json') as src: | |
E IOError: [Errno 2] No such file or directory: 'tests/data/coutwildrnp.json' | |
tests/test_bytescollection.py:190: IOError | |
_________________________ test_zipped_bytes_collection _________________________ | |
def test_zipped_bytes_collection(): | |
> with open('tests/data/coutwildrnp.zip', 'rb') as src: | |
E IOError: [Errno 2] No such file or directory: 'tests/data/coutwildrnp.zip' | |
tests/test_bytescollection.py:220: IOError | |
____________________________ ReadingTest.test_json _____________________________ | |
self = <tests.test_geojson.ReadingTest testMethod=test_json> | |
def setUp(self): | |
> self.c = fiona.open('tests/data/coutwildrnp.json', 'r') | |
tests/test_geojson.py:22: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = 'tests/data/coutwildrnp.json', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None, vfs = None, enabled_drivers = None | |
crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
raise IOError("no such archive file: %r" % archive) | |
elif path != '-' and not os.path.exists(path): | |
> raise IOError("no such file or directory: %r" % path) | |
E IOError: no such file or directory: 'tests/data/coutwildrnp.json' | |
fiona/__init__.py:162: IOError | |
________________________________ test_zip_path _________________________________ | |
def test_zip_path(): | |
> assert fiona.listlayers('zip://tests/data/coutwildrnp.zip') == ['coutwildrnp'] | |
tests/test_listing.py:30: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = 'tests/data/coutwildrnp.zip', vfs = None | |
def listlayers(path, vfs=None): | |
"""Returns a list of layer names in their index order. | |
The required ``path`` argument may be an absolute or relative file or | |
directory path. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path within | |
that container. | |
""" | |
if not isinstance(path, string_types): | |
raise TypeError("invalid path: %r" % path) | |
if vfs and not isinstance(vfs, string_types): | |
raise TypeError("invalid vfs: %r" % vfs) | |
path, vsi, archive = parse_paths(path, vfs) | |
if archive: | |
if not os.path.exists(archive): | |
raise IOError("no such archive file: %r" % archive) | |
elif not os.path.exists(path): | |
> raise IOError("no such file or directory: %r" % path) | |
E IOError: no such file or directory: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:233: IOError | |
______________________________ test_zip_path_arch ______________________________ | |
def test_zip_path_arch(): | |
> assert fiona.listlayers('/coutwildrnp.shp', vfs='zip://tests/data/coutwildrnp.zip') == ['coutwildrnp'] | |
tests/test_listing.py:33: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', vfs = 'zip://tests/data/coutwildrnp.zip' | |
def listlayers(path, vfs=None): | |
"""Returns a list of layer names in their index order. | |
The required ``path`` argument may be an absolute or relative file or | |
directory path. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path within | |
that container. | |
""" | |
if not isinstance(path, string_types): | |
raise TypeError("invalid path: %r" % path) | |
if vfs and not isinstance(vfs, string_types): | |
raise TypeError("invalid vfs: %r" % vfs) | |
path, vsi, archive = parse_paths(path, vfs) | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:231: IOError | |
__________________________ ZipReadingTest.test_bounds __________________________ | |
tests/test_vfs.py:33: in setUp | |
self.c = fiona.open("zip://tests/data/coutwildrnp.zip", "r") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = 'tests/data/coutwildrnp.zip', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None, vfs = None, enabled_drivers = None | |
crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
raise IOError("no such archive file: %r" % archive) | |
elif path != '-' and not os.path.exists(path): | |
> raise IOError("no such file or directory: %r" % path) | |
E IOError: no such file or directory: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:162: IOError | |
________________________ ZipReadingTest.test_closed_crs ________________________ | |
tests/test_vfs.py:33: in setUp | |
self.c = fiona.open("zip://tests/data/coutwildrnp.zip", "r") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = 'tests/data/coutwildrnp.zip', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None, vfs = None, enabled_drivers = None | |
crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
raise IOError("no such archive file: %r" % archive) | |
elif path != '-' and not os.path.exists(path): | |
> raise IOError("no such file or directory: %r" % path) | |
E IOError: no such file or directory: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:162: IOError | |
______________________ ZipReadingTest.test_closed_driver _______________________ | |
tests/test_vfs.py:33: in setUp | |
self.c = fiona.open("zip://tests/data/coutwildrnp.zip", "r") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = 'tests/data/coutwildrnp.zip', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None, vfs = None, enabled_drivers = None | |
crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
raise IOError("no such archive file: %r" % archive) | |
elif path != '-' and not os.path.exists(path): | |
> raise IOError("no such file or directory: %r" % path) | |
E IOError: no such file or directory: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:162: IOError | |
________________________ ZipReadingTest.test_closed_len ________________________ | |
tests/test_vfs.py:33: in setUp | |
self.c = fiona.open("zip://tests/data/coutwildrnp.zip", "r") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = 'tests/data/coutwildrnp.zip', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None, vfs = None, enabled_drivers = None | |
crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
raise IOError("no such archive file: %r" % archive) | |
elif path != '-' and not os.path.exists(path): | |
> raise IOError("no such file or directory: %r" % path) | |
E IOError: no such file or directory: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:162: IOError | |
______________________ ZipReadingTest.test_closed_no_iter ______________________ | |
tests/test_vfs.py:33: in setUp | |
self.c = fiona.open("zip://tests/data/coutwildrnp.zip", "r") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = 'tests/data/coutwildrnp.zip', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None, vfs = None, enabled_drivers = None | |
crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
raise IOError("no such archive file: %r" % archive) | |
elif path != '-' and not os.path.exists(path): | |
> raise IOError("no such file or directory: %r" % path) | |
E IOError: no such file or directory: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:162: IOError | |
_______________________ ZipReadingTest.test_closed_repr ________________________ | |
self = <tests.test_vfs.ZipReadingTest testMethod=test_closed_repr> | |
def setUp(self): | |
> self.c = fiona.open("zip://tests/data/coutwildrnp.zip", "r") | |
tests/test_vfs.py:33: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = 'tests/data/coutwildrnp.zip', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None, vfs = None, enabled_drivers = None | |
crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
raise IOError("no such archive file: %r" % archive) | |
elif path != '-' and not os.path.exists(path): | |
> raise IOError("no such file or directory: %r" % path) | |
E IOError: no such file or directory: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:162: IOError | |
______________________ ZipReadingTest.test_closed_schema _______________________ | |
tests/test_vfs.py:33: in setUp | |
self.c = fiona.open("zip://tests/data/coutwildrnp.zip", "r") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = 'tests/data/coutwildrnp.zip', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None, vfs = None, enabled_drivers = None | |
crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
raise IOError("no such archive file: %r" % archive) | |
elif path != '-' and not os.path.exists(path): | |
> raise IOError("no such file or directory: %r" % path) | |
E IOError: no such file or directory: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:162: IOError | |
________________________ ZipReadingTest.test_collection ________________________ | |
tests/test_vfs.py:33: in setUp | |
self.c = fiona.open("zip://tests/data/coutwildrnp.zip", "r") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = 'tests/data/coutwildrnp.zip', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None, vfs = None, enabled_drivers = None | |
crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
raise IOError("no such archive file: %r" % archive) | |
elif path != '-' and not os.path.exists(path): | |
> raise IOError("no such file or directory: %r" % path) | |
E IOError: no such file or directory: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:162: IOError | |
_________________________ ZipReadingTest.test_context __________________________ | |
tests/test_vfs.py:33: in setUp | |
self.c = fiona.open("zip://tests/data/coutwildrnp.zip", "r") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = 'tests/data/coutwildrnp.zip', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None, vfs = None, enabled_drivers = None | |
crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
raise IOError("no such archive file: %r" % archive) | |
elif path != '-' and not os.path.exists(path): | |
> raise IOError("no such file or directory: %r" % path) | |
E IOError: no such file or directory: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:162: IOError | |
___________________________ ZipReadingTest.test_crs ____________________________ | |
tests/test_vfs.py:33: in setUp | |
self.c = fiona.open("zip://tests/data/coutwildrnp.zip", "r") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = 'tests/data/coutwildrnp.zip', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None, vfs = None, enabled_drivers = None | |
crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
raise IOError("no such archive file: %r" % archive) | |
elif path != '-' and not os.path.exists(path): | |
> raise IOError("no such file or directory: %r" % path) | |
E IOError: no such file or directory: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:162: IOError | |
______________________ ZipReadingTest.test_crs_closed_crs ______________________ | |
tests/test_vfs.py:33: in setUp | |
self.c = fiona.open("zip://tests/data/coutwildrnp.zip", "r") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = 'tests/data/coutwildrnp.zip', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None, vfs = None, enabled_drivers = None | |
crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
raise IOError("no such archive file: %r" % archive) | |
elif path != '-' and not os.path.exists(path): | |
> raise IOError("no such file or directory: %r" % path) | |
E IOError: no such file or directory: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:162: IOError | |
_________________________ ZipReadingTest.test_crs_wkt __________________________ | |
tests/test_vfs.py:33: in setUp | |
self.c = fiona.open("zip://tests/data/coutwildrnp.zip", "r") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = 'tests/data/coutwildrnp.zip', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None, vfs = None, enabled_drivers = None | |
crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
raise IOError("no such archive file: %r" % archive) | |
elif path != '-' and not os.path.exists(path): | |
> raise IOError("no such file or directory: %r" % path) | |
E IOError: no such file or directory: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:162: IOError | |
__________________________ ZipReadingTest.test_driver __________________________ | |
tests/test_vfs.py:33: in setUp | |
self.c = fiona.open("zip://tests/data/coutwildrnp.zip", "r") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = 'tests/data/coutwildrnp.zip', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None, vfs = None, enabled_drivers = None | |
crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
raise IOError("no such archive file: %r" % archive) | |
elif path != '-' and not os.path.exists(path): | |
> raise IOError("no such file or directory: %r" % path) | |
E IOError: no such file or directory: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:162: IOError | |
___________________ ZipReadingTest.test_driver_closed_driver ___________________ | |
tests/test_vfs.py:33: in setUp | |
self.c = fiona.open("zip://tests/data/coutwildrnp.zip", "r") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = 'tests/data/coutwildrnp.zip', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None, vfs = None, enabled_drivers = None | |
crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
raise IOError("no such archive file: %r" % archive) | |
elif path != '-' and not os.path.exists(path): | |
> raise IOError("no such file or directory: %r" % path) | |
E IOError: no such file or directory: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:162: IOError | |
________________________ ZipReadingTest.test_filter_vsi ________________________ | |
self = <tests.test_vfs.ZipReadingTest testMethod=test_filter_vsi> | |
def setUp(self): | |
> self.c = fiona.open("zip://tests/data/coutwildrnp.zip", "r") | |
tests/test_vfs.py:33: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = 'tests/data/coutwildrnp.zip', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None, vfs = None, enabled_drivers = None | |
crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
raise IOError("no such archive file: %r" % archive) | |
elif path != '-' and not os.path.exists(path): | |
> raise IOError("no such file or directory: %r" % path) | |
E IOError: no such file or directory: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:162: IOError | |
____________________ ZipReadingTest.test_getitem_iter_combo ____________________ | |
tests/test_vfs.py:33: in setUp | |
self.c = fiona.open("zip://tests/data/coutwildrnp.zip", "r") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = 'tests/data/coutwildrnp.zip', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None, vfs = None, enabled_drivers = None | |
crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
raise IOError("no such archive file: %r" % archive) | |
elif path != '-' and not os.path.exists(path): | |
> raise IOError("no such file or directory: %r" % path) | |
E IOError: no such file or directory: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:162: IOError | |
_______________________ ZipReadingTest.test_getitem_one ________________________ | |
tests/test_vfs.py:33: in setUp | |
self.c = fiona.open("zip://tests/data/coutwildrnp.zip", "r") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = 'tests/data/coutwildrnp.zip', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None, vfs = None, enabled_drivers = None | |
crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
raise IOError("no such archive file: %r" % archive) | |
elif path != '-' and not os.path.exists(path): | |
> raise IOError("no such file or directory: %r" % path) | |
E IOError: no such file or directory: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:162: IOError | |
_________________________ ZipReadingTest.test_in_keys __________________________ | |
tests/test_vfs.py:33: in setUp | |
self.c = fiona.open("zip://tests/data/coutwildrnp.zip", "r") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = 'tests/data/coutwildrnp.zip', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None, vfs = None, enabled_drivers = None | |
crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
raise IOError("no such archive file: %r" % archive) | |
elif path != '-' and not os.path.exists(path): | |
> raise IOError("no such file or directory: %r" % path) | |
E IOError: no such file or directory: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:162: IOError | |
___________________________ ZipReadingTest.test_iter ___________________________ | |
tests/test_vfs.py:33: in setUp | |
self.c = fiona.open("zip://tests/data/coutwildrnp.zip", "r") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = 'tests/data/coutwildrnp.zip', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None, vfs = None, enabled_drivers = None | |
crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
raise IOError("no such archive file: %r" % archive) | |
elif path != '-' and not os.path.exists(path): | |
> raise IOError("no such file or directory: %r" % path) | |
E IOError: no such file or directory: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:162: IOError | |
_____________________ ZipReadingTest.test_iter_items_list ______________________ | |
tests/test_vfs.py:33: in setUp | |
self.c = fiona.open("zip://tests/data/coutwildrnp.zip", "r") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = 'tests/data/coutwildrnp.zip', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None, vfs = None, enabled_drivers = None | |
crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
raise IOError("no such archive file: %r" % archive) | |
elif path != '-' and not os.path.exists(path): | |
> raise IOError("no such file or directory: %r" % path) | |
E IOError: no such file or directory: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:162: IOError | |
______________________ ZipReadingTest.test_iter_keys_list ______________________ | |
tests/test_vfs.py:33: in setUp | |
self.c = fiona.open("zip://tests/data/coutwildrnp.zip", "r") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = 'tests/data/coutwildrnp.zip', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None, vfs = None, enabled_drivers = None | |
crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
raise IOError("no such archive file: %r" % archive) | |
elif path != '-' and not os.path.exists(path): | |
> raise IOError("no such file or directory: %r" % path) | |
E IOError: no such file or directory: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:162: IOError | |
________________________ ZipReadingTest.test_iter_list _________________________ | |
tests/test_vfs.py:33: in setUp | |
self.c = fiona.open("zip://tests/data/coutwildrnp.zip", "r") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = 'tests/data/coutwildrnp.zip', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None, vfs = None, enabled_drivers = None | |
crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
raise IOError("no such archive file: %r" % archive) | |
elif path != '-' and not os.path.exists(path): | |
> raise IOError("no such file or directory: %r" % path) | |
E IOError: no such file or directory: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:162: IOError | |
_________________________ ZipReadingTest.test_iter_one _________________________ | |
tests/test_vfs.py:33: in setUp | |
self.c = fiona.open("zip://tests/data/coutwildrnp.zip", "r") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = 'tests/data/coutwildrnp.zip', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None, vfs = None, enabled_drivers = None | |
crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
raise IOError("no such archive file: %r" % archive) | |
elif path != '-' and not os.path.exists(path): | |
> raise IOError("no such file or directory: %r" % path) | |
E IOError: no such file or directory: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:162: IOError | |
___________________________ ZipReadingTest.test_len ____________________________ | |
tests/test_vfs.py:33: in setUp | |
self.c = fiona.open("zip://tests/data/coutwildrnp.zip", "r") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = 'tests/data/coutwildrnp.zip', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None, vfs = None, enabled_drivers = None | |
crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
raise IOError("no such archive file: %r" % archive) | |
elif path != '-' and not os.path.exists(path): | |
> raise IOError("no such file or directory: %r" % path) | |
E IOError: no such file or directory: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:162: IOError | |
______________________ ZipReadingTest.test_len_closed_len ______________________ | |
tests/test_vfs.py:33: in setUp | |
self.c = fiona.open("zip://tests/data/coutwildrnp.zip", "r") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = 'tests/data/coutwildrnp.zip', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None, vfs = None, enabled_drivers = None | |
crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
raise IOError("no such archive file: %r" % archive) | |
elif path != '-' and not os.path.exists(path): | |
> raise IOError("no such file or directory: %r" % path) | |
E IOError: no such file or directory: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:162: IOError | |
___________________________ ZipReadingTest.test_meta ___________________________ | |
tests/test_vfs.py:33: in setUp | |
self.c = fiona.open("zip://tests/data/coutwildrnp.zip", "r") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = 'tests/data/coutwildrnp.zip', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None, vfs = None, enabled_drivers = None | |
crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
raise IOError("no such archive file: %r" % archive) | |
elif path != '-' and not os.path.exists(path): | |
> raise IOError("no such file or directory: %r" % path) | |
E IOError: no such file or directory: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:162: IOError | |
___________________________ ZipReadingTest.test_mode ___________________________ | |
tests/test_vfs.py:33: in setUp | |
self.c = fiona.open("zip://tests/data/coutwildrnp.zip", "r") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = 'tests/data/coutwildrnp.zip', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None, vfs = None, enabled_drivers = None | |
crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
raise IOError("no such archive file: %r" % archive) | |
elif path != '-' and not os.path.exists(path): | |
> raise IOError("no such file or directory: %r" % path) | |
E IOError: no such file or directory: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:162: IOError | |
___________________________ ZipReadingTest.test_name ___________________________ | |
tests/test_vfs.py:33: in setUp | |
self.c = fiona.open("zip://tests/data/coutwildrnp.zip", "r") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = 'tests/data/coutwildrnp.zip', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None, vfs = None, enabled_drivers = None | |
crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
raise IOError("no such archive file: %r" % archive) | |
elif path != '-' and not os.path.exists(path): | |
> raise IOError("no such file or directory: %r" % path) | |
E IOError: no such file or directory: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:162: IOError | |
_________________________ ZipReadingTest.test_no_write _________________________ | |
tests/test_vfs.py:33: in setUp | |
self.c = fiona.open("zip://tests/data/coutwildrnp.zip", "r") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = 'tests/data/coutwildrnp.zip', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None, vfs = None, enabled_drivers = None | |
crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
raise IOError("no such archive file: %r" % archive) | |
elif path != '-' and not os.path.exists(path): | |
> raise IOError("no such file or directory: %r" % path) | |
E IOError: no such file or directory: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:162: IOError | |
________________________ ZipReadingTest.test_open_repr _________________________ | |
self = <tests.test_vfs.ZipReadingTest testMethod=test_open_repr> | |
def setUp(self): | |
> self.c = fiona.open("zip://tests/data/coutwildrnp.zip", "r") | |
tests/test_vfs.py:33: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = 'tests/data/coutwildrnp.zip', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None, vfs = None, enabled_drivers = None | |
crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
raise IOError("no such archive file: %r" % archive) | |
elif path != '-' and not os.path.exists(path): | |
> raise IOError("no such file or directory: %r" % path) | |
E IOError: no such file or directory: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:162: IOError | |
___________________________ ZipReadingTest.test_path ___________________________ | |
self = <tests.test_vfs.ZipReadingTest testMethod=test_path> | |
def setUp(self): | |
> self.c = fiona.open("zip://tests/data/coutwildrnp.zip", "r") | |
tests/test_vfs.py:33: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = 'tests/data/coutwildrnp.zip', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None, vfs = None, enabled_drivers = None | |
crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
raise IOError("no such archive file: %r" % archive) | |
elif path != '-' and not os.path.exists(path): | |
> raise IOError("no such file or directory: %r" % path) | |
E IOError: no such file or directory: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:162: IOError | |
_________________________ ZipReadingTest.test_profile __________________________ | |
tests/test_vfs.py:33: in setUp | |
self.c = fiona.open("zip://tests/data/coutwildrnp.zip", "r") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = 'tests/data/coutwildrnp.zip', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None, vfs = None, enabled_drivers = None | |
crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
raise IOError("no such archive file: %r" % archive) | |
elif path != '-' and not os.path.exists(path): | |
> raise IOError("no such file or directory: %r" % path) | |
E IOError: no such file or directory: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:162: IOError | |
_______________________ ZipReadingTest.test_re_iter_list _______________________ | |
tests/test_vfs.py:33: in setUp | |
self.c = fiona.open("zip://tests/data/coutwildrnp.zip", "r") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = 'tests/data/coutwildrnp.zip', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None, vfs = None, enabled_drivers = None | |
crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
raise IOError("no such archive file: %r" % archive) | |
elif path != '-' and not os.path.exists(path): | |
> raise IOError("no such file or directory: %r" % path) | |
E IOError: no such file or directory: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:162: IOError | |
__________________________ ZipReadingTest.test_schema __________________________ | |
tests/test_vfs.py:33: in setUp | |
self.c = fiona.open("zip://tests/data/coutwildrnp.zip", "r") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = 'tests/data/coutwildrnp.zip', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None, vfs = None, enabled_drivers = None | |
crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
raise IOError("no such archive file: %r" % archive) | |
elif path != '-' and not os.path.exists(path): | |
> raise IOError("no such file or directory: %r" % path) | |
E IOError: no such file or directory: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:162: IOError | |
___________________ ZipReadingTest.test_schema_closed_schema ___________________ | |
tests/test_vfs.py:33: in setUp | |
self.c = fiona.open("zip://tests/data/coutwildrnp.zip", "r") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = 'tests/data/coutwildrnp.zip', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None, vfs = None, enabled_drivers = None | |
crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
raise IOError("no such archive file: %r" % archive) | |
elif path != '-' and not os.path.exists(path): | |
> raise IOError("no such file or directory: %r" % path) | |
E IOError: no such file or directory: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:162: IOError | |
______________________ ZipArchiveReadingTest.test_bounds _______________________ | |
tests/test_vfs.py:58: in setUp | |
self.c = fiona.open("/coutwildrnp.shp", "r", vfs="zip://tests/data/coutwildrnp.zip") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None, vfs = 'zip://tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
____________________ ZipArchiveReadingTest.test_closed_crs _____________________ | |
tests/test_vfs.py:58: in setUp | |
self.c = fiona.open("/coutwildrnp.shp", "r", vfs="zip://tests/data/coutwildrnp.zip") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None, vfs = 'zip://tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
___________________ ZipArchiveReadingTest.test_closed_driver ___________________ | |
tests/test_vfs.py:58: in setUp | |
self.c = fiona.open("/coutwildrnp.shp", "r", vfs="zip://tests/data/coutwildrnp.zip") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None, vfs = 'zip://tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
____________________ ZipArchiveReadingTest.test_closed_len _____________________ | |
tests/test_vfs.py:58: in setUp | |
self.c = fiona.open("/coutwildrnp.shp", "r", vfs="zip://tests/data/coutwildrnp.zip") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None, vfs = 'zip://tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
__________________ ZipArchiveReadingTest.test_closed_no_iter ___________________ | |
tests/test_vfs.py:58: in setUp | |
self.c = fiona.open("/coutwildrnp.shp", "r", vfs="zip://tests/data/coutwildrnp.zip") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None, vfs = 'zip://tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
____________________ ZipArchiveReadingTest.test_closed_repr ____________________ | |
self = <tests.test_vfs.ZipArchiveReadingTest testMethod=test_closed_repr> | |
def setUp(self): | |
> self.c = fiona.open("/coutwildrnp.shp", "r", vfs="zip://tests/data/coutwildrnp.zip") | |
tests/test_vfs.py:58: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None, vfs = 'zip://tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
___________________ ZipArchiveReadingTest.test_closed_schema ___________________ | |
tests/test_vfs.py:58: in setUp | |
self.c = fiona.open("/coutwildrnp.shp", "r", vfs="zip://tests/data/coutwildrnp.zip") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None, vfs = 'zip://tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
____________________ ZipArchiveReadingTest.test_collection _____________________ | |
tests/test_vfs.py:58: in setUp | |
self.c = fiona.open("/coutwildrnp.shp", "r", vfs="zip://tests/data/coutwildrnp.zip") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None, vfs = 'zip://tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
______________________ ZipArchiveReadingTest.test_context ______________________ | |
tests/test_vfs.py:58: in setUp | |
self.c = fiona.open("/coutwildrnp.shp", "r", vfs="zip://tests/data/coutwildrnp.zip") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None, vfs = 'zip://tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
________________________ ZipArchiveReadingTest.test_crs ________________________ | |
tests/test_vfs.py:58: in setUp | |
self.c = fiona.open("/coutwildrnp.shp", "r", vfs="zip://tests/data/coutwildrnp.zip") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None, vfs = 'zip://tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
__________________ ZipArchiveReadingTest.test_crs_closed_crs ___________________ | |
tests/test_vfs.py:58: in setUp | |
self.c = fiona.open("/coutwildrnp.shp", "r", vfs="zip://tests/data/coutwildrnp.zip") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None, vfs = 'zip://tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
______________________ ZipArchiveReadingTest.test_crs_wkt ______________________ | |
tests/test_vfs.py:58: in setUp | |
self.c = fiona.open("/coutwildrnp.shp", "r", vfs="zip://tests/data/coutwildrnp.zip") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None, vfs = 'zip://tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
______________________ ZipArchiveReadingTest.test_driver _______________________ | |
tests/test_vfs.py:58: in setUp | |
self.c = fiona.open("/coutwildrnp.shp", "r", vfs="zip://tests/data/coutwildrnp.zip") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None, vfs = 'zip://tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
_______________ ZipArchiveReadingTest.test_driver_closed_driver ________________ | |
tests/test_vfs.py:58: in setUp | |
self.c = fiona.open("/coutwildrnp.shp", "r", vfs="zip://tests/data/coutwildrnp.zip") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None, vfs = 'zip://tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
____________________ ZipArchiveReadingTest.test_filter_vsi _____________________ | |
self = <tests.test_vfs.ZipArchiveReadingTest testMethod=test_filter_vsi> | |
def setUp(self): | |
> self.c = fiona.open("/coutwildrnp.shp", "r", vfs="zip://tests/data/coutwildrnp.zip") | |
tests/test_vfs.py:58: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None, vfs = 'zip://tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
________________ ZipArchiveReadingTest.test_getitem_iter_combo _________________ | |
tests/test_vfs.py:58: in setUp | |
self.c = fiona.open("/coutwildrnp.shp", "r", vfs="zip://tests/data/coutwildrnp.zip") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None, vfs = 'zip://tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
____________________ ZipArchiveReadingTest.test_getitem_one ____________________ | |
tests/test_vfs.py:58: in setUp | |
self.c = fiona.open("/coutwildrnp.shp", "r", vfs="zip://tests/data/coutwildrnp.zip") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None, vfs = 'zip://tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
______________________ ZipArchiveReadingTest.test_in_keys ______________________ | |
tests/test_vfs.py:58: in setUp | |
self.c = fiona.open("/coutwildrnp.shp", "r", vfs="zip://tests/data/coutwildrnp.zip") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None, vfs = 'zip://tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
_______________________ ZipArchiveReadingTest.test_iter ________________________ | |
tests/test_vfs.py:58: in setUp | |
self.c = fiona.open("/coutwildrnp.shp", "r", vfs="zip://tests/data/coutwildrnp.zip") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None, vfs = 'zip://tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
__________________ ZipArchiveReadingTest.test_iter_items_list __________________ | |
tests/test_vfs.py:58: in setUp | |
self.c = fiona.open("/coutwildrnp.shp", "r", vfs="zip://tests/data/coutwildrnp.zip") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None, vfs = 'zip://tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
__________________ ZipArchiveReadingTest.test_iter_keys_list ___________________ | |
tests/test_vfs.py:58: in setUp | |
self.c = fiona.open("/coutwildrnp.shp", "r", vfs="zip://tests/data/coutwildrnp.zip") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None, vfs = 'zip://tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
_____________________ ZipArchiveReadingTest.test_iter_list _____________________ | |
tests/test_vfs.py:58: in setUp | |
self.c = fiona.open("/coutwildrnp.shp", "r", vfs="zip://tests/data/coutwildrnp.zip") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None, vfs = 'zip://tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
_____________________ ZipArchiveReadingTest.test_iter_one ______________________ | |
tests/test_vfs.py:58: in setUp | |
self.c = fiona.open("/coutwildrnp.shp", "r", vfs="zip://tests/data/coutwildrnp.zip") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None, vfs = 'zip://tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
________________________ ZipArchiveReadingTest.test_len ________________________ | |
tests/test_vfs.py:58: in setUp | |
self.c = fiona.open("/coutwildrnp.shp", "r", vfs="zip://tests/data/coutwildrnp.zip") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None, vfs = 'zip://tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
__________________ ZipArchiveReadingTest.test_len_closed_len ___________________ | |
tests/test_vfs.py:58: in setUp | |
self.c = fiona.open("/coutwildrnp.shp", "r", vfs="zip://tests/data/coutwildrnp.zip") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None, vfs = 'zip://tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
_______________________ ZipArchiveReadingTest.test_meta ________________________ | |
tests/test_vfs.py:58: in setUp | |
self.c = fiona.open("/coutwildrnp.shp", "r", vfs="zip://tests/data/coutwildrnp.zip") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None, vfs = 'zip://tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
_______________________ ZipArchiveReadingTest.test_mode ________________________ | |
tests/test_vfs.py:58: in setUp | |
self.c = fiona.open("/coutwildrnp.shp", "r", vfs="zip://tests/data/coutwildrnp.zip") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None, vfs = 'zip://tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
_______________________ ZipArchiveReadingTest.test_name ________________________ | |
tests/test_vfs.py:58: in setUp | |
self.c = fiona.open("/coutwildrnp.shp", "r", vfs="zip://tests/data/coutwildrnp.zip") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None, vfs = 'zip://tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
_____________________ ZipArchiveReadingTest.test_no_write ______________________ | |
tests/test_vfs.py:58: in setUp | |
self.c = fiona.open("/coutwildrnp.shp", "r", vfs="zip://tests/data/coutwildrnp.zip") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None, vfs = 'zip://tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
_____________________ ZipArchiveReadingTest.test_open_repr _____________________ | |
self = <tests.test_vfs.ZipArchiveReadingTest testMethod=test_open_repr> | |
def setUp(self): | |
> self.c = fiona.open("/coutwildrnp.shp", "r", vfs="zip://tests/data/coutwildrnp.zip") | |
tests/test_vfs.py:58: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None, vfs = 'zip://tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
_______________________ ZipArchiveReadingTest.test_path ________________________ | |
self = <tests.test_vfs.ZipArchiveReadingTest testMethod=test_path> | |
def setUp(self): | |
> self.c = fiona.open("/coutwildrnp.shp", "r", vfs="zip://tests/data/coutwildrnp.zip") | |
tests/test_vfs.py:58: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None, vfs = 'zip://tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
______________________ ZipArchiveReadingTest.test_profile ______________________ | |
tests/test_vfs.py:58: in setUp | |
self.c = fiona.open("/coutwildrnp.shp", "r", vfs="zip://tests/data/coutwildrnp.zip") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None, vfs = 'zip://tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
___________________ ZipArchiveReadingTest.test_re_iter_list ____________________ | |
tests/test_vfs.py:58: in setUp | |
self.c = fiona.open("/coutwildrnp.shp", "r", vfs="zip://tests/data/coutwildrnp.zip") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None, vfs = 'zip://tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
______________________ ZipArchiveReadingTest.test_schema _______________________ | |
tests/test_vfs.py:58: in setUp | |
self.c = fiona.open("/coutwildrnp.shp", "r", vfs="zip://tests/data/coutwildrnp.zip") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None, vfs = 'zip://tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
_______________ ZipArchiveReadingTest.test_schema_closed_schema ________________ | |
tests/test_vfs.py:58: in setUp | |
self.c = fiona.open("/coutwildrnp.shp", "r", vfs="zip://tests/data/coutwildrnp.zip") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None, vfs = 'zip://tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
___________________ ZipArchiveReadingTestAbsPath.test_bounds ___________________ | |
tests/test_vfs.py:85: in setUp | |
vfs="zip://" + os.path.abspath("tests/data/coutwildrnp.zip")) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None | |
vfs = 'zip:///Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: '/Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
_________________ ZipArchiveReadingTestAbsPath.test_closed_crs _________________ | |
tests/test_vfs.py:85: in setUp | |
vfs="zip://" + os.path.abspath("tests/data/coutwildrnp.zip")) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None | |
vfs = 'zip:///Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: '/Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
_______________ ZipArchiveReadingTestAbsPath.test_closed_driver ________________ | |
tests/test_vfs.py:85: in setUp | |
vfs="zip://" + os.path.abspath("tests/data/coutwildrnp.zip")) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None | |
vfs = 'zip:///Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: '/Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
_________________ ZipArchiveReadingTestAbsPath.test_closed_len _________________ | |
tests/test_vfs.py:85: in setUp | |
vfs="zip://" + os.path.abspath("tests/data/coutwildrnp.zip")) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None | |
vfs = 'zip:///Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: '/Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
_______________ ZipArchiveReadingTestAbsPath.test_closed_no_iter _______________ | |
tests/test_vfs.py:85: in setUp | |
vfs="zip://" + os.path.abspath("tests/data/coutwildrnp.zip")) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None | |
vfs = 'zip:///Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: '/Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
________________ ZipArchiveReadingTestAbsPath.test_closed_repr _________________ | |
self = <tests.test_vfs.ZipArchiveReadingTestAbsPath testMethod=test_closed_repr> | |
def setUp(self): | |
self.c = fiona.open( | |
"/coutwildrnp.shp", "r", | |
> vfs="zip://" + os.path.abspath("tests/data/coutwildrnp.zip")) | |
tests/test_vfs.py:85: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None | |
vfs = 'zip:///Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: '/Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
_______________ ZipArchiveReadingTestAbsPath.test_closed_schema ________________ | |
tests/test_vfs.py:85: in setUp | |
vfs="zip://" + os.path.abspath("tests/data/coutwildrnp.zip")) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None | |
vfs = 'zip:///Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: '/Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
_________________ ZipArchiveReadingTestAbsPath.test_collection _________________ | |
tests/test_vfs.py:85: in setUp | |
vfs="zip://" + os.path.abspath("tests/data/coutwildrnp.zip")) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None | |
vfs = 'zip:///Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: '/Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
__________________ ZipArchiveReadingTestAbsPath.test_context ___________________ | |
tests/test_vfs.py:85: in setUp | |
vfs="zip://" + os.path.abspath("tests/data/coutwildrnp.zip")) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None | |
vfs = 'zip:///Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: '/Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
____________________ ZipArchiveReadingTestAbsPath.test_crs _____________________ | |
tests/test_vfs.py:85: in setUp | |
vfs="zip://" + os.path.abspath("tests/data/coutwildrnp.zip")) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None | |
vfs = 'zip:///Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: '/Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
_______________ ZipArchiveReadingTestAbsPath.test_crs_closed_crs _______________ | |
tests/test_vfs.py:85: in setUp | |
vfs="zip://" + os.path.abspath("tests/data/coutwildrnp.zip")) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None | |
vfs = 'zip:///Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: '/Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
__________________ ZipArchiveReadingTestAbsPath.test_crs_wkt ___________________ | |
tests/test_vfs.py:85: in setUp | |
vfs="zip://" + os.path.abspath("tests/data/coutwildrnp.zip")) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None | |
vfs = 'zip:///Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: '/Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
___________________ ZipArchiveReadingTestAbsPath.test_driver ___________________ | |
tests/test_vfs.py:85: in setUp | |
vfs="zip://" + os.path.abspath("tests/data/coutwildrnp.zip")) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None | |
vfs = 'zip:///Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: '/Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
____________ ZipArchiveReadingTestAbsPath.test_driver_closed_driver ____________ | |
tests/test_vfs.py:85: in setUp | |
vfs="zip://" + os.path.abspath("tests/data/coutwildrnp.zip")) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None | |
vfs = 'zip:///Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: '/Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
_________________ ZipArchiveReadingTestAbsPath.test_filter_vsi _________________ | |
self = <tests.test_vfs.ZipArchiveReadingTestAbsPath testMethod=test_filter_vsi> | |
def setUp(self): | |
self.c = fiona.open( | |
"/coutwildrnp.shp", "r", | |
> vfs="zip://" + os.path.abspath("tests/data/coutwildrnp.zip")) | |
tests/test_vfs.py:85: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None | |
vfs = 'zip:///Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: '/Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
_____________ ZipArchiveReadingTestAbsPath.test_getitem_iter_combo _____________ | |
tests/test_vfs.py:85: in setUp | |
vfs="zip://" + os.path.abspath("tests/data/coutwildrnp.zip")) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None | |
vfs = 'zip:///Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: '/Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
________________ ZipArchiveReadingTestAbsPath.test_getitem_one _________________ | |
tests/test_vfs.py:85: in setUp | |
vfs="zip://" + os.path.abspath("tests/data/coutwildrnp.zip")) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None | |
vfs = 'zip:///Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: '/Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
__________________ ZipArchiveReadingTestAbsPath.test_in_keys ___________________ | |
tests/test_vfs.py:85: in setUp | |
vfs="zip://" + os.path.abspath("tests/data/coutwildrnp.zip")) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None | |
vfs = 'zip:///Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: '/Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
____________________ ZipArchiveReadingTestAbsPath.test_iter ____________________ | |
tests/test_vfs.py:85: in setUp | |
vfs="zip://" + os.path.abspath("tests/data/coutwildrnp.zip")) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None | |
vfs = 'zip:///Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: '/Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
______________ ZipArchiveReadingTestAbsPath.test_iter_items_list _______________ | |
tests/test_vfs.py:85: in setUp | |
vfs="zip://" + os.path.abspath("tests/data/coutwildrnp.zip")) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None | |
vfs = 'zip:///Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: '/Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
_______________ ZipArchiveReadingTestAbsPath.test_iter_keys_list _______________ | |
tests/test_vfs.py:85: in setUp | |
vfs="zip://" + os.path.abspath("tests/data/coutwildrnp.zip")) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None | |
vfs = 'zip:///Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: '/Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
_________________ ZipArchiveReadingTestAbsPath.test_iter_list __________________ | |
tests/test_vfs.py:85: in setUp | |
vfs="zip://" + os.path.abspath("tests/data/coutwildrnp.zip")) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None | |
vfs = 'zip:///Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: '/Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
__________________ ZipArchiveReadingTestAbsPath.test_iter_one __________________ | |
tests/test_vfs.py:85: in setUp | |
vfs="zip://" + os.path.abspath("tests/data/coutwildrnp.zip")) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None | |
vfs = 'zip:///Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: '/Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
____________________ ZipArchiveReadingTestAbsPath.test_len _____________________ | |
tests/test_vfs.py:85: in setUp | |
vfs="zip://" + os.path.abspath("tests/data/coutwildrnp.zip")) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None | |
vfs = 'zip:///Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: '/Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
_______________ ZipArchiveReadingTestAbsPath.test_len_closed_len _______________ | |
tests/test_vfs.py:85: in setUp | |
vfs="zip://" + os.path.abspath("tests/data/coutwildrnp.zip")) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None | |
vfs = 'zip:///Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: '/Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
____________________ ZipArchiveReadingTestAbsPath.test_meta ____________________ | |
tests/test_vfs.py:85: in setUp | |
vfs="zip://" + os.path.abspath("tests/data/coutwildrnp.zip")) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None | |
vfs = 'zip:///Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: '/Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
____________________ ZipArchiveReadingTestAbsPath.test_mode ____________________ | |
tests/test_vfs.py:85: in setUp | |
vfs="zip://" + os.path.abspath("tests/data/coutwildrnp.zip")) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None | |
vfs = 'zip:///Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: '/Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
____________________ ZipArchiveReadingTestAbsPath.test_name ____________________ | |
tests/test_vfs.py:85: in setUp | |
vfs="zip://" + os.path.abspath("tests/data/coutwildrnp.zip")) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None | |
vfs = 'zip:///Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: '/Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
__________________ ZipArchiveReadingTestAbsPath.test_no_write __________________ | |
tests/test_vfs.py:85: in setUp | |
vfs="zip://" + os.path.abspath("tests/data/coutwildrnp.zip")) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None | |
vfs = 'zip:///Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: '/Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
_________________ ZipArchiveReadingTestAbsPath.test_open_repr __________________ | |
self = <tests.test_vfs.ZipArchiveReadingTestAbsPath testMethod=test_open_repr> | |
def setUp(self): | |
self.c = fiona.open( | |
"/coutwildrnp.shp", "r", | |
> vfs="zip://" + os.path.abspath("tests/data/coutwildrnp.zip")) | |
tests/test_vfs.py:85: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None | |
vfs = 'zip:///Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: '/Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
____________________ ZipArchiveReadingTestAbsPath.test_path ____________________ | |
self = <tests.test_vfs.ZipArchiveReadingTestAbsPath testMethod=test_path> | |
def setUp(self): | |
self.c = fiona.open( | |
"/coutwildrnp.shp", "r", | |
> vfs="zip://" + os.path.abspath("tests/data/coutwildrnp.zip")) | |
tests/test_vfs.py:85: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None | |
vfs = 'zip:///Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: '/Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
__________________ ZipArchiveReadingTestAbsPath.test_profile ___________________ | |
tests/test_vfs.py:85: in setUp | |
vfs="zip://" + os.path.abspath("tests/data/coutwildrnp.zip")) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None | |
vfs = 'zip:///Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: '/Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
________________ ZipArchiveReadingTestAbsPath.test_re_iter_list ________________ | |
tests/test_vfs.py:85: in setUp | |
vfs="zip://" + os.path.abspath("tests/data/coutwildrnp.zip")) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None | |
vfs = 'zip:///Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: '/Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
___________________ ZipArchiveReadingTestAbsPath.test_schema ___________________ | |
tests/test_vfs.py:85: in setUp | |
vfs="zip://" + os.path.abspath("tests/data/coutwildrnp.zip")) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None | |
vfs = 'zip:///Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: '/Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
____________ ZipArchiveReadingTestAbsPath.test_schema_closed_schema ____________ | |
tests/test_vfs.py:85: in setUp | |
vfs="zip://" + os.path.abspath("tests/data/coutwildrnp.zip")) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/coutwildrnp.shp', mode = 'r', driver = None, schema = None, crs = None | |
encoding = None, layer = None | |
vfs = 'zip:///Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: '/Users/heyarne/tmp/Fiona/tests/data/coutwildrnp.zip' | |
fiona/__init__.py:160: IOError | |
______________________ TarArchiveReadingTest.test_bounds _______________________ | |
tests/test_vfs.py:101: in setUp | |
self.c = fiona.open("/testing/coutwildrnp.shp", "r", vfs="tar://tests/data/coutwildrnp.tar") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/testing/coutwildrnp.shp', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None | |
vfs = 'tar://tests/data/coutwildrnp.tar', enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.tar' | |
fiona/__init__.py:160: IOError | |
____________________ TarArchiveReadingTest.test_closed_crs _____________________ | |
tests/test_vfs.py:101: in setUp | |
self.c = fiona.open("/testing/coutwildrnp.shp", "r", vfs="tar://tests/data/coutwildrnp.tar") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/testing/coutwildrnp.shp', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None | |
vfs = 'tar://tests/data/coutwildrnp.tar', enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.tar' | |
fiona/__init__.py:160: IOError | |
___________________ TarArchiveReadingTest.test_closed_driver ___________________ | |
tests/test_vfs.py:101: in setUp | |
self.c = fiona.open("/testing/coutwildrnp.shp", "r", vfs="tar://tests/data/coutwildrnp.tar") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/testing/coutwildrnp.shp', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None | |
vfs = 'tar://tests/data/coutwildrnp.tar', enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.tar' | |
fiona/__init__.py:160: IOError | |
____________________ TarArchiveReadingTest.test_closed_len _____________________ | |
tests/test_vfs.py:101: in setUp | |
self.c = fiona.open("/testing/coutwildrnp.shp", "r", vfs="tar://tests/data/coutwildrnp.tar") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/testing/coutwildrnp.shp', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None | |
vfs = 'tar://tests/data/coutwildrnp.tar', enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.tar' | |
fiona/__init__.py:160: IOError | |
__________________ TarArchiveReadingTest.test_closed_no_iter ___________________ | |
tests/test_vfs.py:101: in setUp | |
self.c = fiona.open("/testing/coutwildrnp.shp", "r", vfs="tar://tests/data/coutwildrnp.tar") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/testing/coutwildrnp.shp', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None | |
vfs = 'tar://tests/data/coutwildrnp.tar', enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.tar' | |
fiona/__init__.py:160: IOError | |
____________________ TarArchiveReadingTest.test_closed_repr ____________________ | |
self = <tests.test_vfs.TarArchiveReadingTest testMethod=test_closed_repr> | |
def setUp(self): | |
> self.c = fiona.open("/testing/coutwildrnp.shp", "r", vfs="tar://tests/data/coutwildrnp.tar") | |
tests/test_vfs.py:101: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/testing/coutwildrnp.shp', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None | |
vfs = 'tar://tests/data/coutwildrnp.tar', enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.tar' | |
fiona/__init__.py:160: IOError | |
___________________ TarArchiveReadingTest.test_closed_schema ___________________ | |
tests/test_vfs.py:101: in setUp | |
self.c = fiona.open("/testing/coutwildrnp.shp", "r", vfs="tar://tests/data/coutwildrnp.tar") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/testing/coutwildrnp.shp', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None | |
vfs = 'tar://tests/data/coutwildrnp.tar', enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.tar' | |
fiona/__init__.py:160: IOError | |
____________________ TarArchiveReadingTest.test_collection _____________________ | |
tests/test_vfs.py:101: in setUp | |
self.c = fiona.open("/testing/coutwildrnp.shp", "r", vfs="tar://tests/data/coutwildrnp.tar") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/testing/coutwildrnp.shp', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None | |
vfs = 'tar://tests/data/coutwildrnp.tar', enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.tar' | |
fiona/__init__.py:160: IOError | |
______________________ TarArchiveReadingTest.test_context ______________________ | |
tests/test_vfs.py:101: in setUp | |
self.c = fiona.open("/testing/coutwildrnp.shp", "r", vfs="tar://tests/data/coutwildrnp.tar") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/testing/coutwildrnp.shp', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None | |
vfs = 'tar://tests/data/coutwildrnp.tar', enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.tar' | |
fiona/__init__.py:160: IOError | |
________________________ TarArchiveReadingTest.test_crs ________________________ | |
tests/test_vfs.py:101: in setUp | |
self.c = fiona.open("/testing/coutwildrnp.shp", "r", vfs="tar://tests/data/coutwildrnp.tar") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/testing/coutwildrnp.shp', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None | |
vfs = 'tar://tests/data/coutwildrnp.tar', enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.tar' | |
fiona/__init__.py:160: IOError | |
__________________ TarArchiveReadingTest.test_crs_closed_crs ___________________ | |
tests/test_vfs.py:101: in setUp | |
self.c = fiona.open("/testing/coutwildrnp.shp", "r", vfs="tar://tests/data/coutwildrnp.tar") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/testing/coutwildrnp.shp', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None | |
vfs = 'tar://tests/data/coutwildrnp.tar', enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.tar' | |
fiona/__init__.py:160: IOError | |
______________________ TarArchiveReadingTest.test_crs_wkt ______________________ | |
tests/test_vfs.py:101: in setUp | |
self.c = fiona.open("/testing/coutwildrnp.shp", "r", vfs="tar://tests/data/coutwildrnp.tar") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/testing/coutwildrnp.shp', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None | |
vfs = 'tar://tests/data/coutwildrnp.tar', enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.tar' | |
fiona/__init__.py:160: IOError | |
______________________ TarArchiveReadingTest.test_driver _______________________ | |
tests/test_vfs.py:101: in setUp | |
self.c = fiona.open("/testing/coutwildrnp.shp", "r", vfs="tar://tests/data/coutwildrnp.tar") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/testing/coutwildrnp.shp', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None | |
vfs = 'tar://tests/data/coutwildrnp.tar', enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.tar' | |
fiona/__init__.py:160: IOError | |
_______________ TarArchiveReadingTest.test_driver_closed_driver ________________ | |
tests/test_vfs.py:101: in setUp | |
self.c = fiona.open("/testing/coutwildrnp.shp", "r", vfs="tar://tests/data/coutwildrnp.tar") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/testing/coutwildrnp.shp', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None | |
vfs = 'tar://tests/data/coutwildrnp.tar', enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.tar' | |
fiona/__init__.py:160: IOError | |
____________________ TarArchiveReadingTest.test_filter_vsi _____________________ | |
self = <tests.test_vfs.TarArchiveReadingTest testMethod=test_filter_vsi> | |
def setUp(self): | |
> self.c = fiona.open("/testing/coutwildrnp.shp", "r", vfs="tar://tests/data/coutwildrnp.tar") | |
tests/test_vfs.py:101: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/testing/coutwildrnp.shp', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None | |
vfs = 'tar://tests/data/coutwildrnp.tar', enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.tar' | |
fiona/__init__.py:160: IOError | |
________________ TarArchiveReadingTest.test_getitem_iter_combo _________________ | |
tests/test_vfs.py:101: in setUp | |
self.c = fiona.open("/testing/coutwildrnp.shp", "r", vfs="tar://tests/data/coutwildrnp.tar") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/testing/coutwildrnp.shp', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None | |
vfs = 'tar://tests/data/coutwildrnp.tar', enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.tar' | |
fiona/__init__.py:160: IOError | |
____________________ TarArchiveReadingTest.test_getitem_one ____________________ | |
tests/test_vfs.py:101: in setUp | |
self.c = fiona.open("/testing/coutwildrnp.shp", "r", vfs="tar://tests/data/coutwildrnp.tar") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/testing/coutwildrnp.shp', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None | |
vfs = 'tar://tests/data/coutwildrnp.tar', enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.tar' | |
fiona/__init__.py:160: IOError | |
______________________ TarArchiveReadingTest.test_in_keys ______________________ | |
tests/test_vfs.py:101: in setUp | |
self.c = fiona.open("/testing/coutwildrnp.shp", "r", vfs="tar://tests/data/coutwildrnp.tar") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/testing/coutwildrnp.shp', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None | |
vfs = 'tar://tests/data/coutwildrnp.tar', enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.tar' | |
fiona/__init__.py:160: IOError | |
_______________________ TarArchiveReadingTest.test_iter ________________________ | |
tests/test_vfs.py:101: in setUp | |
self.c = fiona.open("/testing/coutwildrnp.shp", "r", vfs="tar://tests/data/coutwildrnp.tar") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/testing/coutwildrnp.shp', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None | |
vfs = 'tar://tests/data/coutwildrnp.tar', enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.tar' | |
fiona/__init__.py:160: IOError | |
__________________ TarArchiveReadingTest.test_iter_items_list __________________ | |
tests/test_vfs.py:101: in setUp | |
self.c = fiona.open("/testing/coutwildrnp.shp", "r", vfs="tar://tests/data/coutwildrnp.tar") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/testing/coutwildrnp.shp', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None | |
vfs = 'tar://tests/data/coutwildrnp.tar', enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.tar' | |
fiona/__init__.py:160: IOError | |
__________________ TarArchiveReadingTest.test_iter_keys_list ___________________ | |
tests/test_vfs.py:101: in setUp | |
self.c = fiona.open("/testing/coutwildrnp.shp", "r", vfs="tar://tests/data/coutwildrnp.tar") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/testing/coutwildrnp.shp', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None | |
vfs = 'tar://tests/data/coutwildrnp.tar', enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.tar' | |
fiona/__init__.py:160: IOError | |
_____________________ TarArchiveReadingTest.test_iter_list _____________________ | |
tests/test_vfs.py:101: in setUp | |
self.c = fiona.open("/testing/coutwildrnp.shp", "r", vfs="tar://tests/data/coutwildrnp.tar") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/testing/coutwildrnp.shp', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None | |
vfs = 'tar://tests/data/coutwildrnp.tar', enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.tar' | |
fiona/__init__.py:160: IOError | |
_____________________ TarArchiveReadingTest.test_iter_one ______________________ | |
tests/test_vfs.py:101: in setUp | |
self.c = fiona.open("/testing/coutwildrnp.shp", "r", vfs="tar://tests/data/coutwildrnp.tar") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/testing/coutwildrnp.shp', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None | |
vfs = 'tar://tests/data/coutwildrnp.tar', enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.tar' | |
fiona/__init__.py:160: IOError | |
________________________ TarArchiveReadingTest.test_len ________________________ | |
tests/test_vfs.py:101: in setUp | |
self.c = fiona.open("/testing/coutwildrnp.shp", "r", vfs="tar://tests/data/coutwildrnp.tar") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/testing/coutwildrnp.shp', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None | |
vfs = 'tar://tests/data/coutwildrnp.tar', enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.tar' | |
fiona/__init__.py:160: IOError | |
__________________ TarArchiveReadingTest.test_len_closed_len ___________________ | |
tests/test_vfs.py:101: in setUp | |
self.c = fiona.open("/testing/coutwildrnp.shp", "r", vfs="tar://tests/data/coutwildrnp.tar") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/testing/coutwildrnp.shp', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None | |
vfs = 'tar://tests/data/coutwildrnp.tar', enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.tar' | |
fiona/__init__.py:160: IOError | |
_______________________ TarArchiveReadingTest.test_meta ________________________ | |
tests/test_vfs.py:101: in setUp | |
self.c = fiona.open("/testing/coutwildrnp.shp", "r", vfs="tar://tests/data/coutwildrnp.tar") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/testing/coutwildrnp.shp', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None | |
vfs = 'tar://tests/data/coutwildrnp.tar', enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.tar' | |
fiona/__init__.py:160: IOError | |
_______________________ TarArchiveReadingTest.test_mode ________________________ | |
tests/test_vfs.py:101: in setUp | |
self.c = fiona.open("/testing/coutwildrnp.shp", "r", vfs="tar://tests/data/coutwildrnp.tar") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/testing/coutwildrnp.shp', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None | |
vfs = 'tar://tests/data/coutwildrnp.tar', enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.tar' | |
fiona/__init__.py:160: IOError | |
_______________________ TarArchiveReadingTest.test_name ________________________ | |
tests/test_vfs.py:101: in setUp | |
self.c = fiona.open("/testing/coutwildrnp.shp", "r", vfs="tar://tests/data/coutwildrnp.tar") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/testing/coutwildrnp.shp', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None | |
vfs = 'tar://tests/data/coutwildrnp.tar', enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.tar' | |
fiona/__init__.py:160: IOError | |
_____________________ TarArchiveReadingTest.test_no_write ______________________ | |
tests/test_vfs.py:101: in setUp | |
self.c = fiona.open("/testing/coutwildrnp.shp", "r", vfs="tar://tests/data/coutwildrnp.tar") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/testing/coutwildrnp.shp', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None | |
vfs = 'tar://tests/data/coutwildrnp.tar', enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.tar' | |
fiona/__init__.py:160: IOError | |
_____________________ TarArchiveReadingTest.test_open_repr _____________________ | |
self = <tests.test_vfs.TarArchiveReadingTest testMethod=test_open_repr> | |
def setUp(self): | |
> self.c = fiona.open("/testing/coutwildrnp.shp", "r", vfs="tar://tests/data/coutwildrnp.tar") | |
tests/test_vfs.py:101: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/testing/coutwildrnp.shp', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None | |
vfs = 'tar://tests/data/coutwildrnp.tar', enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.tar' | |
fiona/__init__.py:160: IOError | |
_______________________ TarArchiveReadingTest.test_path ________________________ | |
self = <tests.test_vfs.TarArchiveReadingTest testMethod=test_path> | |
def setUp(self): | |
> self.c = fiona.open("/testing/coutwildrnp.shp", "r", vfs="tar://tests/data/coutwildrnp.tar") | |
tests/test_vfs.py:101: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/testing/coutwildrnp.shp', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None | |
vfs = 'tar://tests/data/coutwildrnp.tar', enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.tar' | |
fiona/__init__.py:160: IOError | |
______________________ TarArchiveReadingTest.test_profile ______________________ | |
tests/test_vfs.py:101: in setUp | |
self.c = fiona.open("/testing/coutwildrnp.shp", "r", vfs="tar://tests/data/coutwildrnp.tar") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/testing/coutwildrnp.shp', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None | |
vfs = 'tar://tests/data/coutwildrnp.tar', enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.tar' | |
fiona/__init__.py:160: IOError | |
___________________ TarArchiveReadingTest.test_re_iter_list ____________________ | |
tests/test_vfs.py:101: in setUp | |
self.c = fiona.open("/testing/coutwildrnp.shp", "r", vfs="tar://tests/data/coutwildrnp.tar") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/testing/coutwildrnp.shp', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None | |
vfs = 'tar://tests/data/coutwildrnp.tar', enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.tar' | |
fiona/__init__.py:160: IOError | |
______________________ TarArchiveReadingTest.test_schema _______________________ | |
tests/test_vfs.py:101: in setUp | |
self.c = fiona.open("/testing/coutwildrnp.shp", "r", vfs="tar://tests/data/coutwildrnp.tar") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/testing/coutwildrnp.shp', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None | |
vfs = 'tar://tests/data/coutwildrnp.tar', enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.tar' | |
fiona/__init__.py:160: IOError | |
_______________ TarArchiveReadingTest.test_schema_closed_schema ________________ | |
tests/test_vfs.py:101: in setUp | |
self.c = fiona.open("/testing/coutwildrnp.shp", "r", vfs="tar://tests/data/coutwildrnp.tar") | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
path = '/testing/coutwildrnp.shp', mode = 'r', driver = None, schema = None | |
crs = None, encoding = None, layer = None | |
vfs = 'tar://tests/data/coutwildrnp.tar', enabled_drivers = None, crs_wkt = None | |
def open( | |
path, | |
mode='r', | |
driver=None, | |
schema=None, | |
crs=None, | |
encoding=None, | |
layer=None, | |
vfs=None, | |
enabled_drivers=None, | |
crs_wkt=None): | |
"""Open file at ``path`` in ``mode`` "r" (read), "a" (append), or | |
"w" (write) and return a ``Collection`` object. | |
In write mode, a driver name such as "ESRI Shapefile" or "GPX" (see | |
OGR docs or ``ogr2ogr --help`` on the command line) and a schema | |
mapping such as: | |
{'geometry': 'Point', | |
'properties': [('class', 'int'), ('label', 'str'), | |
('value', 'float')]} | |
must be provided. If a particular ordering of properties ("fields" | |
in GIS parlance) in the written file is desired, a list of (key, | |
value) pairs as above or an ordered dict is required. If no ordering | |
is needed, a standard dict will suffice. | |
A coordinate reference system for collections in write mode can be | |
defined by the ``crs`` parameter. It takes Proj4 style mappings like | |
{'proj': 'longlat', 'ellps': 'WGS84', 'datum': 'WGS84', | |
'no_defs': True} | |
short hand strings like | |
EPSG:4326 | |
or WKT representations of coordinate reference systems. | |
The drivers used by Fiona will try to detect the encoding of data | |
files. If they fail, you may provide the proper ``encoding``, such | |
as 'Windows-1252' for the Natural Earth datasets. | |
When the provided path is to a file containing multiple named layers | |
of data, a layer can be singled out by ``layer``. | |
A virtual filesystem can be specified. The ``vfs`` parameter may be | |
an Apache Commons VFS style string beginning with "zip://" or | |
"tar://"". In this case, the ``path`` must be an absolute path | |
within that container. | |
The drivers enabled for opening datasets may be restricted to those | |
listed in the ``enabled_drivers`` parameter. This and the ``driver`` | |
parameter afford much control over opening of files. | |
# Trying only the GeoJSON driver when opening to read, the | |
# following raises ``DataIOError``: | |
fiona.open('example.shp', driver='GeoJSON') | |
# Trying first the GeoJSON driver, then the Shapefile driver, | |
# the following succeeds: | |
fiona.open( | |
'example.shp', enabled_drivers=['GeoJSON', 'ESRI Shapefile']) | |
""" | |
# Parse the vfs into a vsi and an archive path. | |
path, vsi, archive = parse_paths(path, vfs) | |
if mode in ('a', 'r'): | |
if archive: | |
if not os.path.exists(archive): | |
> raise IOError("no such archive file: %r" % archive) | |
E IOError: no such archive file: 'tests/data/coutwildrnp.tar' | |
fiona/__init__.py:160: IOError | |
========= 180 failed, 421 passed, 3 skipped, 1 xfailed in 7.89 seconds ========= |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment