{"id":121051,"date":"2009-06-17T00:00:00","date_gmt":"2009-06-17T00:00:00","guid":{"rendered":"http:\/\/www.esri.com\/arcgis-blog\/products\/product\/uncategorized\/filling-and-clipping-a-raster\/"},"modified":"2009-06-17T00:00:00","modified_gmt":"2009-06-17T00:00:00","slug":"filling-and-clipping-a-raster","status":"publish","type":"blog","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/product\/mapping\/filling-and-clipping-a-raster","title":{"rendered":"Filling and clipping a raster"},"author":4331,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":{"_acf_changed":false,"_searchwp_excluded":""},"categories":[22941],"tags":[23211],"industry":[],"product":[],"class_list":["post-121051","blog","type-blog","status-publish","format-standard","hentry","category-mapping","tag-map-data"],"acf":{"short_description":"By Aileen Buckley, Mapping Center Lead\n\n\n\nSometimes you want to use raster data, like a digital elevation model (DEM), but it doesn't hav...","flexible_content":[{"acf_fc_layout":"content","content":"<p><strong>By Aileen Buckley, Mapping Center Lead<\/strong><\/p>\n<p><img decoding=\"async\" src=\"http:\/\/downloads2.esri.com\/MappingCenter2007\/blog\/June09Images\/original_thumbnail2.png\" border=\"0\" alt=\"Thumbnail\" vspace=\"5\" align=\"left\" \/><\/p>\n<p>Sometimes you want to use raster data, like a digital elevation model (DEM), but it doesn&#8217;t have the same exact extent as the area you are mapping. For example, if I use gtopo30 and &#8220;countries&#8221; data (available on the Esri Data and Maps CD) to create map of the Pacific Northwest, the coastline boundaries do not coincide. In some places the elevation values are missing for inland areas, and in other places, there are elevation values outside the extent of the land area. So we need a way to clean up the data and make them coincide.\u00a0Just clipping won&#8217;t work as this won&#8217;t add the missing elevation values.<!--more--><\/p>\n<p>I can fix all this if I have some other elevation data to fill in the missing interior elevation values. For example, I can use etopo2 data (also on the Data and Maps CD) to get the elevation values for the pixels that need them.<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/downloads2.esri.com\/MappingCenter2007\/blog\/June09Images\/etopo2.png\" border=\"0\" alt=\"Etopo2 Data\" vspace=\"5\" align=\"middle\" \/><\/p>\n<p>Although the etopo2 data are coarser resolution, this will be difficult to see at the scale I am mapping, especially when I further modify the data by creating a hillshade. So I can go ahead and use these data.<\/p>\n<p>Note that before you decide which dataset to use to &#8220;fill in the gaps&#8221;, be sure you check out the z units \u2013 in some datasets elevation is in meters and in others it is in feet. Both gtopo30 and etopo3 use meters so there is no problem using these two datasets as they are. (The fix would be to create a new raster elevation dataset by converting one DEM to the units of the other DEM by multiplying by the appropriate conversion factor.)<\/p>\n<p>Once you have the two raster elevation datasets and a polygon feature class for the area you are mapping, these are the steps to filling in the missing elevation values and clip to the land extent:<\/p>\n<ol>\n<li>Convert the polygon feature class for the land area to a raster dataset. We&#8217;ll call it &#8220;land_grid&#8221;.<\/li>\n<li>From the raster dataset that has the missing elevation values (in this example, we&#8217;ll call it &#8220;gtopo30&#8221;), create an IsNull raster. (Use the <a title=\"ArcGIS Online Help: Is Null Tool\" href=\"http:\/\/webhelp.esri.com\/arcgisdesktop\/9.3\/index.cfm?id=6317&amp;pid=6289&amp;topicname=Is_Null\" target=\"_blank\">Is Null Tool<\/a> in the ArcToolbox, Spatial Analyst Toobox, Math Toolset, Logical Toolset.) We&#8217;ll call the resulting raster dataset &#8220;gtopo_isnull&#8221;.<\/li>\n<li>Use a conditional statement to create a new raster dataset that adds the elevation values from the other raster dataset (we&#8217;ll call it &#8220;etopo2&#8221;) to the one with the missing values. (Essentially, this is the conditional statement: if there is an elevation value in the data set with missing values, use it; if not, use the elevation value from the other raster dataset.) We&#8217;ll call this raster dataset\u00a0&#8220;gtopo30_fill&#8221;.<br \/>\ncon(gtopo_isnull = 1, etopo2, gtopo30)<\/li>\n<li>Use a conditional statement to set the extent of the resulting elevation raster dataset to the same extent as your land area. (Essentially, this is the conditional statement: if the raster dataset that you created from the polygon feature class is &gt;= 1, then use the elevation value from the step above, otherwise, do nothing \u2013 which results in a NoData value.)<br \/>\ncon(land_grid &gt;=1, gtopo30_fill)<\/li>\n<\/ol>\n<p>At this point, the resulting raster dataset should 1) have all the elevation values, and 2) exactly coincide with your land extent.<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/downloads2.esri.com\/MappingCenter2007\/blog\/June09Images\/final_result.png\" border=\"0\" alt=\"Final Result\" vspace=\"5\" align=\"middle\" \/><\/p>\n"}],"authors":[{"ID":4331,"user_firstname":"Aileen","user_lastname":"Buckley","nickname":"Aileen Buckley","user_nicename":"abuckley","display_name":"Aileen Buckley","user_email":"abuckley@esri.com","user_url":"","user_registered":"2018-03-02 00:15:57","user_description":"Dr. Aileen Buckley is a cartographer researcher and Senior Principal GIS Engineer at Esri. I'm on the ArcGIS Living Atlas of the World Team, making, writing, and talking about maps. I'm also involved in a number of cartographic societies and association, and I'm the chair of the ICA Ethics in Cartography Commission.","user_avatar":"<img data-del=\"avatar\" src='https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/03\/Aileen.jpg' class='avatar pp-user-avatar avatar-96 photo ' height='96' width='96'\/>"}]},"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>Filling and clipping a raster<\/title>\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\/product\/mapping\/filling-and-clipping-a-raster\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Filling and clipping a raster\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.esri.com\/arcgis-blog\/products\/product\/mapping\/filling-and-clipping-a-raster\" \/>\n<meta property=\"og:site_name\" content=\"ArcGIS Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/esrigis\/\" \/>\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\/product\/mapping\/filling-and-clipping-a-raster#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/product\/mapping\/filling-and-clipping-a-raster\"},\"author\":{\"name\":\"Aileen Buckley\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/874953792dea98fe178fbb6a5e8255b0\"},\"headline\":\"Filling and clipping a raster\",\"datePublished\":\"2009-06-17T00:00:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/product\/mapping\/filling-and-clipping-a-raster\"},\"wordCount\":5,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#organization\"},\"keywords\":[\"Map Data\"],\"articleSection\":[\"Mapping\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.esri.com\/arcgis-blog\/products\/product\/mapping\/filling-and-clipping-a-raster#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/product\/mapping\/filling-and-clipping-a-raster\",\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/product\/mapping\/filling-and-clipping-a-raster\",\"name\":\"Filling and clipping a raster\",\"isPartOf\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#website\"},\"datePublished\":\"2009-06-17T00:00:00+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/product\/mapping\/filling-and-clipping-a-raster#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.esri.com\/arcgis-blog\/products\/product\/mapping\/filling-and-clipping-a-raster\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/product\/mapping\/filling-and-clipping-a-raster#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.esri.com\/arcgis-blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Filling and clipping a raster\"}]},{\"@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\/874953792dea98fe178fbb6a5e8255b0\",\"name\":\"Aileen Buckley\",\"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\/03\/Aileen.jpg\",\"contentUrl\":\"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/03\/Aileen.jpg\",\"caption\":\"Aileen Buckley\"},\"description\":\"Dr. Aileen Buckley is a cartographer researcher and Senior Principal GIS Engineer at Esri. I'm on the ArcGIS Living Atlas of the World Team, making, writing, and talking about maps. I'm also involved in a number of cartographic societies and association, and I'm the chair of the ICA Ethics in Cartography Commission.\",\"sameAs\":[\"https:\/\/www.instagram.com\/buckley.aileen\/\",\"linkedin.com\/in\/aileenbuckley\"],\"honorificPrefix\":\"Dr.\",\"honorificSuffix\":\"PhD\",\"gender\":\"female\",\"award\":[\"Chair of the ICA Commission on Ethics in Cartography\"],\"knowsAbout\":[\"Cartography\",\"GIS\"],\"knowsLanguage\":[\"English\"],\"jobTitle\":\"Research Cartographer\",\"worksFor\":\"Esri\",\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/author\/abuckley\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Filling and clipping a raster","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\/product\/mapping\/filling-and-clipping-a-raster","og_locale":"en_US","og_type":"article","og_title":"Filling and clipping a raster","og_url":"https:\/\/www.esri.com\/arcgis-blog\/products\/product\/mapping\/filling-and-clipping-a-raster","og_site_name":"ArcGIS Blog","article_publisher":"https:\/\/www.facebook.com\/esrigis\/","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\/product\/mapping\/filling-and-clipping-a-raster#article","isPartOf":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/product\/mapping\/filling-and-clipping-a-raster"},"author":{"name":"Aileen Buckley","@id":"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/874953792dea98fe178fbb6a5e8255b0"},"headline":"Filling and clipping a raster","datePublished":"2009-06-17T00:00:00+00:00","mainEntityOfPage":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/product\/mapping\/filling-and-clipping-a-raster"},"wordCount":5,"commentCount":0,"publisher":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/#organization"},"keywords":["Map Data"],"articleSection":["Mapping"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.esri.com\/arcgis-blog\/products\/product\/mapping\/filling-and-clipping-a-raster#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/product\/mapping\/filling-and-clipping-a-raster","url":"https:\/\/www.esri.com\/arcgis-blog\/products\/product\/mapping\/filling-and-clipping-a-raster","name":"Filling and clipping a raster","isPartOf":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/#website"},"datePublished":"2009-06-17T00:00:00+00:00","breadcrumb":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/product\/mapping\/filling-and-clipping-a-raster#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.esri.com\/arcgis-blog\/products\/product\/mapping\/filling-and-clipping-a-raster"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/product\/mapping\/filling-and-clipping-a-raster#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.esri.com\/arcgis-blog\/"},{"@type":"ListItem","position":2,"name":"Filling and clipping a raster"}]},{"@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\/874953792dea98fe178fbb6a5e8255b0","name":"Aileen Buckley","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\/03\/Aileen.jpg","contentUrl":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/03\/Aileen.jpg","caption":"Aileen Buckley"},"description":"Dr. Aileen Buckley is a cartographer researcher and Senior Principal GIS Engineer at Esri. I'm on the ArcGIS Living Atlas of the World Team, making, writing, and talking about maps. I'm also involved in a number of cartographic societies and association, and I'm the chair of the ICA Ethics in Cartography Commission.","sameAs":["https:\/\/www.instagram.com\/buckley.aileen\/","linkedin.com\/in\/aileenbuckley"],"honorificPrefix":"Dr.","honorificSuffix":"PhD","gender":"female","award":["Chair of the ICA Commission on Ethics in Cartography"],"knowsAbout":["Cartography","GIS"],"knowsLanguage":["English"],"jobTitle":"Research Cartographer","worksFor":"Esri","url":"https:\/\/www.esri.com\/arcgis-blog\/author\/abuckley"}]}},"text_date":"June 17, 2009","author_name":"Aileen Buckley","author_page":"https:\/\/www.esri.com\/arcgis-blog\/author\/abuckley","custom_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/08\/Newsroom-Keyart-Wide-1920-x-1080.jpg","primary_product":false,"tag_data":[{"term_id":23211,"name":"Map Data","slug":"map-data","term_group":0,"term_taxonomy_id":23211,"taxonomy":"post_tag","description":"","parent":0,"count":35,"filter":"raw"}],"category_data":[{"term_id":22941,"name":"Mapping","slug":"mapping","term_group":0,"term_taxonomy_id":22941,"taxonomy":"category","description":"","parent":0,"count":2691,"filter":"raw"}],"product_data":[],"primary_product_link":"https:\/\/www.esri.com\/arcgis-blog\/","_links":{"self":[{"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/blog\/121051","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\/4331"}],"replies":[{"embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/comments?post=121051"}],"version-history":[{"count":0,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/blog\/121051\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/media?parent=121051"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/categories?post=121051"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/tags?post=121051"},{"taxonomy":"industry","embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/industry?post=121051"},{"taxonomy":"product","embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/product?post=121051"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}