{"id":78681,"date":"2017-07-31T17:25:01","date_gmt":"2017-07-31T17:25:01","guid":{"rendered":"http:\/\/www.esri.com\/arcgis-blog\/products\/product\/uncategorized\/performing-analysis-with-the-con-tool\/"},"modified":"2018-06-28T20:35:29","modified_gmt":"2018-06-28T20:35:29","slug":"performing-analysis-with-the-con-tool","status":"publish","type":"blog","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/analytics\/analytics\/performing-analysis-with-the-con-tool","title":{"rendered":"Performing analysis with the Con tool"},"author":7161,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","format":"standard","meta":{"_acf_changed":false,"_searchwp_excluded":""},"categories":[23341],"tags":[24341,29991,23391],"industry":[],"product":[36561,37031,36991],"class_list":["post-78681","blog","type-blog","status-publish","format-standard","hentry","category-analytics","tag-python","tag-raster-analysis","tag-spatial-analytics","product-arcgis-pro","product-spatial-analyst","product-arcgis-desktop"],"acf":{"short_description":"Con is one of the most used and powerful tools in Spatial Analyst. Let\u2019s go through a scenario to better understand how the tool works.","flexible_content":[{"acf_fc_layout":"content","content":"<p>\u2018Con\u2019, abbreviated for condition, is one of the most used and powerful tools in Spatial Analyst. It allows you to vary how the output is determined based on the value of the input locations, which is key for building simple as well as complex models. Let\u2019s go through a scenario to better understand how the tool works.<\/p>\n<p>Assume you are a coffee grower and you wish to expand your growing operation by purchasing additional land. To identify which areas to buy, you are considering various factors such as elevation, land use type, slope, aspect, and so on. The ideal conditions for growing the plants that produce Arabica coffee beans include areas that are between 1800 and 3600 feet in elevation, are flat and open, and are near roads and streams. South facing aspects are desirable, but not mandatory. So, you would like to identify areas that maximize the above-mentioned factors.<\/p>\n<p>Before you start with the analysis, let\u2019s quickly recap the Geoprocessing Con tool (see Figure 1). The basic premise of the tool is to create output based on some condition. The syntax for the Con tool is: Con(in_conditonal_raster, in_true_raster_or_constant, {in_false_raster_or_constant}, {where_clause}). For more details, you can read the help page <a href=\"http:\/\/pro.arcgis.com\/en\/pro-app\/tool-reference\/spatial-analyst\/con-.htm\">here<\/a>.<\/p>\n<figure id=\"attachment_84019\" aria-describedby=\"caption-attachment-84019\" style=\"width: 428px\" class=\"wp-caption alignleft\"><a href=\"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/Dialog.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-84019\" src=\"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/Dialog.png\" alt=\"Figure 1: Geoprocessing Dialog box for the Con tool.\" width=\"428\" height=\"455\" \/><\/a><figcaption id=\"caption-attachment-84019\" class=\"wp-caption-text\">Figure 1: Geoprocessing Dialog box for the Con tool.<\/figcaption><\/figure>\n<p>The Con tool is available in the Conditional toolset in the Spatial Analyst toolbox. It is also available from the sa module in arcpy and can also be accessed using the <a href=\"http:\/\/pro.arcgis.com\/en\/pro-app\/tool-reference\/spatial-analyst\/raster-calculator.htm\">Raster Calculator<\/a> tool.<\/p>\n<p>Now that you have the basics of <a href=\"http:\/\/pro.arcgis.com\/en\/pro-app\/tool-reference\/spatial-analyst\/conditional-evaluation-with-con.htm\">how Con works<\/a>, let\u2019s start the analysis.<\/p>\n<p><strong><span style=\"text-decoration: underline;\">Where are the best locations to grow my coffee?<\/span><\/strong><\/p>\n<p>First, you are interested in locations where the elevations are greater than 1800 feet. If a location meets the criteria, you want to assign the location a \u201c1\u201d (True) and locations not meeting the criteria, you want to assign a \u201c0\u201d (False).<\/p>\n<p>To do this in the Con tool dialog, specify your elevation raster (elevation.tif) as the Input condition raster and the value greater than 1800 feet as the condition in the Expression. To achieve the desired output, you will assign a \u201c1\u201d to the locations with elevations meeting this criterion and a \u201c0\u201d for elevations equal to or lower than 1800 (see Figure 1). To specify the input to the Con tool as a raster, <a href=\"http:\/\/pro.arcgis.com\/en\/pro-app\/help\/analysis\/spatial-analyst\/mapalgebra\/working-with-raster-objects.htm\">create a raster object<\/a> from the input dataset. It is recommended to first create the raster object from the elevation dataset and then use the resulting object in the subsequent Con statement.<\/p>\n<pre><code>import arcpy <\/code> <code>from arcpy.sa import *<\/code> <code>elev = Raster(\"elevation.tif\") # Creating a raster object from the elevation dataset<\/code> <code>outElev1wc = Con(elev, 1, 0, \"Value &gt; 1800\")<\/code><\/pre>\n<p>While the preceding statement will work fine, writing it in the following way is preferred, since it allows for some optimizations to be made on execution and thus should run faster:<\/p>\n<pre><code>outElev1 = Con(elev &gt; 1800, 1, 0)<\/code><\/pre>\n<p>Both these statements would give you the same output. Any location with an elevation greater than 1800 feet (the where_condition) meets your criteria and will be assigned \u201c1\u201d (the in_true_raster_or_constant), while locations equal to or below 1800 feet are assigned a \u201c0\u201d (the in_false_raster_or_constant).<\/p>\n<p>Notice the second Con statement does not use the where_clause parameter explicitly, but specifies the condition directly to the in_conditonal_raster parameter instead.<\/p>\n<p><strong><em>Functionality: Defining ranges using Boolean evaluations (\u201c&amp;\u201d) in a complex expression<\/em><\/strong><\/p>\n<p>Once you have the minimum elevation set, you also need to identify the upper elevation limit, 3600 feet. An efficient way to identify the elevation range is to use a Boolean evaluation. You also realize that for subsequent analysis, you wish to know the elevation values for locations within the desired range, not just assign them a \u201c1\u201d, and you do not want to consider locations with elevations outside the range. Therefore, you must alter the above Con statement and replace &#8216;1&#8217; with &#8216;elev&#8217; to maintain the elevation values for those locations within the range, and eliminate the other locations from consideration by assigning them &#8216;NoData&#8217; instead of &#8216;0&#8217;, as below:<\/p>\n<pre><code>outElevRange = Con(((elev &gt; 1800) &amp; (elev &lt; 3600)), elev)<\/code><\/pre>\n<p>In the statement, make note of the following: the condition is not a simple evaluation but a Boolean, the true condition is a raster and not a constant, and no false statement is specified. As a result, locations above 1800 feet and (\u201c&amp;\u201d) below 3600 feet are assigned their elevation value using elev for the input_true_raster_or_constant parameter. By leaving the input_false_raster_or_constant parameter empty, you will assign locations equal to or below 1800 feet or equal to or above 3600 feet to NoData.<\/p>\n<p><strong><em>Functionality: When to use the where clause in Map Algebra<\/em><\/strong><\/p>\n<p>Let\u2019s now incorporate another criterion in our analysis for identifying the best locations to grow coffee. Not only do you want elevations between 1800 and 3600 feet<strong>,<\/strong> you prefer the locations that are open and not forested within that range. You have a land use raster with a field called \u201cCategory\u201d which identifies the land use type for each location. To query a field other than \u201cValue\u201d in a raster, you must use the optional where clause.<\/p>\n<pre><code>inlanduse = Raster('landuse') # Creating a raster object from the landuse dataset<\/code> <code>outElevLU = Con(inlanduse, outElevRange,'', \"Category = 'OpenArea'\")<\/code><\/pre>\n<p>In the above statement the condition is based on a field other than \u201cValue\u201d, thus, a where clause is necessary. As a result, all locations that are designated as \u201cOpenArea\u201d land use are assigned the elevation values from outElevRange and all other locations are assigned NoData. As you recall, in outElevRange, only locations with elevation values greater than 1800 and less than 3600 feet have values and all other locations are NoData.<\/p>\n<p><strong><em>Functionality: Creating a condition from multiple rasters<\/em><\/strong><\/p>\n<p>The above types of conditions are the most common use for Con, but let&#8217;s explore a few additional conditions to address more complex problems. Continuing your analysis<strong>, <\/strong>since you prefer locations that you can access and that have water nearby, the best locations to grow coffee would be within a mile of a road and a half of mile of a stream.<\/p>\n<pre><code>inDistRoads = EucDistance('roads')<\/code> <code>inDistStreams = EucDistance('streams')<\/code> <code>outElevDist = Con(((inDistRoads &lt; 5280) &amp; (inDistStreams &lt; 2640)), outElevLU)<\/code><\/pre>\n<p>You first need to create two rasters, one identifying how far each location is from the closest road and a second identifying how far each location is from the closest stream using the Spatial Analyst <a href=\"http:\/\/pro.arcgis.com\/en\/pro-app\/tool-reference\/spatial-analyst\/euclidean-distance.htm\">Euclidean Distance<\/a> tool.<\/p>\n<p>In the Con statement above two different rasters are used in the conditional statement. As a result, only locations that are within a mile of road, within a half a mile (2640 feet) of a stream, have a land use of \u201cOpenArea\u201d, and are within elevations of 1800 and 3600 feet will be assigned their elevation values, while all other locations are assigned NoData.<\/p>\n<p><strong><em>Functionality: Using a nested Con<\/em><\/strong><\/p>\n<p>Let&#8217;s complete the analysis.\u00a0 From the possible locations selected so far, you prefer flatter slopes with more southerly aspects for growing your coffee, but maintaining the southerly aspect is not mandatory.<\/p>\n<pre><code>inSlope = Slope(elev)<\/code> <code>inAspect = Aspect(elev)<\/code> <code>outRaster = Con((inSlope &lt; 10) &amp; (outElevDist &gt; 0), Con((inAspect &gt; 135) &amp; (inAspect &lt; 225), outElevDist, 0))<\/code><\/pre>\n<p>First, two rasters are created identifying the slope and aspect for each location determined from the elevation surface using the Spatial Analyst <a href=\"http:\/\/pro.arcgis.com\/en\/pro-app\/tool-reference\/spatial-analyst\/slope.htm\">Slope<\/a> and <a href=\"http:\/\/pro.arcgis.com\/en\/pro-app\/tool-reference\/spatial-analyst\/aspect.htm\">Aspect<\/a> tools.\u00a0Then, you will incorporate the slope and aspect preferences into the condition.<\/p>\n<p>This Con statement is much more complex than the previous ones. In this statement, the in_true_raster_or_constant parameter for the first Con (the outer Con) is another Con (the inner Con, specifying southerly aspect) with its own condition and true and false statements. In the outer Con, the first condition determines if a location is less than 10 percent slope but also meets the other criteria identified above (being within the elevation range, open, within a mile from a road, and within a half a mile of a stream). If the location meets these criteria, it is then evaluated by a second condition, the inner Con, to see if the location faces south. If it does, then the location is assigned the elevation value (the in_true_raster_or_constant of the inner Con), if not, instead of assigning it NoData, it is assigned a \u201c0\u201d (the in_false_raster_or_constant of the inner Con) so that you can later identify these locations. Since the in_false_raster_or_constant for the outer Con is blank, any location that is steep and\/or does not meet the series of criteria defined above (the elevation, land use type, and distances criteria) will be assigned NoData. \u00a0Once you have mastered matching the conditions and the true and false statements within this complex Con statement, you will be able to unleash the power of Con to address many of your specific needs.<\/p>\n<p>At this point, you know the locations that meet all your criteria. However, while selecting the area to expand your growing operation and to maintain a contiguous tract of land, you may need to relax one or more of the criteria (such as southerly aspect), and consider areas that are now assigned \u201c0\u201d, for your purchase.<\/p>\n<p>Now get ready to plant!<\/p>\n"}],"authors":[{"ID":7161,"user_firstname":"Kevin","user_lastname":"Johnston","nickname":"Kevin Johnston","user_nicename":"kevinjohnston","display_name":"Kevin Johnston","user_email":"kjohnston@esri.com","user_url":"","user_registered":"2018-03-02 00:19:23","user_description":"Kevin has been a Product Engineer on the Spatial Analyst development team for over 29 years. He has a Master's in Landscape Architect from Harvard and a Ph.D. in environmental modeling from Yale. At Esri, Kevin\u2019s current focus is developing suitability and connectivity tools. He hopes the tools that he works on can help users make more informed decisions.","user_avatar":"<img data-del=\"avatar\" src='https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/KJohnston2.png' class='avatar pp-user-avatar avatar-96 photo ' height='96' width='96'\/>"},{"ID":7091,"user_firstname":"Sarmistha","user_lastname":"Chatterjee","nickname":"Sarmistha Chatterjee","user_nicename":"schatterjee17","display_name":"Sarmistha Chatterjee","user_email":"SChatterjee@esri.com","user_url":"","user_registered":"2018-03-02 00:19:17","user_description":"Sarmistha is a Product Engineer in Esri's raster analysis group, where she focuses on raster and scientific multidimensional data analysis. She is especially interested in combining GIS technology, spatial analysis, and software engineering to study changes for conservation and better decision-making. Before joining Esri in 2017, Sarmistha earned her PhD in Geography from the University of Delaware, where she researched fluvial geomorphology, water resources, and spatial modeling.","user_avatar":"<img data-del=\"avatar\" src='https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2024\/08\/Headshot_SarmisthaChatterjee-213x200.jpg' class='avatar pp-user-avatar avatar-96 photo ' height='96' width='96'\/>"}],"related_articles":"","card_image":false,"wide_image":false},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.9 (Yoast SEO v25.9) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Performing analysis with the Con tool<\/title>\n<meta name=\"description\" content=\"Con is one of the most used and powerful tools in Spatial Analyst. It allows you to vary how the output is determined based on the value of the input locations, which is key for building simple as well as complex models. Let\u2019s go through a scenario to better understand how the tool works.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.esri.com\/arcgis-blog\/products\/analytics\/analytics\/performing-analysis-with-the-con-tool\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Performing analysis with the Con tool\" \/>\n<meta property=\"og:description\" content=\"Con is one of the most used and powerful tools in Spatial Analyst. It allows you to vary how the output is determined based on the value of the input locations, which is key for building simple as well as complex models. Let\u2019s go through a scenario to better understand how the tool works.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.esri.com\/arcgis-blog\/products\/analytics\/analytics\/performing-analysis-with-the-con-tool\" \/>\n<meta property=\"og:site_name\" content=\"ArcGIS Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/esrigis\/\" \/>\n<meta property=\"article:modified_time\" content=\"2018-06-28T20:35:29+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@ESRI\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":[\"Article\",\"BlogPosting\"],\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/analytics\/analytics\/performing-analysis-with-the-con-tool#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/analytics\/analytics\/performing-analysis-with-the-con-tool\"},\"author\":{\"name\":\"Kevin Johnston\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/3b3643c2174054f1a36f88e0ce5f322e\"},\"headline\":\"Performing analysis with the Con tool\",\"datePublished\":\"2017-07-31T17:25:01+00:00\",\"dateModified\":\"2018-06-28T20:35:29+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/analytics\/analytics\/performing-analysis-with-the-con-tool\"},\"wordCount\":6,\"publisher\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#organization\"},\"keywords\":[\"python\",\"raster analysis\",\"spatial analytics\"],\"articleSection\":[\"Analytics\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/analytics\/analytics\/performing-analysis-with-the-con-tool\",\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/analytics\/analytics\/performing-analysis-with-the-con-tool\",\"name\":\"Performing analysis with the Con tool\",\"isPartOf\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#website\"},\"datePublished\":\"2017-07-31T17:25:01+00:00\",\"dateModified\":\"2018-06-28T20:35:29+00:00\",\"description\":\"Con is one of the most used and powerful tools in Spatial Analyst. It allows you to vary how the output is determined based on the value of the input locations, which is key for building simple as well as complex models. Let\u2019s go through a scenario to better understand how the tool works.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/analytics\/analytics\/performing-analysis-with-the-con-tool#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.esri.com\/arcgis-blog\/products\/analytics\/analytics\/performing-analysis-with-the-con-tool\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/analytics\/analytics\/performing-analysis-with-the-con-tool#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.esri.com\/arcgis-blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Performing analysis with the Con tool\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#website\",\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/\",\"name\":\"ArcGIS Blog\",\"description\":\"Get insider info from Esri product teams\",\"publisher\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.esri.com\/arcgis-blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#organization\",\"name\":\"Esri\",\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/04\/Esri.png\",\"contentUrl\":\"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/04\/Esri.png\",\"width\":400,\"height\":400,\"caption\":\"Esri\"},\"image\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/esrigis\/\",\"https:\/\/x.com\/ESRI\",\"https:\/\/www.linkedin.com\/company\/5311\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/3b3643c2174054f1a36f88e0ce5f322e\",\"name\":\"Kevin Johnston\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/KJohnston2.png\",\"contentUrl\":\"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/KJohnston2.png\",\"caption\":\"Kevin Johnston\"},\"description\":\"Kevin has been a Product Engineer on the Spatial Analyst development team for over 29 years. He has a Master's in Landscape Architect from Harvard and a Ph.D. in environmental modeling from Yale. At Esri, Kevin\u2019s current focus is developing suitability and connectivity tools. He hopes the tools that he works on can help users make more informed decisions.\",\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/author\/kevinjohnston\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Performing analysis with the Con tool","description":"Con is one of the most used and powerful tools in Spatial Analyst. It allows you to vary how the output is determined based on the value of the input locations, which is key for building simple as well as complex models. Let\u2019s go through a scenario to better understand how the tool works.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.esri.com\/arcgis-blog\/products\/analytics\/analytics\/performing-analysis-with-the-con-tool","og_locale":"en_US","og_type":"article","og_title":"Performing analysis with the Con tool","og_description":"Con is one of the most used and powerful tools in Spatial Analyst. It allows you to vary how the output is determined based on the value of the input locations, which is key for building simple as well as complex models. Let\u2019s go through a scenario to better understand how the tool works.","og_url":"https:\/\/www.esri.com\/arcgis-blog\/products\/analytics\/analytics\/performing-analysis-with-the-con-tool","og_site_name":"ArcGIS Blog","article_publisher":"https:\/\/www.facebook.com\/esrigis\/","article_modified_time":"2018-06-28T20:35:29+00:00","twitter_card":"summary_large_image","twitter_site":"@ESRI","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":["Article","BlogPosting"],"@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/analytics\/analytics\/performing-analysis-with-the-con-tool#article","isPartOf":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/analytics\/analytics\/performing-analysis-with-the-con-tool"},"author":{"name":"Kevin Johnston","@id":"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/3b3643c2174054f1a36f88e0ce5f322e"},"headline":"Performing analysis with the Con tool","datePublished":"2017-07-31T17:25:01+00:00","dateModified":"2018-06-28T20:35:29+00:00","mainEntityOfPage":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/analytics\/analytics\/performing-analysis-with-the-con-tool"},"wordCount":6,"publisher":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/#organization"},"keywords":["python","raster analysis","spatial analytics"],"articleSection":["Analytics"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/analytics\/analytics\/performing-analysis-with-the-con-tool","url":"https:\/\/www.esri.com\/arcgis-blog\/products\/analytics\/analytics\/performing-analysis-with-the-con-tool","name":"Performing analysis with the Con tool","isPartOf":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/#website"},"datePublished":"2017-07-31T17:25:01+00:00","dateModified":"2018-06-28T20:35:29+00:00","description":"Con is one of the most used and powerful tools in Spatial Analyst. It allows you to vary how the output is determined based on the value of the input locations, which is key for building simple as well as complex models. Let\u2019s go through a scenario to better understand how the tool works.","breadcrumb":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/analytics\/analytics\/performing-analysis-with-the-con-tool#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.esri.com\/arcgis-blog\/products\/analytics\/analytics\/performing-analysis-with-the-con-tool"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/analytics\/analytics\/performing-analysis-with-the-con-tool#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.esri.com\/arcgis-blog\/"},{"@type":"ListItem","position":2,"name":"Performing analysis with the Con tool"}]},{"@type":"WebSite","@id":"https:\/\/www.esri.com\/arcgis-blog\/#website","url":"https:\/\/www.esri.com\/arcgis-blog\/","name":"ArcGIS Blog","description":"Get insider info from Esri product teams","publisher":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.esri.com\/arcgis-blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.esri.com\/arcgis-blog\/#organization","name":"Esri","url":"https:\/\/www.esri.com\/arcgis-blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/04\/Esri.png","contentUrl":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/04\/Esri.png","width":400,"height":400,"caption":"Esri"},"image":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/esrigis\/","https:\/\/x.com\/ESRI","https:\/\/www.linkedin.com\/company\/5311\/"]},{"@type":"Person","@id":"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/3b3643c2174054f1a36f88e0ce5f322e","name":"Kevin Johnston","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/image\/","url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/KJohnston2.png","contentUrl":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/07\/KJohnston2.png","caption":"Kevin Johnston"},"description":"Kevin has been a Product Engineer on the Spatial Analyst development team for over 29 years. He has a Master's in Landscape Architect from Harvard and a Ph.D. in environmental modeling from Yale. At Esri, Kevin\u2019s current focus is developing suitability and connectivity tools. He hopes the tools that he works on can help users make more informed decisions.","url":"https:\/\/www.esri.com\/arcgis-blog\/author\/kevinjohnston"}]}},"text_date":"July 31, 2017","author_name":"Multiple Authors","author_page":"https:\/\/www.esri.com\/arcgis-blog\/products\/analytics\/analytics\/performing-analysis-with-the-con-tool","custom_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/08\/Newsroom-Keyart-Wide-1920-x-1080.jpg","primary_product":"ArcGIS Pro","tag_data":[{"term_id":24341,"name":"python","slug":"python","term_group":0,"term_taxonomy_id":24341,"taxonomy":"post_tag","description":"","parent":0,"count":171,"filter":"raw"},{"term_id":29991,"name":"raster analysis","slug":"raster-analysis","term_group":0,"term_taxonomy_id":29991,"taxonomy":"post_tag","description":"","parent":0,"count":59,"filter":"raw"},{"term_id":23391,"name":"spatial analytics","slug":"spatial-analytics","term_group":0,"term_taxonomy_id":23391,"taxonomy":"post_tag","description":"","parent":0,"count":345,"filter":"raw"}],"category_data":[{"term_id":23341,"name":"Analytics","slug":"analytics","term_group":0,"term_taxonomy_id":23341,"taxonomy":"category","description":"","parent":0,"count":1334,"filter":"raw"}],"product_data":[{"term_id":36561,"name":"ArcGIS Pro","slug":"arcgis-pro","term_group":0,"term_taxonomy_id":36561,"taxonomy":"product","description":"","parent":0,"count":2051,"filter":"raw"},{"term_id":37031,"name":"ArcGIS Spatial Analyst","slug":"spatial-analyst","term_group":0,"term_taxonomy_id":37031,"taxonomy":"product","description":"","parent":36981,"count":93,"filter":"raw"},{"term_id":36991,"name":"ArcMap","slug":"arcgis-desktop","term_group":0,"term_taxonomy_id":36991,"taxonomy":"product","description":"","parent":36981,"count":325,"filter":"raw"}],"primary_product_link":"https:\/\/www.esri.com\/arcgis-blog\/?s=#&products=arcgis-pro","_links":{"self":[{"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/blog\/78681","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/blog"}],"about":[{"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/types\/blog"}],"author":[{"embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/users\/7161"}],"replies":[{"embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/comments?post=78681"}],"version-history":[{"count":0,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/blog\/78681\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/media?parent=78681"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/categories?post=78681"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/tags?post=78681"},{"taxonomy":"industry","embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/industry?post=78681"},{"taxonomy":"product","embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/product?post=78681"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}