- Programming ArcGIS 10.1 with Python Cookbook
- Eric Pimpler
- 273字
- 2021-07-30 17:29:51
Conventions
In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.
Code words in text are shown as follows: " we have loaded the ListFeatureClasses.py
script with IDLE."
A block of code is set as follows:
import arcpy fc = "c:/ArcpyBook/data/TravisCounty/TravisCounty.shp" # Fetch each feature from the cursor and examine the extent properties and spatial reference for row in arcpy.da.SearchCursor(fc, ["SHAPE@"]): # get the extent of the county boundary ext = row[0].extent # print out the bounding coordinates and spatial reference print "XMin: " + ext.XMin print "XMax: " + ext.XMax print "YMin: " + ext.YMin print "YMax: " + ext.YMax print "Spatial Reference: " + ext.spatialReference.name
When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:
import arcpy
fc = "c:/data/city.gdb/streets"
# For each row print the Object ID field, and use the SHAPE@AREA
# token to access geometry properties
with arcpy.da.SearchCursor(fc, ("OID@", "SHAPE@AREA")) as cursor:
for row in cursor:
print("Feature {0} has an area of {1}".format(row[0], row[1]))
Any command-line input or output is written as follows:
[<map layer u'City of Austin Bldg Permits'>, <map layer u'Hospitals'>, <map layer u'Schools'>, <map layer u'Streams'>, <map layer u'Streets'>, <map layer u'Streams_Buff'>, <map layer u'Floodplains'>, <map layer u'2000 Census Tracts'>, <map layer u'City Limits'>, <map layer u'Travis County'>]
New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "go to Start | Programs | ArcGIS | Python 2.7 | IDLE".
推薦閱讀
- Advanced Quantitative Finance with C++
- 微服務(wù)設(shè)計(jì)原理與架構(gòu)
- Mastering PHP Design Patterns
- Building a Recommendation Engine with Scala
- 劍指大數(shù)據(jù):企業(yè)級(jí)數(shù)據(jù)倉(cāng)庫(kù)項(xiàng)目實(shí)戰(zhàn)(在線教育版)
- Statistical Application Development with R and Python(Second Edition)
- HoloLens與混合現(xiàn)實(shí)開(kāi)發(fā)
- Visual Studio Code 權(quán)威指南
- 零基礎(chǔ)學(xué)C語(yǔ)言程序設(shè)計(jì)
- R語(yǔ)言:邁向大數(shù)據(jù)之路(加強(qiáng)版)
- HTML+CSS+JavaScript網(wǎng)頁(yè)制作:從入門到精通(第4版)
- Mastering Unreal Engine 4.X
- UI動(dòng)效設(shè)計(jì)從入門到精通
- Joomla!Search Engine Optimization
- Getting Started with hapi.js