POST
|
Thank you! I had add this as a second script. So the first script adds the 4-band data and does what it needs to do [CopyRaster_management(rasterFile,outRaster,"DEFAULTS","255","255","","","8_BIT_UNSIGNED")]. This second script with then resaves everything without the compression exactly as you have it. You saved my sanity!!!!!
... View more
08-22-2018
10:19 AM
|
0
|
0
|
440
|
POST
|
Nope. none at all. still looking to save a raster without compression. I did do a verification through print(arcpy.env.compression) that the compression environment was successfully set to None, both before and after the loop. It was came back with the correct setting, but still getting the compression. Interestingly, the compression is actually LZW, not the default LZ77. I found a reference to "How To: Change the default compression format for output TIFF files" but the file this article mentions doesn't exist on the machine I'm using. https://support.esri.com/en/technical-article/000007588
... View more
08-11-2018
07:45 PM
|
0
|
0
|
2945
|
POST
|
Do you know how I would set that? I've seen that, but there are no examples I can copy. I'm changing this line: arcpy.CopyRaster_management(rasterFile,outRaster,"DEFAULTS","255","255","","","8_BIT_UNSIGNED") to: arcpy.CopyRaster_management(rasterFile,outRaster\\none,"DEFAULTS","255","255","","","8_BIT_UNSIGNED") I'm using the 8-bit unsigned, so that appears to have the option at least. 8-bit unsigned integer Yes Packbits, LZW, JPEG (lossy), or None
... View more
07-30-2018
11:12 AM
|
0
|
0
|
2945
|
POST
|
I did try that: arcpy.env.compression = "NONE" The results are still compressed with LZW.
... View more
07-30-2018
10:40 AM
|
0
|
2
|
2945
|
POST
|
Hi guys. I have a script which cycles through a directory and adds 4band data. It works like a charm. The problem is that the customer wants the results UNcompressed. By default, all of the resulting files are compressed and so I have to manually open each file and then simply export data/raster to raster/compression set to zero. That works, but it's tedious and unnecessarily expensive in time. I have looked everywhere I can to find out how to do the export process with zero compression by script. No luck, so I figured I'd try here. Below is the currently functioning script. ---------------------------------------------------- import os,arcpy,glob rasterpath = r"filepath-source" outFolder = r"filepath-end" arcpy.env.workspace = rasterpath for rasterFile in arcpy.ListRasters("*.tif"): oName, oExt = os.path.splitext(rasterFile) outRaster = os.path.join(outFolder, oName+ ".tif") arcpy.CopyRaster_management(rasterFile,outRaster,"DEFAULTS","255","255","","","8_BIT_UNSIGNED") ------------------------------------------------------- I know that the process of adding the band data creates pyramids, but my attempts to add zero compression to the environment on this script fails. What I'm looking for help with: * the command line which will simply resave the data as-is but with no compression. Compression is not an option for arcpy.CopyRaster_management in tiff format that I can find. There has to be a way to automate this. I'll be shooting myself if I have to manually open and resave hundreds of ortho images per object just for that single variable. I hope you guys can help! Thanks.
... View more
07-30-2018
09:49 AM
|
1
|
10
|
4613
|
Title | Kudos | Posted |
---|---|---|
1 | 07-30-2018 09:49 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:25 AM
|