- ArcGIS Pro 2.x Cookbook
- Tripp Corbin GISP
- 1266字
- 2021-06-24 19:10:46
How to do it...
- If you closed ArcGIS Pro after completing the previous exercise, start ArcGIS Pro and click Open another project. If you still have ArcGIS Pro open, click the Project tab in the ribbon and select Open from the area on the left side of the pane.
- Click the Browse button and navigate to C:\Student\ArcGISProCookbook\Chapter2\Creating a Geodatabase.
- Select the Creating a Geodatabase.aprx and click OK:

- Right-click the Databases folder in either the Contents or Catalog pane, either will work:

- Select New File Geodatabase.
- In the panel located on the left side, double click C:\, then navigate to C:\Student\ArcGISProCookbook\MyProjects.
- Name your new geodatabase MyGeodatabase and click Save:

You just created your first geodatabase using ArcGIS Pro. It was a file geodatabase. If you remember from the previous chapter, a file geodatabase is one of three basic types of geodatabases that exist.
The file geodatabase is designed to be used by small organizations with only one or two primary users. It stores information within multiple files that are contained in a single folder with a .gdb extension. By default, a file geodatabase can store up to 1 TB per feature dataset, contained within the geodatabase plus at the root of the database. A feature dataset is similar to a folder on you computer used to store related files. A feature dataset is used to group related feature classes within the geodatabase. The total amount of data that can be stored per feature dataset can be changed to 4 or 256 TB using a configuration keyword. To learn more about configuration keywords for a geodatabase file, go to http://pro.arcgis.com/en/pro-app/help/data/geodatabases/overview/configuration-keywords-for-file-geodatabases.htm.
Now that you have created a new database, you need to create items that will actually hold your data. This will include feature classes and feature data sets. We will start with a simple feature class.
- Right-click the MyGeodatabase.gdb you just created. You can do this from the Catalog view or pane.
If you are trying to create the new feature class from the Catalog pane, you may need to expand the Databases folder so you can see the new file geodatabase you just created.
- Go to the New option in the menu and select Feature Class from that:

- The Geoprocessing pane should appear on the right side, with the feature class location already filled in. Name the new feature class Side_Walks.
Feature class names in a geodatabase have some limitations you should be aware of. They must start with a letter. Though the name can contain a number, it cannot start with one. Also, the name cannot contain spaces or special characters. The only exception is an underscore. The length of the name is limited by the operating system of the computer where you are storing the geodatabase file. However, I generally recommend keeping them as short as possible to avoid potential issues if you ever need to convert the database to another format.
- Set the Geometry type by selecting Polyline from the drop-down menu.
- Accept all the other defaults and verify that your Create Feature Class tool looks like the following image:

- Once you have verified that you have the correct settings, click Run.
- When the tool finishes, close the Geoprocessing pane.
- In the Catalog pane, expand MyGeodatabase.gdb so you can see its contents.
You should see the new feature class you just created. This is only the first part of creating a new feature class. The second part is defining the attributes you want to keep and associating it with the features you will store in the new feature class. So now you will create some attribute fields.
- Right-click the Side_Walks feature class you just created. Go to Design and select Fields, as shown here:

- The Design view will open in the middle of the interface. Notice that some fields have already been created. These are the default fields for a polyline geodatabase feature class.
Question: What default fields were automatically created when you created the new feature class?
Answer:
- Click where it says Click here to add a new field.
- In the Field Name cell, type Street.
- Click in the Alias cell and type Street Sidewalk Follows.
- Click in the Data type cell and choose Text from the drop-down menu.
- Click in the Length cell and replace 255 with 50.
- Click the New Field button located in the Changes group in the Fields tab in the ribbon. This is another way to add a new field.
- Fill in the following properties:
- Field Name: Install_Date
- Alias: Date Sidewalk was installed
- Data Type: Date
- Using these skills, try adding another field for pavement type. It should be a text field that is limited to 15 characters:

Your design view should look similar to this. Your field name for the pavement type and alias may be different, but that is acceptable as long as the length is the same.
- Click the Save button, located in the ribbon on the Fields tab, to save the new fields you have created to the feature class.
- Close the Design view by clicking the small X located on the tab above the view with Fields: Side_Walks.
- Use the skills you learned in previous recipes to add a new map, and then add the new feature class you just created to the map.
The new feature class should appear in the Contents pane. However, nothing is displayed because it is empty. Later in this book, you will learn how to edit the layer to create new features in it. Now you will learn how to add a new feature dataset to your geodatabase.
- In the Catalog pane, right-click MyGeodatabase.gdb. Go to New and select Feature Dataset:

- In the Geoprocessing pane, the Create Feature Dataset tool should appear. The output should already be defined as MyGeodatabase. Name your new feature dataset Property.
- Accept the default for the Coordinate System. It should be set to WGS_84_Web_Mercator_Auxilary_Sphere. This is the coordinate system used by most online mapping systems, including Google Earth, ArcGIS Online, and Bing Maps.
- Click Run to create the new feature dataset.
- Close the Geoprocessing pane when complete.
You should now see the new feature dataset appear in your MyGeodatabase database. It is identified in the geodatabase with three squares that overlap one another. This is the common icon for a feature dataset.
It is empty, so you will create a couple new feature classes in it that you will populate with some features later in the book:

- Right-click the new feature dataset you just created and, using the same methods you did to create the Side_Walks feature class, create a new feature class with the following properties:
- Feature Class Name: Property_Lines
- Feature Class Type: Polyline
- Using the same method you did for the Side_Walks feature class, add the following attribute fields:
- Field 1:
- Field Name: Type
- Alias: Property Line Type
- Data Type: Text
- Length: 10
- Field 2:
- Field Name: Length_FT
- Alias: Length in Feet
- Data Type: Float
- Field 1:
Using the skills you have learned, create another new feature class in the same feature dataset, called Parcels. It should be a polygon feature class. Once you create the new feature class, add the fields for Mapped Acres and Square Feet. Both should be float field types.
- Advanced Quantitative Finance with C++
- Modular Programming with Python
- Vue.js前端開發基礎與項目實戰
- Interactive Data Visualization with Python
- 軟件測試工程師面試秘籍
- R語言數據可視化實戰
- NativeScript for Angular Mobile Development
- 假如C語言是我發明的:講給孩子聽的大師編程課
- MySQL數據庫管理與開發實踐教程 (清華電腦學堂)
- Java程序設計教程
- Java Web開發基礎與案例教程
- INSTANT LESS CSS Preprocessor How-to
- Mastering ASP.NET Web API
- RESTful Web API Design with Node.js(Second Edition)
- MonoTouch應用開發實踐指南:使用C#和.NET開發iOS應用