<div dir="ltr">Sorry gdal python version 3.0.2 (not 3.6.0 my mistake)</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Em qui., 14 de mai. de 2020 às 10:31, Camila <<a href="mailto:camila@labsid.eng.br">camila@labsid.eng.br</a>> escreveu:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi<div>This is my first time using the mailing list, I apologize if this question is out of place.</div><div>I am using python 3.6, with gdal python api version 3.6.0</div><div><br></div><div>I am working with pcraster framework, and need to store the resulting simulation files in a geopackage. I found the best way to do this is by converting the pcr object output to numpy array, and store the numpy array directly to gpkg file using:</div><div> </div><div> creationOptions = ['TILE_FORMAT=PNG', 'APPEND_SUBDATASET=YES', 'PRECISION=0', str('RASTER_TABLE='+str(raster_table))]<br> outputType= gdal.GDT_Float32 <br></div><div> driver = gdal.GetDriverByName('GPKG')<br> outDs = driver.Create(outpath, cols, rows, 1, outputType, options = creationOptions)<br></div><div> outBand = outDs.GetRasterBand(1)<br> outBand.SetNoDataValue(-999)<br> outBand.WriteArray(numpy_array) # this is where I store my np arrays<br> outDs.SetGeoTransform(trans)<br> ds = None<br> outDs = None<br></div><div><br></div><div>the rows and cols are based on a file I'm using as reference, the output type</div><div>Issues I found:</div><div>1) I'm using the option "Tile format = PNG" because I found this option to be more effective to compress the final output files, I'm working with about 6000 outputs / Is that actual right, or there is another way to have tiff files compressed effectively with output data format as Float32?</div><div>2) As I said I am working with more than 6000 simulation outputs.. I found that my final gpkg created file has a limit of 1000 layers... Is that a default creation option?? How can I make sure my final gpkg file store all the layers?</div><div>3) What is the best way to access a certain via gdal python api the gpkg layers? Or is best to access the individual layer using sqlite3 lib? I use the following script to view list the raster tables, but I want to access a certain layer individually</div><div>ds = gdal.OpenEx('my.gpkg')<br>x = ds.GetMetadata_List('SUBDATASETS')<br></div><div><br></div><div><br clear="all"><div>Thank you!</div><div dir="ltr"><div dir="ltr"><div dir="ltr"></div><br></div></div></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div dir="ltr"><div dir="ltr"><table style="color:rgb(33,33,33);font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif,serif,EmojiFont;font-size:15px;border-collapse:collapse;margin-right:6.75pt;margin-left:6.75pt" width="420" height="92" cellspacing="0" cellpadding="0" border="0" align="left"><tbody><tr style="height:59.45pt" height="99"><td style="width:92.15pt;height:59.45pt;padding:0px 5.4pt;border-right:1px solid rgb(204,204,204)" width="153"><div style="margin:0px" align="justify"><img src="http://www.labsid.eng.br/imagens/labsid-assinatura.png" width="129" height="34"><font style="font-family:Calibri,sans-serif,serif,EmojiFont" size="2"><span style="font-size:11pt"></span></font></div></td><td style="width:287.65pt;height:59.45pt;padding:0px 5.4pt" width="479"><b style="font-family:"Trebuchet MS",sans-serif,serif,EmojiFont;font-size:18.6667px"><font color="#073763">C</font></b><b style="font-family:"Trebuchet MS",sans-serif,serif,EmojiFont;font-size:18.6667px"><font color="#33af01">amila</font></b><b style="font-family:"Trebuchet MS",sans-serif,serif,EmojiFont;font-size:18.6667px"><font color="#33af01"> </font></b><b style="font-family:"Trebuchet MS",sans-serif,serif,EmojiFont;font-size:18.6667px"><font color="#073763">B</font></b><b style="font-family:"Trebuchet MS",sans-serif,serif,EmojiFont;font-size:18.6667px"><font color="#33af01">illerbeck</font></b><div style="margin:0px 0px 12pt"><span style="font-size:10pt;font-family:Arial,sans-serif,serif,EmojiFont;color:black">Engenheira Civil </span></div><div style="margin:0px"><a style="color:rgb(166,166,166);font-size:10pt;font-family:"Trebuchet MS",sans-serif,serif,EmojiFont">+55 11 3091-5403</a></div><div style="margin:0px"><a style="color:rgb(166,166,166);font-size:10pt;font-family:"Trebuchet MS",sans-serif,serif,EmojiFont">+55 11 3091-5549</a></div><div style="margin:0px"><table><tbody><tr><td><a href="mailto:camila@labsid.eng.br" style="color:rgb(17,85,204)" target="_blank"><img src="http://www.labsid.eng.br/imagens/email.png" alt=""></a></td><td><a href="http://www.labsid.eng.br/" style="color:rgb(17,85,204)" target="_blank"><img src="http://www.labsid.eng.br/imagens/url.png"></a></td><td><a href="http://www.youtube.com/labsidengbr" style="color:rgb(17,85,204)" target="_blank"><img src="http://www.labsid.eng.br/imagens/youtube.png"></a></td><td><a href="https://www.facebook.com/labsid.eng.br" style="color:rgb(17,85,204)" target="_blank"><img src="http://labsid.eng.br/imagens/facebook.png"></a></td></tr></tbody></table></div></td></tr></tbody></table></div></div><br></div></div>