Opened 11 years ago
Closed 11 years ago
#5218 closed defect (invalid)
GDALRasterizeLayers with ALL_TOUCHED and ATTRIBUTE options
Reported by: | royeral | Owned by: | warmerdam |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | GDAL_Raster | Version: | 1.10.0 |
Severity: | normal | Keywords: | |
Cc: |
Description (last modified by )
I have a river layer and a lake layer (shapefile) that I rasterize with GDALRasterizeLayers to GeoTIFF. With the ALL_TOUCHED option, all the pixels of the layers are rasterize. With the ALL_TOUCHED and ATTRIBUTE options, lots of pixels are missing.
I'm using GDAL version 1.10 in C++.
https://skydrive.live.com/redir?resid=7ECAD65B80CFE693!18543
char** options = nullptr; options = CSLSetNameValue(options, "ALL_TOUCHED", "TRUE"); options = CSLSetNameValue(options, "ATTRIBUTE", "ID"); GDALRasterizeLayers(dst_dataset, 1, &band_list[0], 2, (OGRLayerH*)&layers[0], NULL, NULL, NULL, options, NULL, NULL); CSLDestroy(options);
(sorry for my English, I'm french canadian)
Attachments (2)
Change History (9)
comment:1 by , 11 years ago
Component: | default → GDAL_Raster |
---|
comment:2 by , 11 years ago
Description: | modified (diff) |
---|
follow-up: 4 comment:3 by , 11 years ago
by , 11 years ago
Attachment: | Capture_ALL_TOUCHED.PNG added |
---|
by , 11 years ago
Attachment: | Capture_ATTRIBUTE.PNG added |
---|
comment:4 by , 11 years ago
Replying to kyle:
I have uploaded two pictures. Capture_ALL_TOUCHED.png is the result when I'm using the ALL_TOUCHED option and Capture_ATTRIBUTE.png is the result with ALL_TOUCHED and ATTRIBUTE options. You can see that in the ATTRIBUTE picture, lots of pixels are missing.
follow-up: 6 comment:5 by , 11 years ago
royeral, Are you sure it's not a display issue? ALL_TOUCHED has values of 1 and 2, while ALL_TOUCHED_ATTRIBUTE has a much greater range(1-788). That would explain why pixels are disappearing. It looks similar when I initially open it in QGIS, but if I reclassify the data, it looks fine. I did q quick check with gdallocationinfo on a pixel that *looked* (I don't have real data) like it was 'disappearing:
kyle@kyle-hp-laptop:5218$ gdallocationinfo -geoloc -valonly ALL_TOUCHED.tif 575726.141375, 5387281.225 1 kyle@kyle-hp-laptop:5218$ gdallocationinfo -geoloc -valonly ALL_TOUCHED_AND_ATTRIBUTE.tif 575726.141375, 5387281.225 649
and everything looked okay (valid burn values in both). You can try a similar test if you get the coordinates of a pixel that appears to not be burnt.
comment:6 by , 11 years ago
Replying to kyle:
wow ! You are right ! I'm sorry. How can I close the ticket ?
Thank you very much !
royeral, Are you sure it's not a display issue? ALL_TOUCHED has values of 1 and 2, while ALL_TOUCHED_ATTRIBUTE has a much greater range(1-788). That would explain why pixels are disappearing. It looks similar when I initially open it in QGIS, but if I reclassify the data, it looks fine. I did q quick check with gdallocationinfo on a pixel that *looked* (I don't have real data) like it was 'disappearing:
kyle@kyle-hp-laptop:5218$ gdallocationinfo -geoloc -valonly ALL_TOUCHED.tif 575726.141375, 5387281.225 1 kyle@kyle-hp-laptop:5218$ gdallocationinfo -geoloc -valonly ALL_TOUCHED_AND_ATTRIBUTE.tif 575726.141375, 5387281.225 649and everything looked okay (valid burn values in both). You can try a similar test if you get the coordinates of a pixel that appears to not be burnt.
comment:7 by , 11 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
No problem, I'll close it right now. Closing as invalid.
royeral, Could you be a little more specific? I can't reproduce any obvious issues with 1.10.0 or 1.10.1. Running your code and visually inspecting the data in QGIS seems to show reasonable results.