diff --git a/geopandas/geodataframe.py b/geopandas/geodataframe.py index e4b8bc9..092dd4c 100644 --- a/geopandas/geodataframe.py +++ b/geopandas/geodataframe.py @@ -7,7 +7,6 @@ import json import os import sys -import fiona import numpy as np from pandas import DataFrame, Series from shapely.geometry import mapping @@ -245,6 +244,7 @@ class GeoDataFrame(DataFrame): The *kwargs* are passed to fiona.open and can be used to write to multi-layer data, store data within archives (zip files), etc. """ + import fiona def convert_type(in_type): if in_type == object: return 'str' diff --git a/geopandas/geoseries.py b/geopandas/geoseries.py index bd78675..a900184 100644 --- a/geopandas/geoseries.py +++ b/geopandas/geoseries.py @@ -1,8 +1,6 @@ from functools import partial from warnings import warn -import fiona -from fiona.crs import from_epsg import numpy as np from pandas import Series, DataFrame import pyproj @@ -74,6 +72,7 @@ class GeoSeries(Series): etc. """ + import fiona geoms = [] with fiona.open(filename, **kwargs) as f: crs = f.crs @@ -616,6 +615,7 @@ class GeoSeries(Series): projection, not geodesics. Objects crossing the dateline (or other projection boundary) will have undesirable behavior. """ + from fiona.crs import from_epsg if self.crs is None: raise ValueError('Cannot transform naive geometries. ' 'Please set a crs on the object first.') diff --git a/geopandas/io/file.py b/geopandas/io/file.py index 7f06393..107df4c 100644 --- a/geopandas/io/file.py +++ b/geopandas/io/file.py @@ -1,7 +1,6 @@ from collections import defaultdict from shapely.geometry import shape -import fiona from geopandas import GeoSeries, GeoDataFrame @@ -17,6 +16,7 @@ def read_file(filename, **kwargs): Properties that are not present in all features of the source file will not be properly aligned. This should be fixed. """ + import fiona geoms = [] columns = defaultdict(lambda: []) bbox = kwargs.pop('bbox', None)