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

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.
  2. Click on Bookmarks on the Map tab in the ribbon. Select the Labeling bookmark. This will zoom you in to an area located in the center of the City.
  3. Select the Parcels layer in the Contents pane so that the Feature Layer Contextual menu appears with three new tabs.
  4. Click on the Labeling tab in the ribbon.
  1. Click on the Label button located in the Layer group on the Labeling tab. It should be the located on the far-left side of the ribbon.

Text will appear in the map showing the PIN for each parcel. The values being displayed are being pulled from the Attribute Table for the Parcels layer. If you look in the Label Class group on the Labeling tab, you will see a setting for Field. It is set to Parcels.PIN. This means that the values being displayed are those found in the PIN field from the original Parcels table. You will now build an expression using the Arcade language, which will label each parcel with its PIN from the Parcels table and with its owner from the joined Owners table.

  1. Click on the Expression button located to the right of the Field cell in the Label Class group. The Label Class pane should appear on the right of the interface. This is where you will build your labeling expression:
  1. Click in form of $feature[‘Parcels.Pin’], the expression area in the Label Class pane. Type “PIN: “+ in the expression area, as shown ahead:
  1. Click on the Validate button located at the bottom of the expression area. It looks like a green check mark. If it says Expression is valid, continue. If it does not, double check your expression against the previous graphic to make sure you typed in the correct syntax.
  2. In the expression area, add the following to the end of the expression you have already created: +Textformatting.Newline+"Owner: ".
  3. In the Fields window in the Labeling Class pane, scroll down until you see Owners.LASTNAME. Double click on Owners.LASTNAME to add it to the expression.

Your full labeling expression should now say:

"PIN: "+$feature['Parcels.PIN']+Textformatting.Newline+"Owner: "+$feature['Owners.LASTNAME']
  1. Click on the Validate button once again to verify your syntax. If it says, Your expression is valid, click Apply. If it does not, verify your expression. If you continue to have issues, read the following tip:

If you are having issues creating the expression, you can load one that has already been created. Just click on the Import button located next to the validate button and navigate to C:\Student\ArcGISProCookbook\Chapter3\Joining Data. Select the PIN_Owner_Label_Expression.lxp. Then click OK to import the expression.

  1. Save your project.

You have just labeled each parcel using the PIN field found in the original Parcels Attribute Table and the LastName field from the Owners table. You also added descriptive text to the label to make it easier to know what the labels were. Now you will clean up your labels so they are easier to read.

ArcGIS Pro supports several languages for writing labeling expressions. In addition to Arcade, you can write expressions using Python, VBScript, and Jscript. Labeling expressions written for ArcMap and saved to expression files (.exp) are not compatible with ArcGIS Pro.

  1. Click on the Position tab in the Label Class pane, as shown in the following screenshot:
  1. Click on the Position button in the Position tab in the Label Class pane.
  2. If required, expand the Placement option and select Land Parcel placement from the drop-down menu.
  3. Locate where it says Horizontal in polygon and click on the drop-down arrow. Select Straight in polygon.
  4. Click on the Fitting Strategy button located at the top of the Labeling Class pane. It looks like a Knight chess piece.
  5. Expand Reduce size by clicking on the small arrowhead.
  6. Click on the box next to Reduce font size to enable this function.
  7. Set the following parameters:
    • Font size reduction:
      • Lower limit: 4.0
      • Step interval: 1.0
    • Font width compression:
      • Lower limit: 60
      • Step interval: 5.0

The Label Class pane should now look like the following screenshot:

  1. Click on the Labeling tab in the ribbon.
  1. In the Visibility Range group, click on the drop-down arrow for Out Beyond and select <Current>. This will mean that the labels you just configured will only appear when you zoom in to the current scale of your map. If you zoom out to show a larger area, the labels will not be displayed.
  1. Save your project.

In this recipe, you labeled the parcels in the map with values from the PIN field in the Parcels Attribute Table and the LASTNAME field in the Owners table which you had joined to the parcels in the last recipe. You did this using Esri’s new Arcade expression language.

In the first part of your expression, you added descriptive text which allowed users to know what the labeled values were. You did this in Arcade by using double quotes. This tells ArcGIS Pro to simply display the text values found inside the double quotes. For example, your expression contained “PIN: “. This produced a label which showed up in the map a PIN: .

This was then followed up with a reference to a database field. In Arcade, you did this using the + to indicate another part of the expression, followed by $feature[‘Parcels.PIN]. This displays the value found in the PIN field within the Parcels Attribute Table. The + sign must be used between each part of the expression. You then displayed the owner name on another line in the label using Textformatting.Newline in your expression.  Once you set the owner name to be displayed on a separate line, you add more descriptive text by including “Owner: “ in your expression. Lastly, you displayed the owners name by calling to the LASTNAME field in the joined Owners table by including $feature[‘Owners.LASTNAME’] at the end of your expression. This produced a label for each parcel that looked like this in the map:

  • PIN: T22 028
  • Owner: Unknown

You then adjusted several configuration settings for the labels in the Label Class pane to make the labels fit in the parcels better and to be easier to read. You did this by setting the placement option to Land parcel placement. This automatically applies some settings that are preconfigured in ArcGIS Pro for placing text within a parcel. This cleaned up several of the overlapping labels, but left many parcels without a label.

So, next you set the positioning to be Straight in a polygon as opposed to the default Horizontal in a polygon. This allows ArcGIS Pro to fit labels diagonally within the polygon if needed, first adjusting the size of the font. This allowed ArcGIS Pro to label a few more parcels, but still not all of them.

Next, you moved over to the Fitting Strategy to adjust the font size for your labels. You enabled Reduce font size. This allowed ArcGIS Pro to automatically resize the font within the parameters you designated to help fit the label within the parcels. By making this adjustment you were able to get all the parcels in the view labeled.  

主站蜘蛛池模板: 大理市| 浮梁县| 香港 | 郓城县| 桐柏县| 芜湖市| 仲巴县| 台南市| 大庆市| 内乡县| 光山县| 天等县| 老河口市| 乳山市| 苍南县| 南靖县| 醴陵市| 高州市| 江津市| 宁化县| 青田县| 宁陕县| 彭泽县| 丰宁| 雅江县| 吉首市| 高淳县| 类乌齐县| 镇安县| 双城市| 彰化县| 兴国县| 米脂县| 准格尔旗| 黔南| 桐庐县| 乌恰县| 化州市| 敦煌市| 沂南县| 盐边县|