Upload
others
View
3
Download
0
Embed Size (px)
Citation preview
GIS Practicum I NSTDB Geodatabase Documentation Designing, managing and maintaining GIS in a file geodatabase using Nova Scotia Topographic Database.
2013
Author: Vanessa Campbell Project Sponsor: Monica Beaton
12/13/2013
GISD3000 – GIS PRACTICUM & PROJECT PLANNING 2013
Page 3
Table of Contents Introduction ................................................................................................................................................ 5
Data Specification.................................................................................................................................. 5
Downloading & Retrieval ...................................................................................................................... 6
Summarizing Tables .............................................................................................................................. 6
PART 1: Building a Geodatabase ............................................................................................................. 8
Type of Geodatabase .............................................................................................................................. 8
Feature Themes ...................................................................................................................................... 9
Subtype & Domains ............................................................................................................................... 9
PART 2: Creating a GDB using Python ................................................................................................ 12
Settings .................................................................................................................................................. 12
Variables ................................................................................................................................................ 13
Geoprocessing Tools ............................................................................................................................. 13
PART 3: Creating Style & XML Files .................................................................................................... 18
Style Files .............................................................................................................................................. 18
XML Files ............................................................................................................................................... 20
PART 4: Creating Layers & Representations ....................................................................................... 20
Layer Files ............................................................................................................................................. 20
Representations Layers ....................................................................................................................... 21
PART 5: Layout & Annotation ................................................................................................................ 21
Layout .................................................................................................................................................... 21
Annotation ............................................................................................................................................ 22
PART 6: Conclusion ................................................................................................................................ 22
Error & Handling ................................................................................................................................. 22
Reflection .................................................................................................................................................. 23
Appendix A – Python Script ................................................................................................................... 24
Appendix B – Project Management Table ........................................................................................... 41
Sources ...................................................................................................................................................... 42
GISD3000 – GIS PRACTICUM & PROJECT PLANNING 2013
Page 4
Table of Figures Figure 1: Nova Scotia Vector Format...................................................................................................... 5 Figure 2: NTS map sheet 11D/12 - Halifax ........................................................................................... 6 Figure 3: Example of the dialog box for the summary tool and the selected field for the summary analysis. ...................................................................................................................................... 7 Figure 4: Example of NSTDB Specification website, underneath is a link to the website ............ 7 Figure 5: Feature Dataset Properties dialog box ................................................................................... 8 Figure 6: Example of the feature themes for NSTDB.gdb .................................................................. 9 Figure 7: Example of subtype categories. ............................................................................................... 9 Figure 8: Example of setting bl_points to the subtype building ........................................................ 10 Figure 9: Example of Domain tool ........................................................................................................ 11 Figure 10: Example of setting domains ................................................................................................ 11 Figure 11: Example of Importing Environment Settings .................................................................. 12 Figure 12: Example on how to write an overwrite statement ........................................................... 12 Figure 13: Variables set in the Python script ....................................................................................... 13 Figure 14: Syntax for creating a file geodatabase ............................................................................... 14 Figure 15: Syntax for spatial referencing ............................................................................................. 14 Figure 16: Syntax for create feature dataset ........................................................................................ 14 Figure 17: Syntax for feature class to geodatabase. ............................................................................ 15 Figure 18: Syntax for table to geodatabase........................................................................................... 15 Figure 19: Syntax for add field ............................................................................................................... 16 Figure 20: Syntax for Calculate Field ................................................................................................... 16 Figure 21: Syntax for set subtype field ................................................................................................. 16 Figure 22: Syntax for add subtype ......................................................................................................... 17 Figure 23: Syntax for set default subtype ............................................................................................. 17 Figure 24: Syntax for creating domains ............................................................................................... 17 Figure 25: Syntax for table to domain .................................................................................................. 17 Figure 26: Syntax for assign domain to field ....................................................................................... 18 Figure 27: Style Manager Window (left). Symbol Selector Window (right), showing the newly added style files ........................................................................................................................................ 19 Figure 28: Layer Properties Window where any user can import a style file and match it to the features ...................................................................................................................................................... 19 Figure 29: Layer Properties window, by clicking import (button to right) the user can import layer files .................................................................................................................................................... 20 Figure 30: Example of a representation layer window ....................................................................... 21 Figure 31: Example of annotation placement ..................................................................................... 22
GISD3000 – GIS PRACTICUM & PROJECT PLANNING 2013
Page 5
Figure 1: Nova Scotia Vector Format
Introduction
A geodatabase allocates geographic datasets into a common file system, which allows
users to manage, design and share a collection of feature information. The benefit of a
geodatabase is within the design and structures. The handler can chose between feature
themes (categorizing data), structuring subtypes, setting domains for the feature codes and
adding attribute/feature tables.
There are various types of geodatabases, personal, file and multi-user geodatabases.
The file system for this assignment is a file geodatabase. The first portion of the report is an
introduction to the design, management and maintenance of a file geodatabase. A file
geodatabase is for a single user and multiple readers using a large dataset (1 TB).
Parts 2 – 5 is an overview on the analysis and implementations that were applied to the
data to achieve the requirements for the final submission. The final project is to replicate a
National Topographic System (NTS) 1:50000 map sheets of Halifax, Nova Scotia.
Throughout the report there will be images/figures which demonstrate the structure of
the file geodatabase and the steps that are implemented to achieve the solution for this project.
Data Specification This section is an overview of the spatial feature dataset used in the creation of the file
geodatabase. The area of focus is the province Nova Scotia. Nova Scotia is part of the
Maritime Provinces, located in Atlantic Canada. The beautiful province is known for is rolling
hills, national historic sites,
delicious breweries, and the
profound college, Centre of
Geographic Sciences.
In the creation of the
geodatabase the entire
province was imported into
the file geodatabase. Further
analysis, manipulation, and
debugging were performed on
the import shape files.
GISD3000 – GIS PRACTICUM & PROJECT PLANNING 2013
Page 6
For the final submissions, the study area was narrowed down to the capital of Nova
Scotia, Halifax. Halifax Regional Municipality is located in Halifax County, which is roughly
equivalent to the size of Prince Edward Island (Wikipedia). The study area views the two twin
cities, Halifax and Dartmouth, with surrounding areas (see Figure 2)
Downloading & Retrieval The Nova Scotia Topographic Database is the primary data source used in the file
geodatabase. The data is sourced from the Nova Scotia Geomatics Centre (NSGC) where
1:10,000 scale data is free of charge. The feature dataset includes point, line and poly
shapefiles, as well as, a feature database table containing the feature descriptions and codes.
With every dataset used in GIS the quickest way to familiarize oneself with data is to
review the attributes of each feature. A full overview can cut down time when interpreting and
manipulating the data and when running into errors with datasets. Handling errors will be
mention later in the report.
Summarizing Tables
Summary Statistics is a geoprocessing tool used in ArcMap 10.1 that allows you to
calculate attributes by sum, STD, count, etc. The summary statistics tool creates an output
table, which can be saved as a database table (.dbf), which provides information on the total
Figure 2: NTS map sheet 11D/12 - Halifax
GISD3000 – GIS PRACTICUM & PROJECT PLANNING 2013
Page 7
count of unique features in the specified field. For this project, a summary was processed on
the FEAT_CODE field and saved as a database table (.dbf)
A summary was processed on all features included in the NSTDB dataset; approximately,
twenty-five output tables were created. Separately, all tables were opened in Microsoft Excel
and saved as an excel table (.xlsx). A new column (field) was added to each excel table, called
DESC, which contains the description of the FEAT_CODE. The description for each
FEAT_CODE can be found online on the NSGC website under NSTDB map specifications. The
purpose of these descriptions will help later with the scripting process.
http://www.nsgc.gov.ns.ca/mappingspecs/Specifications/Compilation/Resource_Version4/default.htm
Figure 3: Example of the dialog box for the summary tool and the selected field for the summary analysis.
Figure 4: Example of NSTDB Specification website, underneath is a link to the website
GISD3000 – GIS PRACTICUM & PROJECT PLANNING 2013
Page 8
PART 1: Building a Geodatabase An overview of the fundamental design steps in creating a file geodatabase that is
undertaken. The proposed design resulted from collaboration of four GIS students and their
teacher. Building a geodatabase can become complex, and requires a general background in
designing a geodatabase. In ArcMap, the help tab (top right) provides a link to ArcGIS
Resource Centre where you can review the steps to designing a geodatabase.
Type of Geodatabase
The geodatabase chosen for this
report is a file geodatabase. A file
geodatabase is best suited for this project
because of the file size (1 Terabyte), and the
user/reader compatibility, just to name a
few reasons (ArcGIS 10.1 Help). In Arc
Catalog, a new geodatabase was created and
named NSTDB.gdb, which is the original
name of the dataset. The new catalog
would look like the following
. This process can also be
accomplished in ArcGIS using the
ArcCatalog tool.
Once the empty geodatabase is
added the next step is to add feature
datasets. The new feature dataset must have a name, and a coordinate system attached (see
Figure 5). The projection should reflect the best representation of the data according to the
final output and/or dictate the industry standards.
The data used for this project originated in the geographical units NAD 83 CSRS UTM
Zone 20. The projection NAD 83 CSRS UTM Zone 20 is best suited for the end product, and is
the projection selected for the feature dataset properties. This projection can be found under
projected coordinate systems – National Grids – Canada – located close to the bottom.
Figure 5: Feature Dataset Properties dialog box
GISD3000 – GIS PRACTICUM & PROJECT PLANNING 2013
Page 9
Figure 6: Example of the feature themes for NSTDB.gdb
Feature Themes
The themes for a dataset can be composed in many ways. The best way to categorize
the data collection type is applying a theme that reflects the information you are mapping.
The point, line, and poly shapefiles for NSTDB were divided into nine categories, each
grouped by similar data collection type.
The nine categories included buildings (bl), designated areas (da), delimiter line (dl),
land forms (lf), land cover (lc), road & rail (rr), structures (st), utility (ut), and hydrography
(wa). Within each category are a point, line and poly
shapefile. The shapefiles were import into the feature
dataset that suited the shapefiles feature description.
ArcCatalog allows the user to choose between importing a
single feature class or multiple feature classes. When
dealing with large datasets it is beneficial to import multiple
feature classes to save time and allowing for quick
processing. After importing all shapefiles the feature
classes are now ready to be structured and set domains.
Subtype & Domains
Subtypes Subtype is another way of saving features as the same type. In Microsoft Excel, create a
new table called Subtypes. The table will have two columns, one a number field and the other
containing nine chosen categories that features will be grouped in.
The above table was imported into the file geodatabase and will be used to populate the
Subtype tab. A script tool can be created to prevent the user from retyping the values in the
Figure 7: Example of subtype categories.
GISD3000 – GIS PRACTICUM & PROJECT PLANNING 2013
Page 10
subtype field every time, otherwise, the values will have to be manually typed for each feature
class property.
In the properties of each feature class, under the fields tab add a new field called
Subtypes and set the data type as a long integer. Once the field has been added calculate the
Subtype field using the Field Calculator (Data Management tool). The calculating values on the
new ‘SUBTYPE’ field will be a value equal to those in the Subtypes table (shown above). This is
important because this is how the software knows to read the calculated values and replace
them with the corresponding description. In the Subtype tab, run the script tool or manually
type Subtype table into the Subtypes. Then, set the Default Subtype to the group that describe
the feature class properties. The image below is the feature class, bl_points, properties; this
image demonstrates the previous steps. Perform this process for all feature class properties,
setting each default subtype to the group that describes the objects features. To make sure your
subtype field was populated correctly check the preview tab and look at the table option
opposed to the default geography option. If the subtype field is not populated, the user will have
to recalculate the field using the Calculate Field tool.
Figure 8: Example of setting bl_points to the subtype building
GISD3000 – GIS PRACTICUM & PROJECT PLANNING 2013
Page 11
Domains
Domains can be set and checked in ArcCatalog in the geodatabase properties tab. To
add a domain chose the table to domain tool. This portion of the processing is when the excel
description tables (.xlsx) design earlier will be import and used.
The input table will be the excel summary table (.xlsx), the code field will be FEAT_CODE, the
description field the field name you gave the description field (DESC), the workspace will be
the file geodatabase and domain name will be the name of feature class you chose to run the
tool on. To check if the Table to Domain tool worked travelled back to your geodatabase
properties and check the domain tab, the code values at the bottom should now have
description.
To set domains, go into the properties of each feature class navigated to the Subtype tab,
under the Default Values and Domains change the domain, a pull down menu of all the
description (.xlsx) tables will be available.
Figure 9: Example of Domain tool
Figure 10: Example of setting domains
GISD3000 – GIS PRACTICUM & PROJECT PLANNING 2013
Page 12
PART 2: Creating a GDB using Python This portion of the report describes the methodology for creating a geodatabase (GDB)
using the programming language, Python. Python is a free programming language that allows
quick automation and efficient integration of geoprocessing tools to enhance productivity. The
handler is able convert geoprocessing tools into lines of code using expressions corresponding
to rules of syntax. The full script is found in appendix A at the end of the paper.
Settings
The first step in generating a script is creating environmental settings. Environmental
settings will reflect the workspace, the file directory where the data features are located and can
be stored, operating systems, for compatibility, and modules, adds extensions for functionality.
To incorporate these settings into the script you must import the environment settings (see
Figure 11). To check the progression of the script the programmer can write print statements;
these statements will show up in dialog window when the script runs. In a print statement a
user can integrate the syntax and variables or strings (see Figure 11).
Print statement can be used as a process of debugging by showing the progression of the script
and flagging areas where errors have occurred. Another error handling technique is including
overwrite statement (see Figure 12). An overwrite statement will overwrite existing data
allowing a user to run the script as many time as desired without running into error. Without
this statement a user will run into errors that say the file already exist and will stop the script.
Figure 11: Example of Importing Environment Settings
Figure 12: Example on how to write an overwrite statement
GISD3000 – GIS PRACTICUM & PROJECT PLANNING 2013
Page 13
Variables
Variables are created in Python to act as an alias name for a specified feature; a user
wants to make sure the variable describes the feature in some way. The benefits of variables
make it easier to recall a feature without having to write the complete path; throughout the
script a user may have to recall on the feature. The figure (Figure 13) below demonstrates
variables used in the script. All of the processing steps have variables, check appendix A to view
the variables in the script.
Geoprocessing Tools
This section describes, in order, the geoprocessing tools use to create a file geodatabase
that pertains to the one created in Part 1. The order of processing is critical; otherwise, the
functionality will not process or the results will be inaccurate The geoprocessing tools are an
added extension, and can be used in a script by importing the module arcpy (see Figure 11).
Arcpy allows the functionality of ArcMap tools
The following steps go through the creation of a geodatabase to setting subtypes and
domains. The final product will produce a replicated version of the geodatabase created
manually in Part 1. The steps will include a brief description, the syntax used for the
processing, and a snippet of the syntax. To save space the snippets (Figures) will not show
entire list of syntax for that tool. To view, in detail, check appendix A for the full script.
Figure 13: Variables set in the Python script
GISD3000 – GIS PRACTICUM & PROJECT PLANNING 2013
Page 14
Step 1: Creating a File Geodatabase
This step creates the file geodatabase (GDB) by setting the file path, where the GDB can be
found and setting the name of the GDB (NSTDB.gdb)
Syntax: CreateFileGDB_management (out_folder_path, out_name)
Step 2: Assigning a Coordinate System
This step adds a spatial coordinate system to the script. The coordinate system will be given a
variable and will be used in the next step, which will assign the coordinate system to the feature
classes.
Syntax: CreateSpatialReference_management ({spatial_reference})
Step 3: Creating Feature Datasets
This step creates the feature themes that represent the nine categories buildings (bl),
designated areas (da), delimiter line (dl), land forms (lf), land cover (lc), road & rail (rr),
structures (st), utility (ut), and hydrography (wa). In this step the spatial reference (sr) will be
assigned as coordinate system for this file geodatabase.
Syntax: CreateFeatureDataset_management (out_dataset_path, out_name, {spatial_reference})
Figure 14: Syntax for creating a file geodatabase
Figure 15: Syntax for spatial referencing
Figure 16: Syntax for create feature dataset
GISD3000 – GIS PRACTICUM & PROJECT PLANNING 2013
Page 15
Step 4: Create Feature Classes
This step converts shapefiles into feature classes and import them into the file geodatabase.
The shapefiles will be the same shapefiles used in Part 1. The user must specify which feature
theme the feature class will be imported into.
Syntax: FeatureClassToGeodatabase_conversion (Input_Features, Output_Geodatabase)
Step 5: Importing Description Tables
This step will import the description tables (.xlsx) that were created in the Part 1, into the
geodatabase. The description tables will populate a description name for the FEAT_CODE field.
The description tables have two fields FEAT_CODE, the code for a feature attribute and DESC,
the description for the feature attribute.
For this function an error handling method, try and except statement, was used to assure that
all the tables were convert. There were issues with this tool, where some tables would not
convert and other would. By using this method, try and except, helped pin point which tables
were not working. The main contributor was spelling errors, which if ever possible copy and
paste the name.
Syntax: TableToGeodatabase_conversion (input_table, output_geodatabase)
Figure 17: Syntax for feature class to geodatabase.
Figure 18: Syntax for table to geodatabase
GISD3000 – GIS PRACTICUM & PROJECT PLANNING 2013
Page 16
Step 6: Subtypes: Add Field
This step is simple. A field is added to the specified feature, which will be populated in the next
step. The syntax for this tool the user will specify the feature that the field will be added to, the
new field name, the field type (for this creation a long integer will be required) and describe the
number of digits that will be stored in the field.
Syntax: AddField_management (in_table, field_name, field_type, {field_precision}
Step 7: Subtypes: Calculate Field This step will populate the field based on an expression. The calculated expression for this tool
reflects the subtype group (refer to Figure 7) that the input table belongs to. This tool requires
the user to specify the expression type which is written in VB format.
FieldName is a variable for “Subtype”
Syntax: CalculateField_management (in_table, field, expression, {expression_type})
Step 8: Subtype: Set the Subtype Field
This step will apply the new calculated field, FieldName (“Subtype” ) to the subtype field in the
feature class properties.
Syntax: SetSubtypeField_management (in_table, field)
Figure 19: Syntax for add field
Figure 20: Syntax for Calculate Field
Figure 21: Syntax for set subtype field
GISD3000 – GIS PRACTICUM & PROJECT PLANNING 2013
Page 17
Step 9: Subtype: Add Subtype
This step adds a subtype code and description to the subtypes table in the feature class
properties The description reflects the feature the nine feature themes, Buildings (1),
Designated areas(2), Delimiter (3), Land Cover (4), Land Form (5), Roads or Rail (6),
Structures (7), Utility (8) and Hydrography (9).
Syntax: AddSubtype_management (in_table, subtype_code, subtype_description)
Step 10: Subtypes: Set Default Subtype
This is the final step for subtypes and will set the subtype code for the feature class as the
default value. This will be reflected in the attribute table for each feature.
Syntax: SetDefaultSubtype_management (in_table, subtype_code)
Step 11: Domains: Create Domain
This step creates domains for each feature class and sets the domain properties. The domain
description reflects the “DESC” field in description tables import earlier in the script. The
“DESC” field values are descriptions of the FEAT_CODES.
Syntax: CreateDomain_management (in_workspace, domain_name, domain_description,
field_type)
Step 12: Domain: Table to Domain
This step adds the description tables coded values, The coded values include the FEAT_CODE
and DESC fields.
Syntax: TableToDomain_management (in_table, code_field, description_field, in_workspace,
domain_name, {domain_description}, {update_option})
Figure 22: Syntax for add subtype
Figure 23: Syntax for set default subtype
Figure 25: Syntax for table to domain
Figure 24: Syntax for creating domains
GISD3000 – GIS PRACTICUM & PROJECT PLANNING 2013
Page 18
Step 13: Domain: Assign Domain To Field This final step assigns the domains field to the default values and domains for each feature
class.
Syntax: AssignDomainToField_management (in_table, field_name, domain_name,
{subtype_code})
PART 3: Creating Style & XML Files This section of the report explains the process of creating style files and XML files. It is
at this point of the project when the first submission for the project is due; this is where the
XML files will come into use.
Sty le Files
Styles are containers for reusable things that appear on maps; they are a place to store,
organize, and share symbols and other map components (ArcGIS Help 10.1). In ArcMap 10.1,
a user can create style files. These style files can be generated symbols by the user, upload
graphics, or ESRI standard symbols. ESRI ArcMap provides a library of styles that can be used
for symbolizing.
The benefits of creating your own style files will help with keeping symbols consistence
on your map, and meet the specifications for the project. National Topographic System maps
have their own cartographic specifications for the maps. Since, the purpose of this project is to
replicate NTS map sheets, it would be accurate to follow the style specifications for Halifax map
sheet. The symbology will need to be set for the map, before the user can add/save the styles.
The standards and specifications for NTS maps can be found online (look at the appendix for
web-link). The final map product follows closely to the standards but for some point & poly
features it was difficult to reproduce the symbology. Once, the symbology is set for the features,
the user can then, create the style files.
In five easy steps you can create style files that will store the symbols for your map. On
the top menu in ArcMap 10.1 click on the Customize menu, then, in pull down menu click on
Style Manager. In the style manager, click on Styles, this opens the style references dialog (see
Figure 26: Syntax for assign domain to field
GISD3000 – GIS PRACTICUM & PROJECT PLANNING 2013
Page 19
Figure 26). In the style references click Create New Style, this will let you save your style file
for all the symbology turned on in table of contents tab. When you style file is saved, you can
click Add Styles to List. This list will show up in your symbol selector window and the user
Figure 27: Style Manager Window (left). Symbol Selector Window (right), showing the newly added style files
Figure 28: Layer Properties Window where any user can import a style file and match it to the features
GISD3000 – GIS PRACTICUM & PROJECT PLANNING 2013
Page 20
can reference back to the styles found on the map (See Figure 26). Another way to utilize style
files is in the Properties -> Layer Properties window. In this window under the Categories tab -
> Match to symbols in a style file, the user can import their style file and click the Match
Symbols (see Figure 27). This will come in handy if you lose your symbology or if you want to
share the symbology (style file) with another user.
It should be noted with this data, in order to use the style files the features cannot be
group together because, the style is reading the individual FEAT_CODE and when the features
are grouped it cannot read the FEAT_CODE.
XML Files
An extensible markup language (XML) allows a user to publish and share a geodatabase
schema with other user. In ESRI software the user can export the geodatabase to a XML
document workspace file. All content of the geodatabase are held in the XML file and can be
used by external users, user without ESRI software.
The XML document workspace file is required format for the second submission for this
project.
PART 4: Creating Layers & Representations The section of the report is an overview of the layer files and representation files that
were required for the third submission.
Layer Files
Layers files act like style files by holding the symbology for the feature. Like a style file
you need to create the symbology for the feature and then save the feature as a layer. To save a
feature as a layer the user can right click on the feature and press save as a layer file. A layer
file cannot be saved in a file geodatabase; it is an outside resource and saves just the symbology,
not the data. If you lose your symbology or want to use the symbology on another layer, the
user can import the layer file. The layer file is import through Properties -> Layer Properties ->
Categories -> click import to draw categories using unique values of one field.
Figure 29: Layer Properties window, by clicking import (button to right) the user can import layer files
GISD3000 – GIS PRACTICUM & PROJECT PLANNING 2013
Page 21
Representations Layers
Representation files are another way of saving the symbology for features; however with
representation layers they are stored within the geodatabase. To save representation files right
click the feature and click convert symbology to representation. The figure below displays a
representation file, shows the store symbology and the size, which can be changed in this
screen.
PART 5: Layout & Annotation Map making is a science, skill work and design. Alongside the topography on a map are
the surrounding layout and the annotation. Layout and annotation provide a map reader with a
visual representation of location, descriptions of the features, and a cartographic design. This
portions of the report overviews the making of the layout and placement of the annotation.
Layout
The cartographic design of a map can distinguish one map from the other, shows the
creative approach of the cartographer, and provides detail of what is being mapped. The layout
includes a legend, map scale, description of the topography, disclaimers and sources.
Figure 30: Example of a representation layer window
GISD3000 – GIS PRACTICUM & PROJECT PLANNING 2013
Page 22
Figure 31: Example of annotation placement
The layout of this map corresponds to the layout of Halifax map sheet (011D12). The
design was manually created in ArcMap layout view using layout tools. The cover of the map
was created in Corel Draw X6. (see attached map).
Annotation The placement of text is critical part of map design. Annotation draws on the geographic
location of the feature. Annotation can be store in the map or in a geodatabase. Annotation in a
geodatabase is more flexible the map annotation, allowing users to share or use the annotation
group on another map. To store
annotation, the map maker creates labels
that illustrate the destination of the
feature, and then converts the label into
annotation. To manage the annotation
the user can start an edit session and edit
the text. The placement of text is critical
part of map design. The text needs to be
readable, easily distinguished, and place
correctly.
The annotation for this map uses
the NS gazetteer. The gazetteer was
saved in the NSTDB.gdb to create a feature-link annotation. Feature-link annotation associates
the text with the feature by being linked to a value field in the features attributes. A label simply
represents the feature and is not linked to anything on the map.
PART 6: Conclusion The final product is printed map replicating Halifax NTS map sheet (011D12), and a report describing the developmental procedures undertaken to create the map. The conclusion discusses errors in the development, and a reflection by the author.
Error & Handling The first step in managing a dataset is reviewing the data. The NSGS_NSTDB seamless
2013 data came with various errors ranging from unknown feature codes, to duplicated data. In
the long run, errors that go unnoticed can cause major problems with processing. By this time
errors may not be as apparent and hard to fix stopping all performance from occurring.
GISD3000 – GIS PRACTICUM & PROJECT PLANNING 2013
Page 23
To handle unknown feature codes like unknown suffix at the end of the code, user can
find the code on the NSTDB specifications website and/or search the feature attribute in
ArcMap and compare the feature location to Google Earth. The best method depends on the
user and familiarity with the area and data.
Reflection This project taught me the challenges that can be mastered, by managing your time,
keeping track of your progression, meeting deadlines, and handling data error. The time and
effort put into this project feels satisfying, and a great learning experience. My
accomplishments are placement of annotation on a small scale map, successfully replicating a
cartographic beauty, meeting deadlines and learning new skills (scripting, geodatabases, layout,
etc.). The only improvement I would consider for this map is better generalization of the map
features, especially the roads; this improvement could be fixed by spending more time cleaning
up the map. The biggest learning experience I have to say is error handling. I learnt that
duplicate data is redundant and takes up more space than necessary. This error can be fixed by
using ArcMap geoprocessing tools. One example is merging the duplicate files then deleting
duplicates, and/or query by location, then, in an edit session delete duplicates. However, it
should be noted that some errors take time to fix and may take endless hours to solve;
therefore, errors should be picked out and resolved right away; never under estimate processing
time.
GISD3000 – GIS PRACTICUM & PROJECT PLANNING 2013
Page 24
Appendix A – Python Script # # Creating a GDB # # Name: NSTDB_Geodatabase.py # # Created by: Vanessa Campbell # # October, 2013 # #GISD 3000 - GIS Practicum & Project Planning ####SETTINGS import time start = time.clock() #Operation System import os, sys #Import the Arcpy module import arcpy #Imports ArcGIS Environment Settings from arcpy import env #Set environmental settings to the current GDB env.GDB = "D:/GISD3000_GISPractium/Lab_2" print ("workplace set to: " + env.GDB) #Overwrite existing files beneficial for error handling arcpy.env.overwriteOutput = True print ("Overwrite True") print ("Settings are ready to go") # FILE GDB #Creating a FileGDB print ("Processing GDB") arcpy.CreateFileGDB_management("D:/GISD3000_GISPractium/Lab_2", "NSTDB.gdb") print ("File GDB Created") #VARIABLES FOR GDB PROCESSING #Variables for File GDB GDB = "D:/GISD3000_GISPractium/Lab_2/NSTDB.gdb" #Variables for Feature Dataset feature1 = "BL" feature2 = "DA" feature3 = "DL" feature4 = "LC" feature5 = "LF" feature6 = "RR"
GISD3000 – GIS PRACTICUM & PROJECT PLANNING 2013
Page 25
feature7 = "ST" feature8 = "UT" feature9 = "WA" #Variables for Feature Classes InBuild = ["D:/GISD3000_GISPractium/Lab_2/bl_point.shp", "D:/GISD3000_GISPractium/Lab_2/bl_poly.shp"] outLocation1 = "D:/GISD3000_GISPractium/Lab_2/NSTDB.gdb/BL" InDesignate = ["D:/GISD3000_GISPractium/Lab_2/da_poly.shp"] outLocation2 = "D:/GISD3000_GISPractium/Lab_2/NSTDB.gdb/DA" InDelimit = ["D:/GISD3000_GISPractium/Lab_2/dl_line.shp"] outLocation3 = "D:/GISD3000_GISPractium/Lab_2/NSTDB.gdb/DL" InLandC = ["D:/GISD3000_GISPractium/Lab_2/lc_point.shp", "D:/GISD3000_GISPractium/Lab_2/lc_poly.shp", "D:/GISD3000_GISPractium/Lab_2/lc_line.shp"] outLocation4 = "D:/GISD3000_GISPractium/Lab_2/NSTDB.gdb/LC" InLandF = ["D:/GISD3000_GISPractium/Lab_2/lf_break.shp", "D:/GISD3000_GISPractium/Lab_2/lf_spot.shp", "D:/GISD3000_GISPractium/Lab_2/lf_line.shp"] outLocation5 = "D:/GISD3000_GISPractium/Lab_2/NSTDB.gdb/LF" InRoad = ["D:/GISD3000_GISPractium/Lab_2/rr_line.shp", "D:/GISD3000_GISPractium/Lab_2/rr_poly.shp", "D:/GISD3000_GISPractium/Lab_2/rr_point.shp", "D:/GISD3000_GISPractium/Lab_2/nsrn_distrib.shp"] outLocation6 = "D:/GISD3000_GISPractium/Lab_2/NSTDB.gdb/RR" InStructure = ["D:/GISD3000_GISPractium/Lab_2/st_point.shp", "D:/GISD3000_GISPractium/Lab_2/st_poly.shp", "D:/GISD3000_GISPractium/Lab_2/st_line.shp"] outLocation7 = "D:/GISD3000_GISPractium/Lab_2/NSTDB.gdb/ST" InUtility = ["D:/GISD3000_GISPractium/Lab_2/ut_point.shp", "D:/GISD3000_GISPractium/Lab_2/ut_poly.shp", "D:/GISD3000_GISPractium/Lab_2/ut_line.shp"] outLocation8 = "D:/GISD3000_GISPractium/Lab_2/NSTDB.gdb/UT" InWater = ["D:/GISD3000_GISPractium/Lab_2/nshn_wa_line.shp", "D:/GISD3000_GISPractium/Lab_2/nshn_wa_poly.shp", "D:/GISD3000_GISPractium/Lab_2/nshn_wa_point.shp", "D:/GISD3000_GISPractium/Lab_2/nshn_wa_junc.shp", "D:/GISD3000_GISPractium/Lab_2/nshn_wa_cent.shp", "D:/GISD3000_GISPractium/Lab_2/nshn_lake_poly.shp"] outLocation9 = "D:/GISD3000_GISPractium/Lab_2/NSTDB.gdb/WA"
GISD3000 – GIS PRACTICUM & PROJECT PLANNING 2013
Page 26
#List of DESCRIPT tables BLDes = ["D:/GISD3000_GISPractium/Lab_2/bl_point_summary.xlsx//bl_point_summary$", "D:/GISD3000_GISPractium/Lab_2/bl_poly_summary.xlsx//bl_poly_summary$"] DADes = ["D:/GISD3000_GISPractium/Lab_2/da_poly_summary.xlsx//da_poly_summary$"] DLDes = ["D:/GISD3000_GISPractium/Lab_2/dl_line_summary.xlsx//dl_line_summary$"] LCDes = ["D:/GISD3000_GISPractium/Lab_2/lc_line_summary.xlsx//lc_line_summary$", "D:/GISD3000_GISPractium/Lab_2/LC_summary.xlsx//LC_summary$", "D:/GISD3000_GISPractium/Lab_2/lc_poly_summary.xlsx//lc_poly_summary$"] LFDes = ["D:/GISD3000_GISPractium/Lab_2/If_break_summary.xlsx//If_break_summary$", "D:/GISD3000_GISPractium/Lab_2/If_line_summary.xlsx//If_line_summary$", "D:/GISD3000_GISPractium/Lab_2/If_spot_summary.xlsx//If_spot_summary$"] WADes = ["D:/GISD3000_GISPractium/Lab_2/nshn_lake_poly_summary.xlsx//nshn_lake_poly_summary$", "D:/GISD3000_GISPractium/Lab_2/nshn_wa_cent_summary.xlsx//nshn_wa_cent_summary$", "D:/GISD3000_GISPractium/Lab_2/nshn_wa_line_summary.xlsx//nshn_wa_line_summary$", "D:/GISD3000_GISPractium/Lab_2/nshn_wa_point_summary.xlsx//nshn_wa_point_summary$", "D:/GISD3000_GISPractium/Lab_2/nshn_wa_poly_summary.xlsx//nshn_wa_poly_summary$"] NSRNDes = ["D:/GISD3000_GISPractium/Lab_2/nsrn_distrib_summary.xlsx//nsrn_distrib_summary$", "D:/GISD3000_GISPractium/Lab_2/rr_line_summary.xlsx//rr_line_summary$","D:/GISD3000_GISPractium/Lab_2/rr_point_summary.xlsx//rr_point_summary$", "D:/GISD3000_GISPractium/Lab_2/rr_poly_summary.xlsx//rr_poly_summary$"] STDes = ["D:/GISD3000_GISPractium/Lab_2/st_line_summary.xlsx//st_line_summary$", "D:/GISD3000_GISPractium/Lab_2/st_point_summary.xlsx//st_point_summary$", "D:/GISD3000_GISPractium/Lab_2/st_poly_summary.xlsx//st_poly_summary$"] UTDes = ["D:/GISD3000_GISPractium/Lab_2/ut_line_summary.xlsx//ut_line_summary$", "D:/GISD3000_GISPractium/Lab_2/ut_point_summary.xlsx//ut_point_summary$", "D:/GISD3000_GISPractium/Lab_2/ut_poly_summary.xlsx//ut_poly_summary$"] SubtypeTab = ["D:/GISD3000_GISPractium/Lab_2/Subtypes.xlsx//Sheet1$"] print ("Variables are set") #SPATIAL REFERENCE # Assign a coordinated system to GDB feature themes print ("Adding Spatial Reference") sr = arcpy.SpatialReference("D:/GISD3000_GISPractium/Lab_2/NAD 1983 CSRS UTM ZONE 20N.prj") print ("Spatial Reference is added") ####FEATURE DATASETS###### #Creating Feature Datasets #Description: Feature themes for my file geodatabase #CREATE FEATURE DATASET MANAGEMENT print ("Adding Feature Themes") try: arcpy.CreateFeatureDataset_management(GDB, feature1, sr)
GISD3000 – GIS PRACTICUM & PROJECT PLANNING 2013
Page 27
except: print ("Didn't work") arcpy.CreateFeatureDataset_management(GDB, feature2, sr) arcpy.CreateFeatureDataset_management(GDB, feature3, sr) arcpy.CreateFeatureDataset_management(GDB, feature4, sr) arcpy.CreateFeatureDataset_management(GDB, feature5, sr) arcpy.CreateFeatureDataset_management(GDB, feature6, sr) arcpy.CreateFeatureDataset_management(GDB, feature7, sr) arcpy.CreateFeatureDataset_management(GDB, feature8, sr) arcpy.CreateFeatureDataset_management(GDB, feature9, sr) print ("Feature Dataset Created") ####FEATURE CLASSES#### #Importing Feature Class into the Feature Dataset #FEATURE CLASS TO GEODATABASE CONVERSION print ("Processsing feature classes......") print ("waiting....") print ("sitting pretty.....time is ticking") arcpy.FeatureClassToGeodatabase_conversion(InBuild, outLocation1) arcpy.FeatureClassToGeodatabase_conversion(InDesignate, outLocation2) arcpy.FeatureClassToGeodatabase_conversion(InDelimit, outLocation3) arcpy.FeatureClassToGeodatabase_conversion(InLandC, outLocation4) arcpy.FeatureClassToGeodatabase_conversion(InLandF, outLocation5) arcpy.FeatureClassToGeodatabase_conversion(InRoad, outLocation6) arcpy.FeatureClassToGeodatabase_conversion(InStructure, outLocation7) arcpy.FeatureClassToGeodatabase_conversion(InUtility, outLocation8) arcpy.FeatureClassToGeodatabase_conversion(InWater, outLocation9) print ("feature classes import") ####IMPORTING DESCRIPTION TABLES##### #Converting Description Tables to database tables DBF #PROCESSING TABLE TO GEODATABASE CONVERSION print ("Creating Description Tables") try: arcpy.TableToGeodatabase_conversion (BLDes, GDB) print ("Building Table Description Table Added") except: print ("fail to execute table") try: arcpy.TableToGeodatabase_conversion (DADes, GDB) print ("Designated Areas Description Table Added") except: print ("fail to execute table") try:
GISD3000 – GIS PRACTICUM & PROJECT PLANNING 2013
Page 28
arcpy.TableToGeodatabase_conversion (DLDes, GDB) print ("Delimiter Areas Description Table Added") except: print ("fail to execute table") try: arcpy.TableToGeodatabase_conversion (LCDes, GDB) print ("Land Cover Description Table Added") except: print ("fail to execute table") try: arcpy.TableToGeodatabase_conversion (LFDes, GDB) print ("Land Form Description Table Added") except: print ("fail to execute table") try: arcpy.TableToGeodatabase_conversion (WADes, GDB) print ("Water Description Table Added") except: print ("fail to execute table") try: arcpy.TableToGeodatabase_conversion (NSRNDes, GDB) print ("Road Description Table Added") except:A print ("fail to execute table") try: arcpy.TableToGeodatabase_conversion (UTDes, GDB) print ("Utilities Description Table Added") except: print ("fail to execute table") try: arcpy.TableToGeodatabase_conversion (STDes, GDB) print ("Structures Description Table Added") except: print ("fail to execute table") try: arcpy.TableToGeodatabase_conversion (SubtypeTab, GDB) print ("Subtype table added") print ("Description Tables complete") except: print ("fail to execute table") #####SUBTYPES #FieldNames #Add New Field = Name of tool, a part of the Data Management Toolset #ADD A FIELD print ("Creating a new field called FieldName") #FieldName Variables field_prec = 1
GISD3000 – GIS PRACTICUM & PROJECT PLANNING 2013
Page 29
Sub1 = "D:/GISD3000_GISPractium/Lab_2/NSTDB.gdb/BL/bl_point" Sub2 = "D:/GISD3000_GISPractium/Lab_2/NSTDB.gdb/BL/bl_poly" Sub3 = "D:/GISD3000_GISPractium/Lab_2/NSTDB.gdb/DA/da_poly" Sub4 = "D:/GISD3000_GISPractium/Lab_2/NSTDB.gdb/DL/dl_line" Sub5 = "D:/GISD3000_GISPractium/Lab_2/NSTDB.gdb/LC/lc_line" Sub6 = "D:/GISD3000_GISPractium/Lab_2/NSTDB.gdb/LC/lc_point" Sub7 = "D:/GISD3000_GISPractium/Lab_2/NSTDB.gdb/LC/lc_poly" Sub8 = "D:/GISD3000_GISPractium/Lab_2/NSTDB.gdb/LF/lf_break" Sub9 = "D:/GISD3000_GISPractium/Lab_2/NSTDB.gdb/LF/lf_line" Sub10 = "D:/GISD3000_GISPractium/Lab_2/NSTDB.gdb/LF/lf_spot" Sub11 = "D:/GISD3000_GISPractium/Lab_2/NSTDB.gdb/RR/nsrn_distrib" Sub12 = "D:/GISD3000_GISPractium/Lab_2/NSTDB.gdb/RR/rr_line" Sub13 = "D:/GISD3000_GISPractium/Lab_2/NSTDB.gdb/RR/rr_point" Sub14 = "D:/GISD3000_GISPractium/Lab_2/NSTDB.gdb/RR/rr_poly" Sub15 = "D:/GISD3000_GISPractium/Lab_2/NSTDB.gdb/ST/st_line" Sub16 = "D:/GISD3000_GISPractium/Lab_2/NSTDB.gdb/ST/st_point" Sub17 = "D:/GISD3000_GISPractium/Lab_2/NSTDB.gdb/ST/st_poly" Sub18 = "D:/GISD3000_GISPractium/Lab_2/NSTDB.gdb/UT/ut_line" Sub19 = "D:/GISD3000_GISPractium/Lab_2/NSTDB.gdb/UT/ut_point" Sub20 = "D:/GISD3000_GISPractium/Lab_2/NSTDB.gdb/UT/ut_poly" Sub21 = "D:/GISD3000_GISPractium/Lab_2/NSTDB.gdb/WA/nshn_lake_poly" Sub22 = "D:/GISD3000_GISPractium/Lab_2/NSTDB.gdb/WA/nshn_wa_cent" Sub23 = "D:/GISD3000_GISPractium/Lab_2/NSTDB.gdb/WA/nshn_wa_line" Sub24 = "D:/GISD3000_GISPractium/Lab_2/NSTDB.gdb/WA/nshn_wa_point" Sub25 = "D:/GISD3000_GISPractium/Lab_2/NSTDB.gdb/WA/nshn_wa_poly" try: arcpy.AddField_management (Sub1, "Subtype", "LONG", field_prec, "", "", "", "NULLABLE") print ("Field Added") except: print ("Flop") try: arcpy.AddField_management (Sub2, "Subtype", "LONG", field_prec) print ("Success") except: print ("Failure :(") arcpy.AddField_management (Sub3, "Subtype", "LONG", field_prec) arcpy.AddField_management (Sub4, "Subtype", "LONG", field_prec) arcpy.AddField_management (Sub5, "Subtype", "LONG", field_prec) arcpy.AddField_management (Sub6, "Subtype", "LONG", field_prec) arcpy.AddField_management (Sub7, "Subtype", "LONG", field_prec) arcpy.AddField_management (Sub8, "Subtype", "LONG", field_prec) arcpy.AddField_management (Sub9, "Subtype", "LONG", field_prec) arcpy.AddField_management (Sub10, "Subtype", "LONG", field_prec) arcpy.AddField_management (Sub11, "Subtype", "LONG", field_prec) arcpy.AddField_management (Sub12, "Subtype", "LONG", field_prec) arcpy.AddField_management (Sub13, "Subtype", "LONG", field_prec)
GISD3000 – GIS PRACTICUM & PROJECT PLANNING 2013
Page 30
arcpy.AddField_management (Sub14, "Subtype", "LONG", field_prec) arcpy.AddField_management (Sub15, "Subtype", "LONG", field_prec) arcpy.AddField_management (Sub16, "Subtype", "LONG", field_prec) arcpy.AddField_management (Sub17, "Subtype", "LONG", field_prec) arcpy.AddField_management (Sub18, "Subtype", "LONG", field_prec) arcpy.AddField_management (Sub19, "Subtype", "LONG", field_prec) arcpy.AddField_management (Sub20, "Subtype", "LONG", field_prec) arcpy.AddField_management (Sub21, "Subtype", "LONG", field_prec) arcpy.AddField_management (Sub22, "Subtype", "LONG", field_prec) arcpy.AddField_management (Sub23, "Subtype", "LONG", field_prec) arcpy.AddField_management (Sub24, "Subtype", "LONG", field_prec) arcpy.AddField_management (Sub25, "Subtype", "LONG", field_prec) print ("Add Field Complete") #####CALCULATE FIELD MANAGEMENT###### # Applies a Value (1-9) to the new SUBTYPE field (FieldName) print ("Calculating FieldName field") #Variables FieldName = "Subtype" try: arcpy.CalculateField_management (Sub1, FieldName, "1", "VB") arcpy.CalculateField_management (Sub2, FieldName, "1", "VB") arcpy.CalculateField_management (Sub3, FieldName, "2", "VB") arcpy.CalculateField_management (Sub4, FieldName, "3", "VB") arcpy.CalculateField_management (Sub5, FieldName, "4", "VB") arcpy.CalculateField_management (Sub6, FieldName, "4", "VB") arcpy.CalculateField_management (Sub7, FieldName, "4", "VB") arcpy.CalculateField_management (Sub8, FieldName, "5", "VB") arcpy.CalculateField_management (Sub9, FieldName, "5", "VB") arcpy.CalculateField_management (Sub10, FieldName, "5", "VB") arcpy.CalculateField_management (Sub11, FieldName, "6", "VB") arcpy.CalculateField_management (Sub12, FieldName, "6", "VB") arcpy.CalculateField_management (Sub13, FieldName, "6", "VB") arcpy.CalculateField_management (Sub14, FieldName, "6", "VB") arcpy.CalculateField_management (Sub15, FieldName, "7", "VB") arcpy.CalculateField_management (Sub16, FieldName, "7", "VB") arcpy.CalculateField_management (Sub17, FieldName, "7", "VB") arcpy.CalculateField_management (Sub18, FieldName, "8", "VB") arcpy.CalculateField_management (Sub19, FieldName, "8", "VB") arcpy.CalculateField_management (Sub20, FieldName, "8", "VB") arcpy.CalculateField_management (Sub21, FieldName, "9", "VB") arcpy.CalculateField_management (Sub22, FieldName, "9", "VB") arcpy.CalculateField_management (Sub23, FieldName, "9", "VB") arcpy.CalculateField_management (Sub24, FieldName, "9", "VB") arcpy.CalculateField_management (Sub25, FieldName, "9", "VB") print ("Calculation complete") except:
GISD3000 – GIS PRACTICUM & PROJECT PLANNING 2013
Page 31
print ("Check CalculateField Syntax") ###### SET FIELD NAME FIELD MANAGEMENT##### # # Apply a field name to the input feature # print ("Process: Set FieldName Field...") try: arcpy.SetSubtypeField_management(Sub1, FieldName) arcpy.SetSubtypeField_management(Sub2, FieldName) arcpy.SetSubtypeField_management(Sub3, FieldName) arcpy.SetSubtypeField_management(Sub4, FieldName) arcpy.SetSubtypeField_management(Sub5, FieldName) arcpy.SetSubtypeField_management(Sub6, FieldName) arcpy.SetSubtypeField_management(Sub7, FieldName) arcpy.SetSubtypeField_management(Sub8, FieldName) arcpy.SetSubtypeField_management(Sub9, FieldName) arcpy.SetSubtypeField_management(Sub10, FieldName) arcpy.SetSubtypeField_management(Sub11, FieldName) arcpy.SetSubtypeField_management(Sub12, FieldName) arcpy.SetSubtypeField_management(Sub13, FieldName) arcpy.SetSubtypeField_management(Sub14, FieldName) arcpy.SetSubtypeField_management(Sub15, FieldName) arcpy.SetSubtypeField_management(Sub16, FieldName) arcpy.SetSubtypeField_management(Sub17, FieldName) arcpy.SetSubtypeField_management(Sub18, FieldName) arcpy.SetSubtypeField_management(Sub19, FieldName) arcpy.SetSubtypeField_management(Sub20, FieldName) arcpy.SetSubtypeField_management(Sub21, FieldName) arcpy.SetSubtypeField_management(Sub22, FieldName) arcpy.SetSubtypeField_management(Sub23, FieldName) arcpy.SetSubtypeField_management(Sub24, FieldName) arcpy.SetSubtypeField_management(Sub25, FieldName) print ("FieldName Set....time to add values") except: print ("Rethink this one") #####ADD FIELD NAME MANAGEMENT#### #Add subtype unique integer and field name print ("Adding FieldNames") try: arcpy.AddSubtype_management(Sub1, "1", "Building") arcpy.AddSubtype_management(Sub2, "1", "Building") arcpy.AddSubtype_management(Sub3, "2", "Designated Area") arcpy.AddSubtype_management(Sub4, "3", "Delimiter Line") arcpy.AddSubtype_management(Sub5, "4", "Land Cover") arcpy.AddSubtype_management(Sub6, "4", "Land Cover") arcpy.AddSubtype_management(Sub7, "4", "Land Cover") arcpy.AddSubtype_management(Sub8, "5", "Land Form")
GISD3000 – GIS PRACTICUM & PROJECT PLANNING 2013
Page 32
arcpy.AddSubtype_management(Sub9, "5", "Land Form") arcpy.AddSubtype_management(Sub10, "5", "Land Form") arcpy.AddSubtype_management(Sub11, "6", "Road or Rail") arcpy.AddSubtype_management(Sub12, "6", "Road or Rail") arcpy.AddSubtype_management(Sub13, "6", "Road or Rail") arcpy.AddSubtype_management(Sub14, "6", "Road or Rail") arcpy.AddSubtype_management(Sub15, "7", "Structures") arcpy.AddSubtype_management(Sub16, "7", "Structures") arcpy.AddSubtype_management(Sub17, "7", "Structures") arcpy.AddSubtype_management(Sub18, "8", "Utility") arcpy.AddSubtype_management(Sub19, "8", "Utility") arcpy.AddSubtype_management(Sub20, "8", "Utility") arcpy.AddSubtype_management(Sub21, "9", "Hydrography") arcpy.AddSubtype_management(Sub22, "9", "Hydrography") arcpy.AddSubtype_management(Sub23, "9", "Hydrography") arcpy.AddSubtype_management(Sub24, "9", "Hydrography") arcpy.AddSubtype_management(Sub25, "9", "Hydrography") print ("FieldNames added") except: print ("Check Syntax") #### SET DEFAULT SUBTYPE #Assigning unique integer to subtype default print ("Setting Default FieldNames") try: arcpy.SetDefaultSubtype_management(Sub1, "1") print ("Default Build added") except: print ("Check Syntax") try: arcpy.SetDefaultSubtype_management(Sub2, "1") print ("Default Build added") except: print ("Check Syntax") try: arcpy.SetDefaultSubtype_management(Sub3, "2") print ("Default DA added") except: print ("Check Syntax") try: arcpy.SetDefaultSubtype_management(Sub4, "3") print ("Default DL added") except: print ("Check Syntax") try: arcpy.SetDefaultSubtype_management(Sub5, "4") print ("Default LC added") except:
GISD3000 – GIS PRACTICUM & PROJECT PLANNING 2013
Page 33
print ("Check Syntax") try: arcpy.SetDefaultSubtype_management(Sub6, "4") print ("Default LC added") except: print ("Check Syntax") try: arcpy.SetDefaultSubtype_management(Sub7, "4") print ("Default LC added") except: print ("Check Syntax") try: arcpy.SetDefaultSubtype_management(Sub8, "5") print ("Default LF added") except: print ("Check Syntax") try: arcpy.SetDefaultSubtype_management(Sub9, "5") print ("Default LF added") except: print ("Check Syntax") try: arcpy.SetDefaultSubtype_management(Sub10, "5") print ("Default LF added") except: print ("Check Syntax") try: arcpy.SetDefaultSubtype_management(Sub11, "6") print ("Default RR added") except: print ("Check Syntax") try: arcpy.SetDefaultSubtype_management(Sub12, "6") print ("Default RR added") except: print ("Check Syntax") try: arcpy.SetDefaultSubtype_management(Sub13, "6") print ("Default RR added") except: print ("Check Syntax") try: arcpy.SetDefaultSubtype_management(Sub14, "6") print ("Default RR added") except: print ("Check Syntax") try: arcpy.SetDefaultSubtype_management(Sub15, "7") print ("Default ST added")
GISD3000 – GIS PRACTICUM & PROJECT PLANNING 2013
Page 34
except: print ("Check Syntax") try: arcpy.SetDefaultSubtype_management(Sub16, "7") print ("Default ST added") except: print ("Check Syntax") try: arcpy.SetDefaultSubtype_management(Sub17, "7") print ("Default ST added") except: print ("Check Syntax") try: arcpy.SetDefaultSubtype_management(Sub18, "8") print ("Default UT added") except: print ("Check Syntax") try: arcpy.SetDefaultSubtype_management(Sub19, "8") print ("Default UT added") except: print ("Check Syntax") try: arcpy.SetDefaultSubtype_management(Sub20, "8") print ("Default UT added") except: print ("Check Syntax") try: arcpy.SetDefaultSubtype_management(Sub21, "9") print ("Default WA added") except: print ("Check Syntax") try: arcpy.SetDefaultSubtype_management(Sub22, "9") print ("Default WA added") except: print ("Check Syntax") try: arcpy.SetDefaultSubtype_management(Sub23, "9") print ("Default WA added") except: print ("Check WA Syntax") try: arcpy.SetDefaultSubtype_management(Sub24, "9") print ("Default WA added") except: print ("Check Syntax") try: arcpy.SetDefaultSubtype_management(Sub25, "9")
GISD3000 – GIS PRACTICUM & PROJECT PLANNING 2013
Page 35
print ("Default WA added") print ("Default Subtype Set") except: print ("Check Syntax") #DOMAINS #This will help with symbolizing, giving a description to the feature codes (FEAT_CODE) #CREATE DOMAIN MANAGEMENT print ("Domains are being created") #Variables for Domain Name and Field Name dom1 = "bl_point" dom2 = "bl_poly" dom3 = "da_poly" dom4 = "dl_line" dom5 = "lf_break" dom6 = "lf_line" dom7 = "lf_spot" dom8 = "lc_line" dom9 = "lc_point" dom10 = "lc_poly" dom11 = "nshn_wa_line" dom12 = "nshn_wa_poly" dom13 = "nshn_wa_point" dom14 = "nshn_wa_cent" dom15 = "nsrn_distrib" dom16 = "rr_point" dom17 = "rr_line" dom18 = "rr_poly" dom19 = "st_poly" dom20 = "st_point" dom21 = "st_line" dom22 = "ut_line" dom23 = "ut_point" dom24 = "ut_poly" dom25 = "nshn_lake_poly" arcpy.CreateDomain_management (GDB, dom1, "DESC", "TEXT", "CODED") arcpy.CreateDomain_management (GDB, dom2, "DESC", "TEXT", "CODED") arcpy.CreateDomain_management (GDB, dom3, "DESC", "TEXT", "CODED") arcpy.CreateDomain_management (GDB, dom4, "DESC", "TEXT", "CODED") arcpy.CreateDomain_management (GDB, dom5, "DESC", "TEXT", "CODED") arcpy.CreateDomain_management (GDB, dom6, "DESC", "TEXT", "CODED") arcpy.CreateDomain_management (GDB, dom7, "DESC", "TEXT", "CODED") arcpy.CreateDomain_management (GDB, dom8, "DESC", "TEXT", "CODED") arcpy.CreateDomain_management (GDB, dom9, "DESC", "TEXT", "CODED") arcpy.CreateDomain_management (GDB, dom10, "DESC", "TEXT", "CODED") arcpy.CreateDomain_management (GDB, dom11, "DESC", "TEXT", "CODED") arcpy.CreateDomain_management (GDB, dom12, "DESC", "TEXT", "CODED")
GISD3000 – GIS PRACTICUM & PROJECT PLANNING 2013
Page 36
arcpy.CreateDomain_management (GDB, dom13, "DESC", "TEXT", "CODED") arcpy.CreateDomain_management (GDB, dom14, "DESC", "TEXT", "CODED") arcpy.CreateDomain_management (GDB, dom15, "DESC", "TEXT", "CODED") arcpy.CreateDomain_management (GDB, dom16, "DESC", "TEXT", "CODED") arcpy.CreateDomain_management (GDB, dom17, "DESC", "TEXT", "CODED") arcpy.CreateDomain_management (GDB, dom18, "DESC", "TEXT", "CODED") arcpy.CreateDomain_management (GDB, dom19, "DESC", "TEXT", "CODED") arcpy.CreateDomain_management (GDB, dom20, "DESC", "TEXT", "CODED") arcpy.CreateDomain_management (GDB, dom21, "DESC", "TEXT", "CODED") arcpy.CreateDomain_management (GDB, dom22, "DESC", "TEXT", "CODED") arcpy.CreateDomain_management (GDB, dom23, "DESC", "TEXT", "CODED") arcpy.CreateDomain_management (GDB, dom24, "DESC", "TEXT", "CODED") arcpy.CreateDomain_management (GDB, dom25, "DESC", "TEXT", "CODED") print ("Domains Created") ####TABLE TO DOMAIN MANAGEMENT##### #Variables for table to domain Table1 = "D:/GISD3000_GISPractium/Lab_2/bl_point_summary.xlsx/bl_point_summary$" Table2 = "D:/GISD3000_GISPractium/Lab_2/bl_poly_summary.xlsx/bl_poly_summary$" Table3 = "D:/GISD3000_GISPractium/Lab_2/da_poly_summary.xlsx/da_poly_summary$" Table4 = "D:/GISD3000_GISPractium/Lab_2/dl_line_summary.xlsx/dl_line_summary$" Table5 = "D:/GISD3000_GISPractium/Lab_2/If_break_summary.xlsx/If_break_summary$" Table6 = "D:/GISD3000_GISPractium/Lab_2/If_line_summary.xlsx/If_line_summary$" Table7 = "D:/GISD3000_GISPractium/Lab_2/If_spot_summary.xlsx/If_spot_summary$" Table8 = "D:/GISD3000_GISPractium/Lab_2/lc_line_summary.xlsx/lc_line_summary$" Table9 = "D:/GISD3000_GISPractium/Lab_2/LC_summary.xlsx/LC_summary$" Table10 = "D:/GISD3000_GISPractium/Lab_2/lc_poly_summary.xlsx/lc_poly_summary$" Table11 = "D:/GISD3000_GISPractium/Lab_2/nshn_wa_line_summary.xlsx/nshn_wa_line_summary$" Table12 = "D:/GISD3000_GISPractium/Lab_2/nshn_wa_poly_summary.xlsx/nshn_wa_poly_summary$" Table13 = "D:/GISD3000_GISPractium/Lab_2/nshn_wa_point_summary.xlsx/nshn_wa_point_summary$" Table14 = "D:/GISD3000_GISPractium/Lab_2/nshn_wa_cent_summary.xlsx/nshn_wa_cent_summary$" Table15 = "D:/GISD3000_GISPractium/Lab_2/nsrn_distrib_summary.xlsx/nsrn_distrib_summary$" Table16 = "D:/GISD3000_GISPractium/Lab_2/rr_point_summary.xlsx/rr_point_summary$" Table17 = "D:/GISD3000_GISPractium/Lab_2/rr_line_summary.xlsx/rr_line_summary$" Table18 = "D:/GISD3000_GISPractium/Lab_2/rr_poly_summary.xlsx/rr_poly_summary$" Table19 = "D:/GISD3000_GISPractium/Lab_2/st_poly_summary.xlsx/st_poly_summary$" Table20 = "D:/GISD3000_GISPractium/Lab_2/st_point_summary.xlsx/st_point_summary$" Table21 = "D:/GISD3000_GISPractium/Lab_2/st_line_summary.xlsx/st_line_summary$" Table22 = "D:/GISD3000_GISPractium/Lab_2/ut_line_summary.xlsx/ut_line_summary$" Table23 = "D:/GISD3000_GISPractium/Lab_2/ut_point_summary.xlsx/ut_point_summary$" Table24 = "D:/GISD3000_GISPractium/Lab_2/ut_poly_summary.xlsx/ut_poly_summary$"
GISD3000 – GIS PRACTICUM & PROJECT PLANNING 2013
Page 37
Table25 = "D:/GISD3000_GISPractium/Lab_2/nshn_lake_poly_summary.xlsx/nshn_lake_poly_summary$" try: arcpy.TableToDomain_management (Table1, "FEAT_CODE", "DESC", GDB, dom1) print ("Table BL Added to Domain") except: print ("fail") try: arcpy.TableToDomain_management (Table2, "FEAT_CODE", "DESC", GDB, dom2) print ("Table BL Added to Domain") except: print ("fail") try: arcpy.TableToDomain_management (Table3, "FEAT_CODE", "DESC", GDB, dom3) print ("Table DA Added to Domain") except: print ("fail") try: arcpy.TableToDomain_management (Table4, "FEAT_CODE", "DESC", GDB, dom4) print ("Table DL Added to Domain") except: print ("fail") try: arcpy.TableToDomain_management (Table5, "FEAT_CODE", "DESC", GDB, dom5) print ("Table LF Added to Domain") except: print ("fail") try: arcpy.TableToDomain_management (Table6, "FEAT_CODE", "DESC", GDB, dom6) print ("Table LF Added to Domain") except: print ("fail") try: arcpy.TableToDomain_management (Table7, "FEAT_CODE", "DESC", GDB, dom7) print ("Table LF Added to Domain") except: print ("fail") try: arcpy.TableToDomain_management (Table8, "FEAT_CODE", "DESC", GDB, dom8) print ("Table LC Added to Domain") except: print ("fail") try: arcpy.TableToDomain_management (Table9, "FEAT_CODE", "DESC", GDB, dom9) print ("Table LC Added to Domain") except: print ("fail")
GISD3000 – GIS PRACTICUM & PROJECT PLANNING 2013
Page 38
try: arcpy.TableToDomain_management (Table10, "FEAT_CODE", "DESC", GDB, dom10) print ("Table Added to Domain") except: print ("fail") try: arcpy.TableToDomain_management (Table11, "FEAT_CODE", "DESC", GDB, dom11) print ("Table Added to Domain") except: print ("fail") try: arcpy.TableToDomain_management (Table12, "FEAT_CODE", "DESC", GDB, dom12) print ("Table Added to Domain") except: print ("fail") try: arcpy.TableToDomain_management (Table13, "FEAT_CODE", "DESC", GDB, dom13) print ("Table Added to Domain") except: print ("fail") try: arcpy.TableToDomain_management (Table14, "FEAT_CODE", "DESC", GDB, dom14) print ("Table Added to Domain") except: print ("fail") try: arcpy.TableToDomain_management (Table15, "FEAT_CODE", "DESC", GDB, dom15) print ("Table Added to Domain") except: print ("fail") try: arcpy.TableToDomain_management (Table16, "FEAT_CODE", "DESC", GDB, dom16) print ("Table Added to Domain") except: print ("fail") try: arcpy.TableToDomain_management (Table17, "FEAT_CODE", "DESC", GDB, dom17) print ("Table Added to Domain") except: print ("fail") try: arcpy.TableToDomain_management (Table18, "FEAT_CODE", "DESC", GDB, dom18) print ("Table Added to Domain") except: print ("fail") try: arcpy.TableToDomain_management (Table19, "FEAT_CODE", "DESC", GDB, dom19) print ("Table Added to Domain") except:
GISD3000 – GIS PRACTICUM & PROJECT PLANNING 2013
Page 39
print ("fail") try: arcpy.TableToDomain_management (Table20, "FEAT_CODE", "DESC", GDB, dom20) print ("Table Added to Domain") except: print ("fail") try: arcpy.TableToDomain_management (Table21, "FEAT_CODE", "DESC", GDB, dom21) print ("Table Added to Domain") except: print ("fail") try: arcpy.TableToDomain_management (Table22, "FEAT_CODE", "DESC", GDB, dom22) print ("Table Added to Domain") except: print ("fail") try: arcpy.TableToDomain_management (Table23, "FEAT_CODE", "DESC", GDB, dom23) print ("Table Added to Domain") except: print ("fail") try: arcpy.TableToDomain_management (Table24, "FEAT_CODE", "DESC", GDB, dom24) print ("Table Added to Domain") except: print ("fail") try: arcpy.TableToDomain_management (Table25, "FEAT_CODE", "DESC", GDB, dom25) print ("Table Added to Domain") except: print ("fail") print ("Domains Assigned to Feature Classes") ########## ASSIGN DOMAIN print ("Assigning domain to feature class field") #Variables field_name = "FEAT_CODE" bl_point = "D:/GISD3000_GISPractium/Lab_2/NSTDB.gdb/BL/bl_point" bl_poly = "D:/GISD3000_GISPractium/Lab_2/NSTDB.gdb/BL/bl_poly" da_poly = "D:/GISD3000_GISPractium/Lab_2/NSTDB.gdb/DA/da_poly" dl_line = "D:/GISD3000_GISPractium/Lab_2/NSTDB.gdb/DL/dl_line" lf_break = "D:/GISD3000_GISPractium/Lab_2/NSTDB.gdb/LF/lf_break" lf_line = "D:/GISD3000_GISPractium/Lab_2/NSTDB.gdb/LF/lf_line" lf_spot = "D:/GISD3000_GISPractium/Lab_2/NSTDB.gdb/LF/lf_spot" lc_line = "D:/GISD3000_GISPractium/Lab_2/NSTDB.gdb/LC/lc_line" lc_point = "D:/GISD3000_GISPractium/Lab_2/NSTDB.gdb/LC/lc_point" lc_poly = "D:/GISD3000_GISPractium/Lab_2/NSTDB.gdb/LC/lc_poly" nsrn_distrib = "D:/GISD3000_GISPractium/Lab_2/NSTDB.gdb/RR/nsrn_distrib" rr_line = "D:/GISD3000_GISPractium/Lab_2/NSTDB.gdb/RR/rr_line"
GISD3000 – GIS PRACTICUM & PROJECT PLANNING 2013
Page 40
rr_point ="D:/GISD3000_GISPractium/Lab_2/NSTDB.gdb/RR/rr_point" rr_poly = "D:/GISD3000_GISPractium/Lab_2/NSTDB.gdb/RR/rr_poly" st_line = "D:/GISD3000_GISPractium/Lab_2/NSTDB.gdb/ST/st_line" st_point = "D:/GISD3000_GISPractium/Lab_2/NSTDB.gdb/ST/st_point" st_poly = "D:/GISD3000_GISPractium/Lab_2/NSTDB.gdb/ST/st_poly" ut_line = "D:/GISD3000_GISPractium/Lab_2/NSTDB.gdb/UT/ut_line" ut_point = "D:/GISD3000_GISPractium/Lab_2/NSTDB.gdb/UT/ut_point" ut_poly = "D:/GISD3000_GISPractium/Lab_2/NSTDB.gdb/UT/ut_poly" nshn_lake = "D:/GISD3000_GISPractium/Lab_2/NSTDB.gdb/WA/nshn_lake_poly" nshn_cent = "D:/GISD3000_GISPractium/Lab_2/NSTDB.gdb/WA/nshn_wa_cent" wa_line = "D:/GISD3000_GISPractium/Lab_2/NSTDB.gdb/WA/nshn_wa_line" wa_point = "D:/GISD3000_GISPractium/Lab_2/NSTDB.gdb/WA/nshn_wa_point" wa_poly = "D:/GISD3000_GISPractium/Lab_2/NSTDB.gdb/WA/nshn_wa_poly" try: arcpy.AssignDomainToField_management (bl_point, field_name, dom1) arcpy.AssignDomainToField_management (bl_poly, field_name, dom2) arcpy.AssignDomainToField_management (da_poly, field_name, dom3) arcpy.AssignDomainToField_management (dl_line, field_name, dom4) arcpy.AssignDomainToField_management (lf_break, field_name, dom5) arcpy.AssignDomainToField_management (lf_line, field_name, dom6) arcpy.AssignDomainToField_management (lf_spot, field_name, dom7) arcpy.AssignDomainToField_management (lc_line, field_name, dom8) arcpy.AssignDomainToField_management (lc_point, field_name, dom9) arcpy.AssignDomainToField_management (lc_poly, field_name, dom10) arcpy.AssignDomainToField_management (wa_line, field_name, dom11) arcpy.AssignDomainToField_management (wa_point, field_name, dom12) arcpy.AssignDomainToField_management (wa_poly, field_name, dom13) arcpy.AssignDomainToField_management (nshn_cent, field_name, dom14) arcpy.AssignDomainToField_management (nsrn_distrib, field_name, dom15) arcpy.AssignDomainToField_management (rr_point, field_name, dom16) arcpy.AssignDomainToField_management (rr_line, field_name, dom17) arcpy.AssignDomainToField_management (rr_poly, field_name, dom18) arcpy.AssignDomainToField_management (st_poly, field_name, dom19) arcpy.AssignDomainToField_management (st_point, field_name, dom20) arcpy.AssignDomainToField_management (st_line, field_name, dom21) arcpy.AssignDomainToField_management (ut_line, field_name, dom22) arcpy.AssignDomainToField_management (ut_point, field_name, dom23) arcpy.AssignDomainToField_management (ut_poly, field_name, dom24) arcpy.AssignDomainToField_management (nshn_cent, field_name, dom25) print ("Success") except: print ("Try Again...Check Tool's syntax") del arcpy print “Script Complete” end = time.clock() print "%.2gs" % (end-start)
GISD3000 – GIS PRACTICUM & PROJECT PLANNING 2013
Page 41
Appendix B – Project Management Table See Attachment
GISD3000 – GIS PRACTICUM & PROJECT PLANNING 2013
Page 42
Sources "Help." ArcGIS Resource Center. N.p., n.d. Web. 13 Dec. 2013.
<http://resources.arcgis.com/en/help/>.