1

I'm a bit new to gdal, I mostly use ogr2ogr for data imports to MS SQL Server -- so I'm a bit out of my tree on gdal_rasterize

My goal is to create png raster files 200x200 from a geometry column. I tried something like with no avail.

gdal_rasterize -src_datasource "MSSQL:server={server};database=
     {database};uid={user};pwd={pwd};" -a geom -l layer1 -of png -burn 
     255 -b geom -sql "SELECT top 1 geom from {myTable}" tract.png -of png -ts 200 200
  • Does ogrinfo "MSSQL:server={server};database= {database};uid={user};pwd={pwd};" -sql "SELECT top 1 geom from {myTable}" read data? – user30184 Nov 19 '15 at 18:34
  • The only thing that happens is that I get the Usage output: Usage: gdal_rasterize [-b band]* [-i] [-at] [-burn value]* | [-a attribute_name] [-3d] [-l layername]* [-where expression] [-sql select_statement] ... According the documentation, data_source can be from a database – Mike McWilliams Nov 19 '15 at 19:14
  • You must find the correct syntax for making ogrinfo and gdal_rasterize to work. If you import successfully data already with ogr2ogr you must have a good example available. I suppose that you use the same GDAL and it is listing the driver with ogrinfo --formats. Read also examples from gdal.org/drv_mssqlspatial.html. – user30184 Nov 19 '15 at 19:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.