Hi, Optfile will work if you use it right. Optfile is flexible and it can be used for anything, not only for saving a SQL query into a file. Therefore optfile must have the same literal content that user would write by hand to the command. With optfile
optfile.txt ======== -sql "select * from rakennus" this command works fine for me gdal_rasterize --optfile optfile.txt helsinki_city_region.gpkg test.tif -burn 10 -tr 10 10 -Jukka Rahkonen- -----Alkuperäinen viesti----- Lähettäjä: gdal-dev <gdal-dev-boun...@lists.osgeo.org> Puolesta Scott Lähetetty: lauantai 11. helmikuuta 2023 23.15 Vastaanottaja: gdal-dev@lists.osgeo.org Aihe: [gdal-dev] -sql switch in gdal_rasterize Other gdal utilities that use the -sql switch allow you to specify a path to an sql file preceded with the @ symbol, such as: -sql @/path/to/source.sql Is there a way to do this with gdal_rasterize? Adding the above to an --optfile returns the same error as doing it on the command line. TIA -- https://eur06.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.postholer.com%2F&data=05%7C01%7Cjukka.rahkonen%40maanmittauslaitos.fi%7C914b668d0a674f638f6f08db0c7cddb2%7Cc4f8a63255804a1c92371d5a571b71fa%7C0%7C1%7C638117502675505065%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=dRgnBYMNwxd109bxxKlNEoda9BcBz6p8r1%2FSkgB8zSw%3D&reserved=0 _______________________________________________ gdal-dev mailing list gdal-dev@lists.osgeo.org https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.osgeo.org%2Fmailman%2Flistinfo%2Fgdal-dev&data=05%7C01%7Cjukka.rahkonen%40maanmittauslaitos.fi%7C914b668d0a674f638f6f08db0c7cddb2%7Cc4f8a63255804a1c92371d5a571b71fa%7C0%7C1%7C638117502675505065%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=iwBy%2F9rMMB67K969yfqpz9YowN7mfxIm21I4VMjOkUQ%3D&reserved=0 _______________________________________________ gdal-dev mailing list gdal-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/gdal-dev