
Download the ArcPy_DQ.zip folder from the Resources and extract the contents to the root of your C Drive. C:\ArcPy_DQ should be the path to the course material.
In this video we will get the 21-Day Trial of ArcGIS Pro. This is not necessary if you already have access to ArcGIS Pro. Download the arcgispro_trial.txt from the Resources for the link.
In this video we will install PyScripter and enable the use of the arcpy module. Download the install_pyscripter.txt file from Resources for the link. You do not need to use PyScripter, you can use an IDE of choice. I recommend avoiding IDLE as the AddMessage() function will not work, you can replace AddMessage() with print().
In this video we will discuss what a Definition Query is and see how to set a very basic query in ArcGIS Pro.
In this video we will several reasons why you would require the use of a Definition Query.
As of ArcGIS Pro 3.5 the Spatial Clause for a Definition Query was introduced. I have added a new section called ArcGIS Pro 3.5+ Spatial Clause with a Definition Query further down which you can go to after this section or at another time. If you are following along with this section and your ArcGIS Pro is 3.5 or above, then the Definition Query dictionary seen in this section will differ slightly in that you won't see the spatialClause property in the videos but you will see them on your screen.
In this video we will use ArcPy to access our open APRX, create a Map object, and from that Map object create a Layer object that represents the layer we wish to add a definition query to. We will use the Layer objects definitionQuery property to add our definition queries.
In this video we will list all the Definition Queries available for a layer using the Layer objects listDefinitionQueries() function.
In this video we will see a couple of ways we can turn off all Definition Queries for a layer so that the layer displays its original content.
In this video we will use the updateDefinitionQueries() function, that we saw in the previous video, and add a new Definition Query to our layer.
In this video we will look at altering an existing Definition Query using the knowledge we have gained so far.
In this video we will look at deleting a Definition Query from a layer.
In this video we will delete all Definition Queries from a layer in one slick move!
In this video we will walk through the Python Script that will drive our Create Definition Query from Selection tool in ArcGIS Pro.
In this video we will take a look at how the Create Definition Query from Selection tool is constructed in ArcGIS Pro.
In this video we will see the Create Definition Query from Selection tool in action in ArcGIS Pro.
In this video we will look at the Python Script behind our Create Definition Query from Intersection tool.
In this video we will take a look at how the Create Definition Query from Intersection tool is constructed in ArcGIS Pro
In this video we will see the Create Definition Query from Intersection tool in action in ArcGIS Pro.
In this video we will look at the Python Script behind our Definition Query Map Series to PDF Python Script
In this video we will look at how to construct our Definition Query Map Series to PDF tool in ArcGIS Pro.
In this video we will see the Definition Query Map Series to PDF in action in ArcGIS Pro.
In this video we will look at how we can use ArcGIS Pro to understand and create SQL statements that we can copy and paste into our Python Scripts.
In this video we will assess using the Python CIM (Cartographic Information Model) to add Definition Queries for a layer. We will see that it can be tricky to use the CIM for manipulating Definition Queries and that using ArcPy directly was a smoother process. The CIM should only be used where ArcPy can not. It is, however, a good idea to develop CIM skills to tackle more complex problems.
A walkthrough the parameters for the Generate Definition Query from Selection tool available from ArcGIS Pro 3.4
Using the Generate Definition Query from Selection tool with default parameters
We can set a query name when using the Generate Definition Query from Selection tool.
Using the Generate Definition Query from Selection tool with the invert_where_clause parameter set to INVERT
When we set the method parameter to "USE_FIELD_NAMES" the field parameter must be set.
Using the Generate Definition Query from Selection tool with the append_active_query set to APPEND. Note: it does not update the current active query, it creates a new definition query and appends to the sql from the active.
Assessing the overwrite_where_clause and where clause parameters for the Generate Definition Query from Selection tool
In this video we will take an initial look at the Spatial Clause now available for a Definition Query as of ArcGIS Pro 3.5
In this video we will see the Spatial Clause for a Definition Query in action using ArcPy. Here, we will select a County Boundary to act as the geometry so filter the Placenames against using the Spatial Clause with the Definition Query.
In this video we will see the Spatial Clause for a Definition Query in action when we have to cater for multiple polygons.
A video from the Final Draft Mapping blog detailing how to enhance the Spatial Clause with the Definition Query to ustilise multiple layers and design a custom geometry for use.
learn.finaldraftmapping.com/enhancing-the-arcgis-pro-definition-query-spatial-clause-with-arcpy-with-a-multi-layer-geometry-filter/
Unlock the power of Definition Queries in ArcGIS Pro through this comprehensive course that dives deep into the intricacies of managing and utilizing definition queries with spatial data using ArcPy and Python scripting. Definition Queries provide a dynamic way to filter and display specific subsets of your data, enabling you to create more insightful maps and analyses. In this course, we will focus exclusively on Definition Queries, covering their creation, modification, and application through hands-on exercises and real-world scenarios.
Key Topics Covered:
Introduction to Definition Queries
Understand the fundamentals of Definition Queries and their role in data visualization and analysis in ArcGIS Pro.
Explore the benefits of using Definition Queries for efficient Map production and Data Management.
Definition Query Operations
Create, modify, enable, disable and delete Definition Queries through practical demonstrations.
Custom Tool Development
Build three custom tools using ArcPy and ArcGIS Pro to enhance you GIS Definition Queries capabilities.
Tool 1: Create a Definition Query based on a Selection in a Layer
Tool 2: Create a Definition Query for a Layer based on the intersection with another Layer.
Tool 3: Utilize Definition Queries to Create a Custom Map-Series and print to PDF.
Generate Definition Query from Selection
Geoprocessing Tool from the Data Management Toolbox
From ArcGIS Pro 3.4+
Spatial Clause
From ArcGIS Pro 3.5+
Are you a GIS Professional seeking to enhance their ArcGIS Pro or ArcPy skills? A Python developer interested in applying their programming expertise to geospatial data with ArcGIS Pro? or a student/researcher looking to explore helpers such as Definition Queries to enhance GIS techniques and spatial analysis? Then this course, that exclusively focuses on detailing Definition Queries and implementing Definition Queries with ArcPy, is is exactly what you need!
Join us on this journey to master Definition Queries and elevate your GIS skills with ArcPy for ArcGIS Pro!
By the end of this course, you'll be proficient in leveraging ArcPy to harness the full potential of Definition Queries, empowering you to create visually compelling maps and conduct precise spatial analyses. Enroll now and bring a new level of precision to your spatial data management and visualization.
Your course instructor, Glen Bambrick, has over 16 years' experience with GIS and geospatial data, and has implemented standardized workflows utilizing ArcPy to great affect. Glen is an huge advocate for standardized data management and content management. ArcMap used to be the pinnacle of ArcGIS Desktop, but since ArcGIS Pro came on the scene, Definition Queries have been revamped and Geospatial forums are littered with questions on how to use ArcPy to interact with Definition Queries in ArcGIS Pro. Glen has poured everything you need to know about Definition Queries into this concise course.