Re: [gdal-dev] Using gdal_rasterize to mask ENVI file Using ESRI SHP format Vector [SEC=UNCLASSIFIED]
Hello, Thanks, that worked. Looks like I missed the in-place band number selection flag ( -b ). Does anyone know if I can direct output to another file, or do I always need to copy the original file and 'burn' the values into an existing duplicate file. I guess it's just as easy either way. Thanks again, Peter From: Pinner, Luke [mailto:luke.pin...@environment.gov.au] Sent: October-17-12 4:11 PM To: Peter Willis; gdal-dev@lists.osgeo.org Subject: RE: [gdal-dev] Using gdal_rasterize to mask ENVI file Using ESRI SHP format Vector [SEC=UNCLASSIFIED] Perhaps something like for i in {1..49}; do gdal_rasterize -burn -999 -b $i mask.shp 49bandenvi.dat; done Luke From: gdal-dev-boun...@lists.osgeo.org [mailto:gdal-dev-boun...@lists.osgeo.org] On Behalf Of Peter Willis Sent: Thursday, 18 October 2012 9:43 AM To: gdal-dev@lists.osgeo.org Subject: Re: [gdal-dev] Using gdal_rasterize to mask ENVI file Using ESRI SHP format Vector Hello, On second thoughts, this is not really what I want. I have a SHP format polygon vector file already. I want to use that existing vector file to mask the ENVI format BSQ file through all (49) channels. (ie: 'mask' meaning set any values inside vector polygons to a specific value within the output ENVI BSQ file ) Perhaps I'm missing something. Peter From: fwarmer...@gmail.com [mailto:fwarmer...@gmail.com] On Behalf Of Frank Warmerdam Sent: October-17-12 3:22 PM To: Peter Willis Cc: gdal-dev@lists.osgeo.org Subject: Re: [gdal-dev] Using gdal_rasterize to mask ENVI file Using ESRI SHP format Vector Peter, I'm guessing you are using the gdal_polygonize.py script for masking. Is that right? I am not aware of any particular reason this shouldn't work for any "update in place" format (ie. shows "rw+" in the gdalinfo --formats list). ENVI is in this list. BTW, before we do a lot of work to investigate this you might want to see if the problem persists with GDAL 1.9. GDAL 1.6.3 is getting pretty antique. Best regards, Frank On Wed, Oct 17, 2012 at 2:59 PM, Peter Willis wrote: Hello, Is it possible to use ESRI SHP polygon file to mask ENVI BSQ img format files with more than 1 band? I can mask a GTiff file using the SHP but ENVI file does not appear to work. Gdal version is 1.6.3 . The documentation appears unclear for any raster that is not specifically GTiff. Thanks, Peter ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev -- ---+ -- I set the clouds in motion - turn up | Frank Warmerdam, warmer...@pobox.com light and sound - activate the windows | http://pobox.com/~warmerdam and watch the world go round - Rush| Geospatial Software Developer If you have received this transmission in error please notify us immediately by return e-mail and delete all copies. If this e-mail or any attachments have been sent to you in error, that error does not constitute waiver of any confidentiality, privilege or copyright in respect of information in the e-mail or attachments. Please consider the environment before printing this email. ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
Re: [gdal-dev] Using gdal_rasterize to mask ENVI file Using ESRI SHP format Vector
On Wed, Oct 17, 2012 at 3:42 PM, Peter Willis wrote: > Hello, > > ** ** > > On second thoughts, this is not really what I want. > > ** ** > > I have a SHP format polygon vector file already. > > I want to use that existing vector file to mask the ENVI format BSQ file > through all (49) channels. > > (ie: ‘mask’ meaning set any values inside vector polygons to a specific > value within the output ENVI BSQ file ) > > ** ** > > Perhaps I’m missing something… > Peter, I think gdal_rasterize can do this, but I imagine as it is setup now I think you will have to explicitly list every band to write to. For instance I was able to do the following for a 3 band TIFF file: gdal_rasterize -b 1 -b 2 -b 3 -burn 128 alaska_box.shp work.tif This burned the value 128 into bands 1, 2 and 3 in work.tif. Best regards, -- ---+-- I set the clouds in motion - turn up | Frank Warmerdam, warmer...@pobox.com light and sound - activate the windows | http://pobox.com/~warmerdam and watch the world go round - Rush| Geospatial Software Developer ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
Re: [gdal-dev] Using gdal_rasterize to mask ENVI file Using ESRI SHP format Vector [SEC=UNCLASSIFIED]
Perhaps something like for i in {1..49}; do gdal_rasterize -burn -999 -b $i mask.shp 49bandenvi.dat; done Luke From: gdal-dev-boun...@lists.osgeo.org [mailto:gdal-dev-boun...@lists.osgeo.org] On Behalf Of Peter Willis Sent: Thursday, 18 October 2012 9:43 AM To: gdal-dev@lists.osgeo.org Subject: Re: [gdal-dev] Using gdal_rasterize to mask ENVI file Using ESRI SHP format Vector Hello, On second thoughts, this is not really what I want. I have a SHP format polygon vector file already. I want to use that existing vector file to mask the ENVI format BSQ file through all (49) channels. (ie: 'mask' meaning set any values inside vector polygons to a specific value within the output ENVI BSQ file ) Perhaps I'm missing something... Peter From: fwarmer...@gmail.com<mailto:fwarmer...@gmail.com> [mailto:fwarmer...@gmail.com] On Behalf Of Frank Warmerdam Sent: October-17-12 3:22 PM To: Peter Willis Cc: gdal-dev@lists.osgeo.org<mailto:gdal-dev@lists.osgeo.org> Subject: Re: [gdal-dev] Using gdal_rasterize to mask ENVI file Using ESRI SHP format Vector Peter, I'm guessing you are using the gdal_polygonize.py script for masking. Is that right? I am not aware of any particular reason this shouldn't work for any "update in place" format (ie. shows "rw+" in the gdalinfo --formats list). ENVI is in this list. BTW, before we do a lot of work to investigate this you might want to see if the problem persists with GDAL 1.9. GDAL 1.6.3 is getting pretty antique. Best regards, Frank On Wed, Oct 17, 2012 at 2:59 PM, Peter Willis mailto:pwil...@aslenv.com>> wrote: Hello, Is it possible to use ESRI SHP polygon file to mask ENVI BSQ img format files with more than 1 band? I can mask a GTiff file using the SHP but ENVI file does not appear to work. Gdal version is 1.6.3 . The documentation appears unclear for any raster that is not specifically GTiff. Thanks, Peter ___ gdal-dev mailing list gdal-dev@lists.osgeo.org<mailto:gdal-dev@lists.osgeo.org> http://lists.osgeo.org/mailman/listinfo/gdal-dev -- ---+-- I set the clouds in motion - turn up | Frank Warmerdam, warmer...@pobox.com<mailto:warmer...@pobox.com> light and sound - activate the windows | http://pobox.com/~warmerdam and watch the world go round - Rush| Geospatial Software Developer If you have received this transmission in error please notify us immediately by return e-mail and delete all copies. If this e-mail or any attachments have been sent to you in error, that error does not constitute waiver of any confidentiality, privilege or copyright in respect of information in the e-mail or attachments. Please consider the environment before printing this email. ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
Re: [gdal-dev] Using gdal_rasterize to mask ENVI file Using ESRI SHP format Vector
Hello, On second thoughts, this is not really what I want. I have a SHP format polygon vector file already. I want to use that existing vector file to mask the ENVI format BSQ file through all (49) channels. (ie: 'mask' meaning set any values inside vector polygons to a specific value within the output ENVI BSQ file ) Perhaps I'm missing something. Peter From: fwarmer...@gmail.com [mailto:fwarmer...@gmail.com] On Behalf Of Frank Warmerdam Sent: October-17-12 3:22 PM To: Peter Willis Cc: gdal-dev@lists.osgeo.org Subject: Re: [gdal-dev] Using gdal_rasterize to mask ENVI file Using ESRI SHP format Vector Peter, I'm guessing you are using the gdal_polygonize.py script for masking. Is that right? I am not aware of any particular reason this shouldn't work for any "update in place" format (ie. shows "rw+" in the gdalinfo --formats list). ENVI is in this list. BTW, before we do a lot of work to investigate this you might want to see if the problem persists with GDAL 1.9. GDAL 1.6.3 is getting pretty antique. Best regards, Frank On Wed, Oct 17, 2012 at 2:59 PM, Peter Willis wrote: Hello, Is it possible to use ESRI SHP polygon file to mask ENVI BSQ img format files with more than 1 band? I can mask a GTiff file using the SHP but ENVI file does not appear to work. Gdal version is 1.6.3 . The documentation appears unclear for any raster that is not specifically GTiff. Thanks, Peter ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev -- ---+ -- I set the clouds in motion - turn up | Frank Warmerdam, warmer...@pobox.com light and sound - activate the windows | http://pobox.com/~warmerdam and watch the world go round - Rush| Geospatial Software Developer ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
Re: [gdal-dev] Using gdal_rasterize to mask ENVI file Using ESRI SHP format Vector [SEC=UNCLASSIFIED]
Try gdalwarp (http://www.gdal.org/gdalwarp.html) with the -cutline argument. gdalwarp -of envi -cutline shapefile.shp multibandenvi.dat croppedoutput.dat Luke -Original Message- From: gdal-dev-boun...@lists.osgeo.org [mailto:gdal-dev-boun...@lists.osgeo.org] On Behalf Of Peter Willis Sent: Thursday, 18 October 2012 8:59 AM To: gdal-dev@lists.osgeo.org Subject: [gdal-dev] Using gdal_rasterize to mask ENVI file Using ESRI SHP format Vector Hello, Is it possible to use ESRI SHP polygon file to mask ENVI BSQ img format files with more than 1 band? I can mask a GTiff file using the SHP but ENVI file does not appear to work. Gdal version is 1.6.3 . The documentation appears unclear for any raster that is not specifically GTiff. Thanks, Peter ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev If you have received this transmission in error please notify us immediately by return e-mail and delete all copies. If this e-mail or any attachments have been sent to you in error, that error does not constitute waiver of any confidentiality, privilege or copyright in respect of information in the e-mail or attachments. Please consider the environment before printing this email. ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
Re: [gdal-dev] Using gdal_rasterize to mask ENVI file Using ESRI SHP format Vector
Hello, I was using gdal_rasterize directly rather than gdal_polygonize.py . .No gdal_poygonize.py found for my revision.. I was forgetful of -formats via gdalinfo. This shows rw+ for ENVI format which is what I need. Upon looking I find that I have already installed revision 1.9 in another /usr/local directory. Perhaps I should use the more recent revision for attempting this. Thanks for the pointers, Peter From: fwarmer...@gmail.com [mailto:fwarmer...@gmail.com] On Behalf Of Frank Warmerdam Sent: October-17-12 3:22 PM To: Peter Willis Cc: gdal-dev@lists.osgeo.org Subject: Re: [gdal-dev] Using gdal_rasterize to mask ENVI file Using ESRI SHP format Vector Peter, I'm guessing you are using the gdal_polygonize.py script for masking. Is that right? I am not aware of any particular reason this shouldn't work for any "update in place" format (ie. shows "rw+" in the gdalinfo --formats list). ENVI is in this list. BTW, before we do a lot of work to investigate this you might want to see if the problem persists with GDAL 1.9. GDAL 1.6.3 is getting pretty antique. Best regards, Frank On Wed, Oct 17, 2012 at 2:59 PM, Peter Willis wrote: Hello, Is it possible to use ESRI SHP polygon file to mask ENVI BSQ img format files with more than 1 band? I can mask a GTiff file using the SHP but ENVI file does not appear to work. Gdal version is 1.6.3 . The documentation appears unclear for any raster that is not specifically GTiff. Thanks, Peter ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev -- ---+ -- I set the clouds in motion - turn up | Frank Warmerdam, warmer...@pobox.com light and sound - activate the windows | http://pobox.com/~warmerdam and watch the world go round - Rush| Geospatial Software Developer ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
Re: [gdal-dev] Using gdal_rasterize to mask ENVI file Using ESRI SHP format Vector
Peter, I'm guessing you are using the gdal_polygonize.py script for masking. Is that right? I am not aware of any particular reason this shouldn't work for any "update in place" format (ie. shows "rw+" in the gdalinfo --formats list). ENVI is in this list. BTW, before we do a lot of work to investigate this you might want to see if the problem persists with GDAL 1.9. GDAL 1.6.3 is getting pretty antique. Best regards, Frank On Wed, Oct 17, 2012 at 2:59 PM, Peter Willis wrote: > Hello, > > Is it possible to use ESRI SHP polygon file to mask > ENVI BSQ img format files with more than 1 band? > > I can mask a GTiff file using the SHP but ENVI file does not > appear to work. Gdal version is 1.6.3 . > > The documentation appears unclear for any raster that is not > specifically GTiff. > > Thanks, > > Peter > > ___ > gdal-dev mailing list > gdal-dev@lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/gdal-dev > -- ---+-- I set the clouds in motion - turn up | Frank Warmerdam, warmer...@pobox.com light and sound - activate the windows | http://pobox.com/~warmerdam and watch the world go round - Rush| Geospatial Software Developer ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
[gdal-dev] Using gdal_rasterize to mask ENVI file Using ESRI SHP format Vector
Hello, Is it possible to use ESRI SHP polygon file to mask ENVI BSQ img format files with more than 1 band? I can mask a GTiff file using the SHP but ENVI file does not appear to work. Gdal version is 1.6.3 . The documentation appears unclear for any raster that is not specifically GTiff. Thanks, Peter ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev