官术网_书友最值得收藏!

How to do it...

  1. If you closed ArcGIS Pro after completing the previous recipe, open the Joining Data.aprx project by following the same instructions as shown in the beginning of the previous recipe. Otherwise continue with this recipe.
  2. Click on the Map tab in the ribbon.
  3. Click on the Full Extent button in the Navigate group on the Map tab. It looks like a small globe.
  4. Click on the Select by Attributes tool in the Selection group on the Map tab in the ribbon. This will open the Select Layer by Attribute tool in the Geoprocessing pane.
  5. Set the Layer Name or Table View to Parcels using the drop-down arrow.
  6. Ensure the Selection type is set to New selection.
  7. Under Expression, click on the Add Clause button.
  1. Set the Field to LASTNAME using the drop-down arrow.
  2. Ensure the operator is set to is Equal to.
  3. In the last cell, either type City of Thomaston, or pick it from the list of values shown with the drop-down arrow.
  1. Verify that your clause looks like the preceding screenshot and click Add.
  2. Click the Verify button located below the Expression to make sure your syntax is correct. The Verify button looks like a green check mark.
  3. If your SQL expression is valid, click Run.
  4. Click on the List by Selection button located at the top of the Contents pane. The button is three polygons, one blue and two white. Look at the number to the right of Parcels. Verify that you have selected 84 parcels.

You have just selected all the parcels owned by the City of Thomaston using a Select by Attributes query. You were able to do that using data from the joined Owners table.

If you are already familiar with writing SQL where clauses, you can click on the small SQL button located under Expression and manually type the query you just built. The proper syntax would be Owners.LASTNAME = 'City of Thomaston'.

  1. Click on the small arrow in a circle located at the top of the Geoprocessing pane.
  1. Click on the Toolboxes tab located near the top of the Geoprocessing pane.
  2. Expand the Conversion Tools toolbox by clicking on the small arrowhead.
  3. Expand the Excel toolset using the same method.
  4. Double-click on the Table to Excel python script.

In the toolboxes, different icons indicate different types of tools. Hammers indicate system tools. Scrolls indicate python scripts. Series of connected squares indicate models created with ModelBuilder.

  1. Set the Input Table to Parcels using the drop-down arrow.
  2. For the Output Excel File, click on the Browse button located at the end of the cell.
  3. In the Save As window that appears, navigate to the MyProjects folder located in C:\Student\ArcGISProCookbook\.
  4. Type Parcels owned by Thomaston into the File Name cell.
  5. Verify that your Save As window looks similar to the following screenshot and click Save. The folders you see in the MyProject folder will be different.
  1. Your Table to Excel tool should look like the following. If it does, click Run.

When you run a geoprocessing tool with features selected, the tool only works on the selected features. So, in this case, you only exported the parcels which are owned by the City of Thomaston to a spreadsheet.

  1. Open File Explorer. It is normally located on your taskbar near the Start button, and looks like a file folder in a holder.
  2. In the tree on the left, select This PC or My Computer depending on what operating system you are running.
  3. Double-click on your C:\ drive.
  4. Navigate to C:\Student\ArcGISProCookbook\MyProjects. You should see the spreadsheet you just created from ArcGIS Pro.
  5. Double-click on the Parcels_owned_by_Thomaston.xls file to open it. Take a moment to explore the spreadsheet to see what you have created.
  6. When you are done reviewing the spreadsheet, close it and return to ArcGIS Pro.
  7. Click back on the Map tab in ArcGIS Pro.
  8. Click on the Clear button in the Selection group on the Map tab in the ribbon. This deselects all selected features.
  1. Close the Geoprocessing pane.
  2. Save your project and close ArcGIS Pro.

In this recipe, you queried all the parcels owned by the City of Thomaston and then exported the selected list to a spreadsheet. To query the parcels owned by the City, you created an SQL where clause using the query builder. This allows you to create SQL expressions without having to know SQL.

SQL stands for Structured Query Language. SQL is the standard language used by databases to communicate. It allows you to perform many functions within a relational database. Where clauses allow you to select records (or features within a GIS) which meet specific criteria. In the recipe you just completed, the criteria was where the Parcels owner equaled the City of Thomaston, thus why it is called a where clause. Like all languages, SQL has a specific syntax which must be followed to work. The ArcGIS Pro query builder you used knows the syntax and automatically creates the proper expression based on the parameters you provide. You used the Create Feature Class geoprocessing tool to generate the new shapefile. After you created the new shapefile, you added attribute fields to the table, which will store additional information about the street signs.

After you selected the parcels owned by the City of Thomaston, you exported them to a spreadsheet using the Table to Excel python script tool found in the Conversion toolbox and Excel toolset. Python is a scripting language which has been heavily integrated in to the ArcGIS platform. Python scripts can be created to assist with automating and streamlining workflows. To learn more about using Python with ArcGIS, we recommend Programming ArcGIS with Python Cookbook, 2nd Edition by Eric Pimpler from Packt Publishing.  

主站蜘蛛池模板: 独山县| 塘沽区| 敖汉旗| 延边| 盐城市| 谷城县| 金川县| 苗栗市| 罗甸县| 龙门县| 南澳县| 郓城县| 信丰县| 开化县| 临汾市| 温宿县| 西林县| 益阳市| 封丘县| 任丘市| 班戈县| 高淳县| 通渭县| 泸溪县| 湖口县| 南开区| 腾冲县| 平阳县| 高台县| 长泰县| 吉木乃县| 进贤县| 太仓市| 汶川县| 黄陵县| 方山县| 拜泉县| 类乌齐县| 永城市| 永顺县| 新宁县|