Skip to content

Instantly share code, notes, and snippets.

View epifanio's full-sized avatar

Massimo Di Stefano epifanio

View GitHub Profile
@epifanio
epifanio / f.txt
Created April 11, 2021 20:10
Test GIST created by python code
ffffffffffffff
@epifanio
epifanio / filename for test gist
Created April 11, 2021 19:59
Test GIST created by python code
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
from osgeo import gdal, ogr, osr
raster_path = "test.tif"
shapefile_path = "test.shp"
source_raster = gdal.Open(raster_path)
band = gdal.Open(raster_path).GetRasterBand(1)
driver = ogr.GetDriverByName("ESRI Shapefile")
WARNING:param.dynamic_operation: Callable raised "AttributeError("'DataArray' object has no attribute '_file_obj'")".
Invoked as dynamic_operation(numpy.datetime64('2021-04-07T01:00:00.000000000'), height=400, scale=1.0, width=400, x_range=None, y_range=None)
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
/opt/conda/lib/python3.8/site-packages/IPython/core/formatters.py in __call__(self, obj, include, exclude)
968
969 if method is not None:
--> 970 return method(include=include, exclude=exclude)
971 return None
972 else:
<gmi:MI_Metadata xmlns:gmi="http://www.isotc211.org/2005/gmi">
<gmd:language xmlns:gmd="http://www.isotc211.org/2005/gmd">
<gmd:LanguageCode codeList="http://www.loc.gov/standards/iso639-2" codeListValue="eng">English</gmd:LanguageCode>
</gmd:language>
<gmd:characterSet xmlns:gmd="http://www.isotc211.org/2005/gmd">
<gmd:MD_CharacterSetCode codeList="http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/Codelist/gmxCodelists.xml#MD_CharacterSetCode" codeListValue="utf8">utf8</gmd:MD_CharacterSetCode>
</gmd:characterSet>
<gmd:locale xmlns:gmd="http://www.isotc211.org/2005/gmd">
<gmd:PT_Locale id="locale-nob">
<gmd:languageCode>
<gmi:MI_Metadata xmlns:gmi="http://www.isotc211.org/2005/gmi">
<gmd:language xmlns:gmd="http://www.isotc211.org/2005/gmd">
<gmd:LanguageCode codeList="http://www.loc.gov/standards/iso639-2" codeListValue="eng">English</gmd:LanguageCode>
</gmd:language>
<gmd:characterSet xmlns:gmd="http://www.isotc211.org/2005/gmd">
<gmd:MD_CharacterSetCode codeList="http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/Codelist/gmxCodelists.xml#MD_CharacterSetCode" codeListValue="utf8">utf8</gmd:MD_CharacterSetCode>
</gmd:characterSet>
<gmd:locale xmlns:gmd="http://www.isotc211.org/2005/gmd">
<gmd:PT_Locale id="locale-nob">
<gmd:languageCode>
<gmi:MI_Metadata xmlns:gmi="http://www.isotc211.org/2005/gmi">
<gmd:language xmlns:gmd="http://www.isotc211.org/2005/gmd">
<gmd:LanguageCode codeList="http://www.loc.gov/standards/iso639-2" codeListValue="eng">English</gmd:LanguageCode>
</gmd:language>
<gmd:characterSet xmlns:gmd="http://www.isotc211.org/2005/gmd">
<gmd:MD_CharacterSetCode codeList="http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/Codelist/gmxCodelists.xml#MD_CharacterSetCode" codeListValue="utf8">utf8</gmd:MD_CharacterSetCode>
</gmd:characterSet>
<gmd:locale xmlns:gmd="http://www.isotc211.org/2005/gmd">
<gmd:PT_Locale id="locale-nob">
<gmd:languageCode>
Sorry, this is too big to display.
Sorry, this is too big to display.