-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path20151020_H27_House.py
More file actions
49 lines (33 loc) · 1.43 KB
/
20151020_H27_House.py
File metadata and controls
49 lines (33 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#! C:/Python27/ArcGIS10.3/python.exe
# -*- coding: shift-jis -*-
import arcpy
from arcpy import env
env.workspace = r"D:\IITATE\IITATE_Phase1"
path_name = "20"
Project_mxd = env.workspace + '\\' + 'H27_House_Measure.mxd'
mxd = arcpy.mapping.MapDocument(Project_mxd)
df = arcpy.mapping.ListDataFrames(mxd, wildcard=None)[0]
##Point_station_lyr = arcpy.mapping.ListLayers(mxd,"STATIONNO", df)[0]
field_name = "CODE"
select_name = "House_ŠÇ—"
# Point_station_lyr.visible = True
##target_lyr = arcpy.mapping.ListLayers(mxd,"HOUSE_target", df)[0]
##building_lyr = arcpy.mapping.ListLayers(mxd,"Building_target", df)[0]
##target_lyr.visible = True
##building_lyr.visible = True
for pageNum in range(1,mxd.dataDrivenPages.pageCount + 1):
mxd.dataDrivenPages.currentPageID = pageNum
pageID = mxd.dataDrivenPages.getPageIDFromName("ŠÇ—”Ô†")
row = mxd.dataDrivenPages.pageRow
target_grid = row.getValue(select_name)
target_house = row.getValue(field_name)
print ' %d, %s' %(pageNum, target_grid)
## arcpy.SelectLayerByAttribute_management(Point_station_lyr,
## "NEW_SELECTION", 'select_name =' + "'" + row.getValue(field_name) + "'")
## if target_house == 'NB057':
arcpy.mapping.ExportToJPEG(mxd,
env.workspace + '\\' +"EXPORTJPEG\HOUSE\\" + path_name +
"\\"+ target_house + '_' + target_grid ,
resolution=180,
world_file=False)
del mxd