{"id":100,"date":"2011-02-14T15:29:00","date_gmt":"2011-02-14T15:29:00","guid":{"rendered":"http:\/\/geoplanit.co.uk\/?p=100"},"modified":"2011-02-14T15:29:00","modified_gmt":"2011-02-14T15:29:00","slug":"arcgis-using-query-builder-to-display-certain-features-multiple","status":"publish","type":"post","link":"https:\/\/www.geoplanit.co.uk\/?p=100","title":{"rendered":"ArcGIS : Using Query Builder to display certain features (multiple)"},"content":{"rendered":"<table cellpadding=\"0\" cellspacing=\"0\" class=\"tr-caption-container\" style=\"float: left; margin-right: 1em; text-align: left;\">\n<tbody>\n<tr>\n<td style=\"text-align: center;\"><a href=\"https:\/\/i0.wp.com\/3.bp.blogspot.com\/-UemuFDSpmvk\/TVlGyUC6fNI\/AAAAAAAAEkA\/tybRoJlV3xY\/s1600\/QueryBuilder.jpg\" imageanchor=\"1\" style=\"clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" border=\"0\" height=\"165\" src=\"https:\/\/i0.wp.com\/3.bp.blogspot.com\/-UemuFDSpmvk\/TVlGyUC6fNI\/AAAAAAAAEkA\/tybRoJlV3xY\/s200\/QueryBuilder.jpg?resize=200%2C165\" width=\"200\" \/><\/a><\/td>\n<\/tr>\n<tr>\n<td class=\"tr-caption\" style=\"text-align: center;\">The Power of SQL &amp; Query Builder<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>I know this post covers something probably very obvious&nbsp;to many technical users of ArcGIS. &nbsp; However some of us ArcGIS users are not necessarily aware of Query Builder and it&#8217;s uses. &nbsp;So this advice is for people like us\/them.<\/p>\n<p>You may have noticed the &#8220;Definition Query&#8221; tab in your &#8220;Layer Properties&#8221; dialog box (right click on your layer and select &#8216;properties&#8217;).&nbsp;<a href=\"http:\/\/help.arcgis.com\/en\/arcgisdesktop\/10.0\/help\/index.html#\/\/00s50000002t000000.htm\">As ESRI says in the ArcGIS helpfile<\/a>:<\/p>\n<blockquote><p><span class=\"Apple-style-span\" style=\"font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17px;\">Query expressions are used in ArcGIS to select a subset of features and table records.<\/span><\/p><\/blockquote>\n<p>Clear as mud to those not familiar with standard SQL expressions! &nbsp; Anyway why would you use? Or more&nbsp;importantly&nbsp;why would I use it?<\/p>\n<p>Here was my problem, for a particular project I have imported into a Geodatabase an AutoCAD file that has many layers and a lot of features. &nbsp;So I am displaying each former AutoCAD layer with different symbology but using the same feature class in the geodatabase each time (clear enough?).<\/p>\n<table cellpadding=\"0\" cellspacing=\"0\" class=\"tr-caption-container\" style=\"float: right; margin-left: 1em; text-align: right;\">\n<tbody>\n<tr>\n<td style=\"text-align: center;\"><a href=\"https:\/\/i0.wp.com\/2.bp.blogspot.com\/-owVoK9j3oZI\/TVlKN_tS4wI\/AAAAAAAAEkE\/9xjg2HC9Y5E\/s1600\/QueryBuilder1.jpg\" imageanchor=\"1\" style=\"clear: right; margin-bottom: 1em; margin-left: auto; margin-right: auto;\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" border=\"0\" height=\"161\" src=\"https:\/\/i0.wp.com\/2.bp.blogspot.com\/-owVoK9j3oZI\/TVlKN_tS4wI\/AAAAAAAAEkE\/9xjg2HC9Y5E\/s200\/QueryBuilder1.jpg?resize=200%2C161\" width=\"200\" \/><\/a><\/td>\n<\/tr>\n<tr>\n<td class=\"tr-caption\" style=\"text-align: center;\">How did I select you? You&#8217;re not there!<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Using the Symbology tab in the Layer properties I can display only those features that I am interested in. &nbsp; Now I can make some nice paper maps and the like! &nbsp; The trouble is when I want to now edit that layer I keep on selecting for some reason the features that I haven&#8217;t assigned symbology to. &nbsp; Very annoying and very frustrating. <\/p>\n<p>So what the Query Builder allows me to do is select only the features that are in this case by layer name field (it&#8217;s from AutoCAD) to be used. &nbsp; Now when I go to edit this layer only those features I have given symbology to are selectable. &nbsp; &nbsp;Okay I apologise if this doesn&#8217;t make sense to you but then perhaps you haven&#8217;t had the same issue I have.<\/p>\n<p>Anyway say you have three features types (formerly layers in AutoCAD) that you want display these are:<\/p>\n<ul>\n<li>Primary Road<\/li>\n<li>Secondary Road<\/li>\n<li>Track<\/li>\n<\/ul>\n<div>All you need to do is type (or construct) the following code into the Query Builder:<\/p>\n<blockquote><p>&#8220;Layer&#8221; IN(&#8216;Primary Road&#8217; , &#8216;Secondary Road&#8217;, &#8216;Local&#8217; )<\/p><\/blockquote>\n<\/div>\n<p>I&#8217;m not here to explain how it works as to be honest I&#8217;m not sure and its probable that you can do this another way. &nbsp; However this works for me, if you have any suggestions as to a better code, I&#8217;m all ears so please add a comment after this post and I&#8217;ll amend the advice!<\/p>\n<p>I looked for help on the ArcGIS forums beforing writing this post and used the following discussion thread:<br \/><a href=\"http:\/\/draft.blogger.com\/\"><span id=\"goog_698836469\"><\/span>Mulitple NOT expressions in query builder?&nbsp;<span id=\"goog_698836470\"><\/span><\/a><\/p>\n<p><span class=\"Apple-style-span\" style=\"font-size: x-small;\">S<b>uggested Reads (I guess):&nbsp;<a href=\"http:\/\/www.amazon.com\/Getting-Know-ArcGIS-Desktop-ArcEditor\/dp\/158948083X?ie=UTF8&amp;tag=ge06f-21&amp;link_code=btl&amp;camp=213689&amp;creative=392969\" target=\"_blank\">Getting to Know ArcGIS Desktop: The Basics of ArcView, ArcEditor, and ArcInfo Updated for ArcGIS 9 (Getting to Know series)<\/a><img loading=\"lazy\" decoding=\"async\" alt=\"\" border=\"0\" height=\"1\" src=\"http:\/\/www.assoc-amazon.com\/e\/ir?t=ge06f-21&amp;l=btl&amp;camp=213689&amp;creative=392969&amp;o=1&amp;a=158948083X\" style=\"border: none !important; margin: 0px !important; padding: 0px !important;\" width=\"1\" \/>&nbsp;and&nbsp;<a href=\"http:\/\/www.amazon.com\/SQL-Dummies-Allen-G-Taylor\/dp\/0470557419?ie=UTF8&amp;tag=ge06f-21&amp;link_code=btl&amp;camp=213689&amp;creative=392969\" target=\"_blank\">SQL For Dummies<\/a><img loading=\"lazy\" decoding=\"async\" alt=\"\" border=\"0\" height=\"1\" src=\"http:\/\/www.assoc-amazon.com\/e\/ir?t=ge06f-21&amp;l=btl&amp;camp=213689&amp;creative=392969&amp;o=1&amp;a=0470557419\" style=\"border: none !important; margin: 0px !important; padding: 0px !important;\" width=\"1\" \/><\/b><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Power of SQL &amp; Query Builder I know this post covers something probably very obvious&nbsp;to many technical users of ArcGIS. &nbsp; However some of us ArcGIS users are not necessarily aware of Query Builder and it&#8217;s uses. &nbsp;So this advice is for people like us\/them. You may have noticed the &#8220;Definition Query&#8221; tab in [&hellip;]<\/p>\n","protected":false},"author":161,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,13,31,139,138,54,9],"tags":[],"class_list":{"0":"post-100","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-arcgis","7":"category-arcmap","8":"category-autocad","9":"category-database","10":"category-sqls","11":"category-tips","12":"category-workflow"},"_links":{"self":[{"href":"https:\/\/www.geoplanit.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/100","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.geoplanit.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.geoplanit.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.geoplanit.co.uk\/index.php?rest_route=\/wp\/v2\/users\/161"}],"replies":[{"embeddable":true,"href":"https:\/\/www.geoplanit.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=100"}],"version-history":[{"count":0,"href":"https:\/\/www.geoplanit.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/100\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.geoplanit.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=100"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.geoplanit.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=100"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.geoplanit.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=100"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}