-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathH24_030_1cm_export.py
More file actions
56 lines (37 loc) · 1.79 KB
/
H24_030_1cm_export.py
File metadata and controls
56 lines (37 loc) · 1.79 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
48
49
50
51
52
#! C:/Python27/ArcGIS10.1/python.exe
# -*- coding: shift-jis -*-
import arcpy
from arcpy import env
env.workspace = r"D:\IITATE\IITATE_Phase1"
Project_mxd = env.workspace + '\\' + 'H24_30_AM_1cm.mxd'
path_name = "30"
mxd = arcpy.mapping.MapDocument(Project_mxd)
df = arcpy.mapping.ListDataFrames(mxd, wildcard=None)[0]
field_name = "GRID_NAME"
Select_Grid_shp = r"D:\IITATE\IITATE_Phase1\Shape\Point_shape\survey_point.shp"
Point_1cm_lyr = arcpy.mapping.ListLayers(mxd,"Point_1cm", df)[0]
Point_1cm_lyr.visible = True
for pageNum in range(1,mxd.dataDrivenPages.pageCount + 1):
mxd.dataDrivenPages.currentPageID = pageNum
pageID = mxd.dataDrivenPages.getPageIDFromName("GRID_NAME")
print(pageNum)
row = mxd.dataDrivenPages.pageRow
target_grid = row.getValue(field_name)
Point_lyr_1 = str(target_grid)
## Point_1cm_lyr.replaceDataSource(r"D:IITATE\IITATE_Phase1\arcenv\monitoring" ,
## "SHAPEFILE_WORKSPACE" ,
## Point_lyr_1)
# where_clause = '"GRID_NAME"='+"'" + str(target_grid)+"'"
# where_clause = '"GRID_NAME"='+"'" + target_grid +"'"
# where_clause = """ "GRID_NAME"='L6' """
# where_clause = field_name + """ ='L6' """
# where_clause = ''' "GRID_NAME" = 'L6' '''
# where_clause = ' "GRID_NAME" = ' + str(target_grid)
where_clause = '"' + field_name + '" = ' + "'" + str(target_grid) + "'"
print where_clause
arcpy.MakeFeatureLayer_management(Select_Grid_shp , 'Temp_Grid_lyr', where_clause)
print(Point_lyr_1) + "...UpdateLayer"
arcpy.mapping.ExportToPDF(mxd,
r"D:\IITATE\IITATE_Phase1\EXPORTJPEG\GRID\\" + path_name + "\AM_"+ str(target_grid) + "_" + path_name,resolution=180)
arcpy.DeleteFeatures_management('Temp_Grid_lyr')
del mxd