We have a bunch of legacy code that uses from osgeo import gdal, ogr, where raster datasets are created with gdal and vector datasets with ogr. However, these don’t mix well when, say, rasterizing a vector dataset with gdal.rasterize. The ‘workaround’ is to create a vector dataset using gdal:
vector_ds = gdal.GetDriverByName("Memory").Create(“”, 0, 0, 0, gdal.GDT_Unknown) But this is arcane and quite unintuitive. Unless there’s another approach I’m unaware of. Could gdal.rasterize’s second parameter be made to support datasets from: ogr.GetDriverByName(driver_name).CreateDataSource(""), and similar? Currently, trying to source an OGR dataset directly results in the following exception: TypeError: in method 'wrapper_GDALRasterizeDestDS', argument 2 of type 'GDALDatasetShadow *' Best, Jesse Lead Computer Scientist Science Systems and Applications, Inc. Dr Compton Tucker Team NASA Goddard Space Flight Center
_______________________________________________ gdal-dev mailing list gdal-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/gdal-dev