This is not a huge priority right now, but I happen to stumble across this in code this morning. Its in io.py.
def save_shapefile(cdsdata, path, template):
"""
Accepts bokeh ColumnDataSource data and saves it as a shapefile,
using an existing template to determine the required schema.
"""
collection = fiona.open(template)
arrays = [np.column_stack([xs, ys]) for xs, ys in zip(cdsdata['xs'], cdsdata['ys'])]
polys = gv.Polygons(arrays, crs=ccrs.GOOGLE_MERCATOR)
projected = gv.operation.project_path(polys, projection=ccrs.PlateCarree())
data = [list(map(tuple, arr)) for arr in projected.split(datatype='array')]
shape_data = list(collection.items())[0][1]
shape_data['geometry']['coordinates'] = data
with fiona.open(path, 'w', collection.driver, collection.schema, collection.crs) as c:
c.write(shape_data)
We discussed the desire to avoid using shapefile as a long-term solution, but it looks like its already a current solution.
This is not a huge priority right now, but I happen to stumble across this in code this morning. Its in
io.py
.We discussed the desire to avoid using shapefile as a long-term solution, but it looks like its already a current solution.