POST
|
You can install ArcGIS Server (10.1, at least) on CentOS 6 and it will run just fine. Whether you want this for pre-production is another story though since ideally pre-production and production environments should be identical. But since the purpose of CentOS is to be a near-identical replica of Redhat anyway, maybe that's good enough. Edit: whoops, just realized the original post is a year old
... View more
11-20-2014
01:59 PM
|
0
|
1
|
255
|
POST
|
It appears they added defaultValue into arcpy in version 10.1, so I assume you're using an earlier version?
... View more
06-26-2014
07:12 AM
|
1
|
0
|
460
|
POST
|
Our organization uses Citrix as well, and we had our administrator install PythonWin in Citrix alongside the ArcGIS applications. Not quite as convenient as having a local installation but it works.
... View more
06-20-2014
06:38 AM
|
0
|
0
|
610
|
POST
|
From Esri Technical Support, it isn't possible for the end-user to retrieve the token's expiration value after it has already been generated. When you generate the token, you will need to capture this value from the initial response and save it off somewhere.
... View more
06-18-2014
10:11 AM
|
0
|
0
|
245
|
POST
|
In your function you need to feed in all of the fields you'll be using within the function to determine the return value. So your code should look something like this (after starting the field calculator on your "A_SqMi" field):
def Reclass(Updat_HYGR, Sq_Miles):
if (Updat_HYGR == 'A'):
return Sq_Miles
Reclass(!Updat_HYGR!, !Sq_Miles!) As an added note, if your field is not nullable you'll need to include an else statement that sets it too a predetermined invalid value (e.g. else: return -1).
... View more
06-18-2014
05:14 AM
|
0
|
0
|
218
|
POST
|
How can you get a token's expiration value after it's been geneated? When generating a token through a REST request it returns an 'expires' value. Say later on you need to know when this same token expires because you didn't copy the date anywhere. Is there another request that takes a token value as a parameter and returns it's expiration value?
... View more
06-05-2014
11:18 AM
|
0
|
1
|
529
|
POST
|
You sound like you're on the right track so I'm not sure why it's not working. But maybe I'm missing something. Here's the steps I used in Model Builder that worked for me: Create a new model and add the Spatial Join tool from the "Analysis Tools-> Overlay" toolbox. Add the buffered centroids as the Target Features. Add the tract polygons as the Join Features. Join Operation is set to 'JOIN_ONE_TO_ONE'. In the 'Field Map of Join Features' it should list all of the fields from both the Target and Join features. For the Join feature fields only, right-click on the field name, select 'Merge Rule' and then 'Sum'. 'Match Option' should be set to INTERSECT. Clicking OK returns a new buffered centroids layer that now contains fields with the summed values of the intersecting tract polygons. So if one buffered centroid feature intersects three tract features with populations of 1000, 2000, and 3000, the new buffered centroid feature has a population field with a value of 6000. I guessing this is the behaviour you're expecting. Something I noticed in Model Builder, at least in 10.1: if you change the source of the Target or Join features, it doesn't update the field map section in the Spatial Join tool as it should. It will either keep fields from the previous feature classes or in some cases it will be completely blank. Deleting the spatial join tool from the model, adding it again, and then reconnecting the Target and Join features seems to fix this.
... View more
05-20-2014
11:58 AM
|
0
|
0
|
905
|
POST
|
We need a bit more information here: Does this web application use an ArcGIS API (e.g. for Flex, Javascript, etc.)? Does it use ArcGIS Server to serve the data? When you say 'using a geoprocessing', does that mean a geoprocessing service or a tool in desktop (or a stand-alone script)?
... View more
05-14-2014
06:04 AM
|
0
|
0
|
175
|
POST
|
Field mapping isn't completely straight-forward but once you understand how to get started it's not too bad. The second code sample in the Spatial Join help explains how to set it up fairly well: http://resources.arcgis.com/en/help/main/10.1/index.html#//00080000000q000000 For your case, make a new field mapping object and populate it with the fields from the attribute tables. The field mapping object will now contain all of the field maps for your fields (using default values). Now you can pull out the field map for the field to sum, change the merge rule, then put it back in the field mapping object.
import arcpy
arcpy.env.overwriteOutput = True
targetFeatures = r'C:\data.gdb\bufferLayer'
joinFeatures = r'C:\data.gdb\censusTracts'
outputFeatures = r'C:\data.gdb\spatialJoinOutput'
# create a list of fields to sum
fieldNamesToSum = ['CENSUS_FIELD_TO_SUM_1', 'CENSUS_FIELD_TO_SUM_2']
# create the field mapping object
fieldMappings = arcpy.FieldMappings()
# populate the field mapping object with the fields from both feature classes
fieldMappings.addTable(targetFeatures)
fieldMappings.addTable(joinFeatures)
# loop through the field names to sum
for fieldName in fieldNamesToSum:
# get the field map index of this field and get the field map
fieldIndex = fieldMappings.findFieldMapIndex(fieldName)
fieldMap = fieldMappings.getFieldMap(fieldIndex)
# update the field map with the new merge rule (by default the merge rule is 'First')
fieldMap.mergeRule = 'Sum'
# replace with the updated field map
fieldMappings.replaceFieldMap(fieldIndex, fieldMap)
arcpy.SpatialJoin_analysis(targetFeatures, joinFeatures, outputFeatures, "JOIN_ONE_TO_ONE", "KEEP_ALL", fieldMappings, "INTERSECT", "", "")
... View more
05-14-2014
05:43 AM
|
1
|
0
|
905
|
POST
|
Joshua, I tried running the script with only a single MXD.save() in my code, right at the end, outside of all for loops, and it worked! -Zack Wow, I wouldn't have expected that! But now that you mention it, it seems like every time you use MXD.save() the changes to the MXD get lost in limbo until you delete the MXD object. But that means you need to re-open the MXD again, which isn't ideal and your code would then look something like this:
MXD = arcpy.mapping.MapDocument(MXD_file)
DF = arcpy.mapping.ListDataFrames(MXD)[0]
LYR_list_MXD = arcpy.mapping.ListLayers(MXD,"*_env*",DF)
LYR_count = len(LYR_list_MXD)
for LYR in LYR_list_MXD:
LYR.visible = False
MXD.save()
del MXD
# Turn on each layer individually and export map as new PDF
for i in range(LYR_count):
# now you need to reopen the MXD...
MXD = arcpy.mapping.MapDocument(MXD_file)
DF = arcpy.mapping.ListDataFrames(MXD)[0]
LYR = arcpy.mapping.ListLayers(MXD,"*_env*",DF)
LYR.visible = True
output_PDF = OutputPDFFolder + "\\" + str(LYR) + ".pdf"
arcpy.mapping.ExportToPDF(MXD, output_PDF)
LYR.visible = False
MXD.save()
del MXD
Note I've only tested this when running a script outside of ArcMap and not using "CURRENT" as your map document.
... View more
02-04-2014
09:08 AM
|
0
|
0
|
439
|
POST
|
Still a No-Go for me. I also tried it directly in my CMD window and received the following error: [INDENT]'/c' is not recognized as an internal or external command, operable program or batch file.[/INDENT] Does that message ring a bell? I've added the path to the 32-bit version of python to my PATH settings and have also associated the .py files with python... /c is an option of cmd. You need to put cmd in front of it, i.e run the cmd command in the command window, as confusing as that sounds. So in the command window, type: cmd /c python C:\script.py
... View more
01-30-2014
08:48 AM
|
0
|
0
|
2615
|
POST
|
The attached screenshot shows how I have one task set up (using the GUI). I suppose the only other consideration is whether you have the right version of Python running by default, but I assume you have that covered already since you can run it manually.
... View more
01-30-2014
08:28 AM
|
0
|
0
|
2615
|
POST
|
Not sure if this has anything to do with your problem, but I found running Python scripts using Task Scheduler wouldn't consistently work if you set the Python executable as the program to run. Instead, I had to use cmd as the program with the python executable and the python script as arguments. So for example, if my script was under C:\path\to\script.py, then I would set it up in the Task Scheduler to run cmd as the Program/Script with the arguments /c python C:\path\to\script.py (under Add arguments (optional)).
... View more
01-28-2014
03:57 AM
|
0
|
0
|
2615
|
POST
|
The module os.walk lists all of the files within the "path" directory, including those within subdirectories of "path". In your case, this would include files not just under "C:" but also "C:\windows", "C:\users", etc. Which is what you expect. However your code is listing just the filenames, checks to see if each one is an MXD, and if so then joins the mxd filename to "C:\". So if there's an MXD called "C:\users\map.mxd", your code is ultimately converting that path to "C:\map.mxd". Fortunately os.walk also includes the full directory path of each file (named "root" in your code). Try changing "path" to "root" in this line: fullPath = os.path.join(root,filename) So the full code would look like this:
import arcpy.mapping as mapping, os
path = r"C:"
f = open('filename_here.txt','w')
for root,dirs,files in os.walk(path):
for filename in files:
basename, extension = os.path.splitext(filename)
if extension == ".mxd":
fullPath = os.path.join(root,filename)
mxd = mapping.MapDocument(fullPath)
f.write("MXD: " + filename + "\n")
brknList = mapping.ListBrokenDataSources(mxd)
for brknItem in brknList:
f.write("\t" + brknItem.name + "\n")
f.close()
... View more
01-22-2014
08:13 AM
|
0
|
0
|
236
|
POST
|
You're right, it looks like this one slipped through QA. But the rest of the script can tell you what it should be. Note that I haven't tried the script myself so this is mostly guesswork... An sddraft file is just an XML file. Within it is a tag that looks like this: <Type>esriServiceDefinitionType_New</Type> This script replaces that tag in the sddraft file with this tag: <Type>esriServiceDefinitionType_Replacement</Type> I'm assuming this tells ArcGIS Server the service definition file that is created (staged) from this sddraft file will be used to overwrite an existing service when published. So you need to use the inServiceDefinitionDraft as the input for the DOM.parse function, which means you're right, it would be "c:/Data/myMapService.sddraft", or: xml = env.workspace + "/" + inServiceDefinitionDraft
... View more
11-18-2013
04:30 AM
|
0
|
0
|
562
|
Title | Kudos | Posted |
---|---|---|
1 | 02-07-2011 06:13 AM | |
1 | 05-14-2014 05:43 AM | |
1 | 04-14-2010 08:15 AM | |
1 | 02-09-2011 09:52 AM | |
1 | 06-26-2014 07:12 AM |
Online Status |
Offline
|
Date Last Visited |
10-27-2021
12:22 AM
|