This file contains hidden or 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
# Often when reading in a ShapeFile from Basemap, you'll get: "ValueError: readshapefile can only handle 2D shape types" | |
# A trick can be to convert your geometry in your GeoPandas Dataframe and restoring the new flattened 2D geometry | |
# series back into a shapefile and try again. | |
# edit from http://stackoverflow.com/questions/33417764/basemap-readshapefile-valueerror | |
from shapely.geometry import Polygon, MultiPolygon, shape, Point | |
import geopandas as gp | |
def convert_3D_2D(geometry): | |
''' |