POST
|
Picked an idea for this off stack overflow (link) import arcpy,json
mxd = arcpy.mapping.MapDocument("CURRENT")
for lyr in arcpy.mapping.ListLayers(mxd):
print json.dumps(lyr.name, ensure_ascii=False)
... View more
10-04-2012
02:43 AM
|
0
|
0
|
276
|
POST
|
Have you tried using %ScratchWorkspace%\Output.dbf for your output file? You'd probably need to set that in the model as the default output and get it as text in the script.
... View more
07-04-2012
11:40 PM
|
0
|
0
|
115
|
POST
|
Pyscripter is quite nice to use. It was mentioned in one of the geoprocessing blogs on here http://code.google.com/p/pyscripter/
... View more
04-26-2012
05:44 AM
|
0
|
0
|
765
|
POST
|
You could try a Dissolve based on the CODE Look in ArcTools under Data Management Tools/Generalization
... View more
04-26-2012
05:36 AM
|
0
|
0
|
264
|
POST
|
Thanks for that Dan All points in this case should really of been within the polygons! I'll can just make an envelope polygon to pick up any that are just outside the admin boundaries. Should do the job until SP5 Thanks Ben
... View more
04-05-2012
01:45 AM
|
0
|
0
|
769
|
POST
|
Hi Just to let you know I've experienced the spatial join bug found in SP4. I was joining 740000+ points to 13 polygons Just under 19000 records had attribute data come across. The rest were all null. I've run the exact same data on another machine with ArcGIS 10 SP3 and it worked fine. I see there was a bug listed ( NIM079126 ) but for some reason it's been declined. Not sure why this is, but you should know this is happening to others. One thing I noticed was the last record to have an entry before the attributes failed to populate was a point that was outside all polygons I was trying to join to. I'd suggest creating a point dataset with one point outisde the main body of a join polygon to test this. Maybe then we can see some work towards a solution. Thanks Ben
... View more
04-04-2012
12:57 AM
|
0
|
26
|
4760
|
POST
|
Hi Julia Maybe you just need to use Spatial Join (Find it in ArcToolbox under Analysis Tools/Overlay) Are you trying to assign some admin area to the rainfall data? If it's polygon based then Spatial Join is what you want. If not, please give some more info of what you are trying to join the rainfall points to or what you(or your boss) want(s) at the end of the analysis. Ben
... View more
03-19-2012
02:18 AM
|
0
|
0
|
158
|
POST
|
This should do it, but you would need to put it in a loop to go through your mxds import arcpy
inMXD = r'c:\test.mxd'
outMXD = r'c:\test1.mxd'
rLayer = 'test3' #Name of reference layer
mLayer = 'test4' #Name of layer to be replaced and moved
lyrFile = arcpy.mapping.Layer(r'c:\Test4.lyr') #Layer file used to replace layer
mxd = arcpy.mapping.MapDocument(inMXD)
for df in arcpy.mapping.ListDataFrames(mxd): #loop data frames
for lyr in arcpy.mapping.ListLayers(mxd,"",df): #loop layers
if lyr.isGroupLayer == 1: #Is layer a group layer
for glyr in arcpy.mapping.ListLayers(lyr): #loop layer in group layer
if glyr != lyr: #Not Group Layer Name
if glyr.name.lower() == mLayer: #Layer to be replaced and moved
arcpy.mapping.RemoveLayer(df, glyr) #Remove the layer
arcpy.mapping.AddLayer(df, lyrFile) #Add layer based on Layer File
if glyr.name.lower() == rLayer: #Layer to be used to reference position of move layer
refLayer = glyr #Set ref layer
#Have to loop through layers again as layer is added outside the group layer
for lyr in arcpy.mapping.ListLayers(mxd,"",df): #Start new loop of layers
if lyr.name.lower() == mLayer: #Is move layer
moveLyr = glyr #Set move layer
#Move layer to required position
arcpy.mapping.MoveLayer(df, refLayer, moveLyr, "BEFORE")
mxd.saveACopy(outMXD)
del mxd -Ben
... View more
02-14-2012
07:23 AM
|
0
|
0
|
548
|
POST
|
Maybe try os.walk() Look here for a sample http://stackoverflow.com/questions/120656/directory-listing-in-python
... View more
02-14-2012
04:30 AM
|
0
|
0
|
1704
|
POST
|
Hi David Not really JS API, but you might want to look at density mapping. You would need the spatial analyst extension for it. You can do it at desktop and then load the raster into a map service. Other than that, if you want to look at the points, you may want to look at multipoints rather than single point data. Again not server, but in the data. Hope that gives you some ideas! Ben
... View more
08-16-2011
04:22 AM
|
0
|
0
|
254
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|