<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic arcpy.management.CompositeBands behaves differently between Arc Pro and Arc Server in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcpy-management-compositebands-behaves/m-p/1543103#M72948</link>
    <description>&lt;P&gt;I get different results when I run&amp;nbsp;arcpy.management.CompositeBands in Arc Pro (3.1) python window vs. as GP service on Arc Server (&lt;SPAN&gt;10.91).&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Here's the code:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;inputRaster = r"&amp;lt;some network path&amp;gt;\LC22_CBD_230.tif"
outputTif = os.path.join(arcpy.env.scratchFolder, "smallarea.tif")

with arcpy.EnvManager(
    outputCoordinateSystem='PROJCS["Albers",GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Albers"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",-113.675],PARAMETER["Standard_Parallel_1",42.148],PARAMETER["Standard_Parallel_2",42.29],PARAMETER["Latitude_Of_Origin",42.219],UNIT["Meter",1.0]]',
    rasterStatistics="NONE",
    pyramid="NONE",
    extent='-122.803308540951 42.3766738424979 -121.801628377294 43.3488942814668 GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]]'):
        
    arcpy.management.CompositeBands(
        in_rasters=inputRaster,
        out_raster=outputTif
    )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The Pro version creates an output tif that's clipped to my extent coordinates.&amp;nbsp; That's good and what I expected.&lt;/P&gt;&lt;P&gt;The Server version creates an output tif that's not clipped at all.&amp;nbsp; It's the entire entire size and extent of the input raster.&lt;/P&gt;&lt;P&gt;Why am I getting this unexpected result on Arc Server?&lt;/P&gt;&lt;P&gt;Thank you for your help.&lt;/P&gt;</description>
    <pubDate>Thu, 26 Sep 2024 16:29:20 GMT</pubDate>
    <dc:creator>todddoerr2</dc:creator>
    <dc:date>2024-09-26T16:29:20Z</dc:date>
    <item>
      <title>arcpy.management.CompositeBands behaves differently between Arc Pro and Arc Server</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-management-compositebands-behaves/m-p/1543103#M72948</link>
      <description>&lt;P&gt;I get different results when I run&amp;nbsp;arcpy.management.CompositeBands in Arc Pro (3.1) python window vs. as GP service on Arc Server (&lt;SPAN&gt;10.91).&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Here's the code:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;inputRaster = r"&amp;lt;some network path&amp;gt;\LC22_CBD_230.tif"
outputTif = os.path.join(arcpy.env.scratchFolder, "smallarea.tif")

with arcpy.EnvManager(
    outputCoordinateSystem='PROJCS["Albers",GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Albers"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",-113.675],PARAMETER["Standard_Parallel_1",42.148],PARAMETER["Standard_Parallel_2",42.29],PARAMETER["Latitude_Of_Origin",42.219],UNIT["Meter",1.0]]',
    rasterStatistics="NONE",
    pyramid="NONE",
    extent='-122.803308540951 42.3766738424979 -121.801628377294 43.3488942814668 GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]]'):
        
    arcpy.management.CompositeBands(
        in_rasters=inputRaster,
        out_raster=outputTif
    )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The Pro version creates an output tif that's clipped to my extent coordinates.&amp;nbsp; That's good and what I expected.&lt;/P&gt;&lt;P&gt;The Server version creates an output tif that's not clipped at all.&amp;nbsp; It's the entire entire size and extent of the input raster.&lt;/P&gt;&lt;P&gt;Why am I getting this unexpected result on Arc Server?&lt;/P&gt;&lt;P&gt;Thank you for your help.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Sep 2024 16:29:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-management-compositebands-behaves/m-p/1543103#M72948</guid>
      <dc:creator>todddoerr2</dc:creator>
      <dc:date>2024-09-26T16:29:20Z</dc:date>
    </item>
  </channel>
</rss>

