ArcPy Tutorial Code

ArcPy is a programming language used in conjunction with ESRI ArcGIS Desktop. Python is a new programming language for me. The boss suggested i get familiar with Python as it is essential for the GIS stack.

As i understand we use Python for a number of automated procedures on the server stack. Python scripts push data from the corporate geodatabase to shapefiles. Then from the shapefiles they are loaded into the nightly build for our IntraMaps map portal.

Scripts also push data from the property and rating database to SQL tables, which are then joined with the shapefiles for things such as property search and other spatial queries. This is why any changes we make during the day, are not immediately reflected in the current build of IntraMaps, because there are a few hundred scripts that need to run overnight to rebuild the cache on the server.

Below are some Python snippets from a stupidly basic tutorial this morning. All i've been able to do is set a workspace and create a file geodatabase that would have otherwise taken 10 seconds to do clicking on the toolboxes in ESRI ArcMaps.

The tutorial is more about becoming familiar with Python syntax and structure.

#set a workspace
arcpy.env.workspace = "C:/Users/gwong/Desktop/George/GIS/Projects/2018"

#create new file gdb
arcpy.CreateFileGDB_management
	(
		out_folder_path="C:/Users/gwong/Desktop/George/GIS/Projects/2018", 
		out_name="test_db", 
		out_version="CURRENT"
	)							
								

Should remind myself to grab an ArcPy book from an ebook depository tonight. The one below is recommended for ArcGIS 10.3+

Programming ArcGIS with Python Cookbook (2nd Edition) Eric Pimpler 2015

Also had some fun with html code on this page. I honestly don't use the full range of options available to my website template.




2018, journal