|
POST
|
Hi Sean, Try something like: import arcpy, os folderPath = r"C:\Project" outFolder = r"C:\Project\PDFs" ## create an output folder for filename in os.listdir(folderPath): fullpath = os.path.join(folderPath, filename) if os.path.isfile(fullpath): basename, extension = os.path.splitext(fullpath) if extension.lower() == ".mxd": mxd = arcpy.mapping.MapDocument(fullpath) arcpy.mapping.ExportToPDF(mxd, outFolder + basename + '.pdf') You will probably need to create ‘PDFs’ folder before running script. Regards, Craig C. Poynter Information Technology Officer (Spatial Analysis) | Research Office, Spatial Data Analysis Network (SPAN) Charles Sturt University Boorooma Street Wagga Wagga, NSW, 2678 Australia Phone: +61 2 69332165 Fax: +61 2 69332735 Email: [email protected]<mailto:[email protected]> www.csu.edu.au<http://www.csu.edu.au/>
... View more
10-13-2015
02:17 PM
|
0
|
0
|
3305
|
|
POST
|
Hi Chris, Sorry for delay. Will be following up on your suggestions. Links look promising. Regards, Craig
... View more
10-12-2015
04:03 PM
|
0
|
0
|
1056
|
|
POST
|
Hi All, My department has just installed ArcGIS Server 10.3.1 on our Linux server. Intention is to use for web-publishing, but we want to be able to do back-end processing jobs for some of our larger analysis activities. I would like to know the simple workflow to be able to process either from Desktop to Linux Server or directly on the Server. We would more than likely be wanting to utilise python / arcpy scripting and need to know how to access the arcpy library on the server when logged into it or from Desktop. Thank you in advance. Regards, Craig
... View more
07-20-2015
10:10 PM
|
0
|
2
|
4001
|
|
POST
|
You could try the tool "Points to Line" or "XY to Line" and then symbolize the lines by your field values. Using representations you may then be able to make a more realistic river representation. Regards, Craig
... View more
07-08-2014
04:32 PM
|
0
|
0
|
2788
|
|
POST
|
Try the following:
import arcpy, os, json, traceback, sys, datetime
from arcpy import mapping
from arcpy import env
mxd_out = r'D:\Temp\Blank.mxd'
now = datetime.datetime.now()
log = r'D:\Temp\Invertory_' + now.strftime("%Y-%m-%d" + '_' + "%H_%M_%S") + '_Error.log'
if arcpy.Exists(log):
arcpy.Delete_management(log)
if arcpy.Exists(mxd_out):
arcpy.Delete_management(mxd_out)
mapService = {}
jsonDump = json.dumps(mapService)
result = mapping.ConvertWebMapToMapDocument(jsonDump)
mxd = result.mapDocument
my_mxd = mxd.saveACopy(mxd_out)
env.workspace = r"D:\Temp\Layers"
contents = []
print 'Starting'
for dirpath, dirnames, datatypes in arcpy.da.Walk(env.workspace):
contents.append(os.path.join(dirpath))
for item in contents:
if arcpy.Exists(item):
arcpy.env.workspace = item
listType = [arcpy.ListFeatureClasses, arcpy.ListDatasets]
for list in listType:
datasetList = list("*", 'All')
# Iterate over the feature classes
for dataset in datasetList:
data = item + '\\' + dataset
desc = arcpy.Describe(data)
print data + ' : ' + desc.dataType
# Crack open the map
mxd_new = arcpy.mapping.MapDocument(mxd_out)
df = arcpy.mapping.ListDataFrames(mxd_new, '*')[0]
try:
lyrFile = arcpy.mapping.Layer(data)
if desc.dataType == 'RasterDataset':
layerType = arcpy.management.MakeRasterLayer
result = layerType(lyrFile, 'temp_layer')
layer_object = result.getOutput(0)
arcpy.mapping.AddLayer(df, layer_object)
else:
result = arcpy.management.MakeFeatureLayer(lyrFile, 'temp_layer')
layer_object = result.getOutput(0)
arcpy.mapping.AddLayer(df, layer_object)
# Set correct extent
df.zoomToSelectedFeatures()
nm = os.path.splitext(dataset)[0]
# Compute an output file name
out_file_name = (r"D:\Temp\Output" + "\\" + nm + '.jpg')
# Export Image of data frame
arcpy.mapping.ExportToJPEG(mxd_new, out_file_name, df, 300, 300, )
# Pull the layer out of the data frame to make room for the next one
arcpy.mapping.RemoveLayer(df, layer_object)
# Delete the GP layer
arcpy.management.Delete('temp_layer')
except:
arcpy.ExecuteError
arcpy.AddError(arcpy.GetMessage(2))
f=open(log, 'at')
f.write(data + '\n')
f.close()
del mxd, mxd_new
if arcpy.Exists(mxd_out):
arcpy.Delete_management(mxd_out)
del mxd_out
There are a few additional items in there you won't need like the error log, but this should create you an output. You will need to change the ExportToJPEG to ExportToPDF command options. Regards, Craig
... View more
06-26-2014
03:18 PM
|
0
|
0
|
1538
|
|
POST
|
I was eventually able to create 3D line features using Python. Basics are take initial centroid points and have two fields; base height and ceiling height. Then loop through file and create point pairs as output to a ASCII file. Then import that file into ASCII 3D Feature tool.
... View more
06-24-2014
04:50 PM
|
0
|
0
|
2508
|
|
POST
|
Could you give a representation of what you are trying to present. Might spark an idea or two. I have something in mind, but need to see if it is on the right track. Regards, Craig
... View more
06-23-2014
03:27 PM
|
0
|
0
|
1318
|
|
POST
|
Have you tried playing around with adding a 'transparency' field to your attributes, so that it can be applied within the symbology settings under 'Advanced'? Regards, Craig
... View more
06-22-2014
03:26 PM
|
1
|
0
|
1318
|
|
POST
|
Had a bit of a test with all of the iterator types in ModelBuilder and found 'Iterate Files' will feed into the DEMtoRaster tool correctly. [ATTACH=CONFIG]34284[/ATTACH] The other option you might try, although time consuming, is to right click on the DEMtoRaster tool and select Batch and manually add you DEM datasets. If you modify the Python script I posted, you can run that within ArcMap itself. Regards, Craig
... View more
06-02-2014
04:59 PM
|
0
|
0
|
3788
|
|
POST
|
Wrote this quickly, but try:
import arcpy, os
from arcpy import env
env.workspace = r"<your workspace>"
for dem_file in arcpy.ListFiles('*.DEM'):
dem, ext = os.path.splitext(dem_file)
print dem_file
print dem
arcpy.DEMToRaster_conversion(env.workspace + dem_file, env.workspace + "\\output\\" + dem + ".tif", "FLOAT", 1)
Iterators added within ModelBuilder can only be run in ModelBuilder itself. Regards, Craig
... View more
06-01-2014
05:43 PM
|
0
|
0
|
3788
|
|
POST
|
If you open the relevant ColorBrewer palette/s and export the style you will then have the individual colours. You will need to add the 'Export Map Style' tool under the Customize setting. Maybe make up a dummy grid dataset that you can add multiple colour ramps too to be able to export many at one time. You will have to create individual styles but could then possibly merge them into one style. Ensure you add a legend item to get individual colours as I did in the attached zip file. Regards, Craig
... View more
05-28-2014
04:44 PM
|
0
|
0
|
1637
|
|
POST
|
If you make a custom style and create your colour and dots how you want, then copy and paste the symbol a number of times and create your items accordingly (ie size + colour). Time consuming, but only need to do once and then can apply quickly to other maps.
... View more
05-25-2014
03:40 PM
|
0
|
0
|
2726
|
|
POST
|
Have a look at the datetime function/module within python. You might be able to do a calculation using it. Or have a look at the 'Calculate End Time' tool within ArcGIS. Take note that date and time will need to be separate fields for shapefiles but can be one field in a GDB.
... View more
03-23-2014
02:09 PM
|
0
|
0
|
1085
|
|
POST
|
If you copy your last starting coords and paste them as your ending coords your line will end at last given point. 0,0 is how ArcGIS will fill in your table for empty values. What are you basing your graduation of line on? What value / field?
... View more
03-20-2014
01:38 PM
|
0
|
0
|
6067
|
|
POST
|
Ok have a solution. ArcGIS doesn't like your table. Using the CSV right-click on it in Catalog and use 'Create Feature Class' > 'From XY Table'. Using the table from the point file created set-up the 'XY to Line' tool. Your lines should be created.
... View more
03-19-2014
01:51 PM
|
0
|
0
|
6067
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 06-22-2014 03:26 PM | |
| 1 | 11-03-2022 03:28 PM | |
| 1 | 05-24-2021 05:01 PM | |
| 1 | 12-02-2019 02:46 PM | |
| 3 | 11-01-2020 07:20 PM |
| Online Status |
Offline
|
| Date Last Visited |
06-04-2025
09:55 PM
|