POST
|
Can you clarify a little more? Something like the image below, with the arrows being wind vectors, and you want the area of the yellow surface? http://en.wikipedia.org/wiki/File:Surface_normal.png
... View more
01-27-2014
09:17 AM
|
0
|
0
|
631
|
POST
|
On second examination, I'm not sure the solution I provided would work for what you need. I was talking about making it so a tool's dialog would dynamically populate a picklist when you open the tool. You're looking for something that pops up in the middle of the workflow, not first thing. I'm not sure whether or not that can be done in model builder. I think it might be possible if you made it a python addin tool, but again, I don't have any experience with that, so I'm not sure.
... View more
01-24-2014
07:00 AM
|
0
|
0
|
868
|
POST
|
The "Database Connections" part of the path that you are seeing is normal behavior. This is Esri's way to abbreviating the default location where SDE connection files are stored on the machine when creating them under Database Connections in ArcCatalog or ArcMap. So, "Database Connections\..." really refers to the user profile directory. For example in Windows 7 or Windows Server 2008 R2, C:\Users\userID\AppData\Roaming\ESRI\ArcCatalog\SDE@SBMPERDBS003.sde ...would be represented by Esri software as... Database Connections\SDE@SBMPERDBS003.sde I was refering to the switch in user from GISAdmin to SDE.
... View more
01-24-2014
06:50 AM
|
0
|
0
|
589
|
POST
|
If you want to dynamically populate a picklist, that can be done by modifying the tool validation script (script tool properties, validation tab). Basic example of generating a list of unique values for a picklist: class ToolValidator:
"""Class for validating a tool's parameter values and controlling
the behavior of the tool's dialog."""
def __init__(self):
"""Setup the Geoprocessor and the list of tool parameters."""
self.params = arcpy.GetParameterInfo()
def initializeParameters(self):
"""Refine the properties of a tool's parameters. This method is
called when the tool is opened."""
return
def updateParameters(self):
"""Modify the values and properties of parameters before internal
validation is performed. This method is called whenever a parameter
has been changed."""
FC = r"C:\Path\To\FeatureClass"
Col = "FieldName"
self.params[0].filter.list = [str(val) for val in sorted(set(row.getValue(Col) for row in arcpy.SearchCursor(FC, None, None, Col)))] #use a da cursor if @ 10.1+
return
def updateMessages(self):
"""Modify the messages created by internal validation for each tool
parameter. This method is called after internal validation."""
return
... View more
01-16-2014
08:58 AM
|
0
|
0
|
868
|
POST
|
My client wants each page to key number the parcels instead of labeling them individually on the map. I'm not sure I understand that bit. Instead of labeling the parcels on the map, are you talking about listing them somewhere on the page or on a separate page, sort of like a road atlas does for streets? Are the parcels only ever in one of the index polygons, or is there overlap?
... View more
01-13-2014
01:34 PM
|
0
|
0
|
174
|
POST
|
Hello, msayler, I really thank you for your answer! I know almost nothing about coding, so I apologize if the following questions seem too dumb: - Does this code you provided allow some point and some polygon features to be labelled at the same time (at the same page)? I need both features to be labelled, the preference being for point features over polygon features when features that have the same attributes (one being point and the other being polygon) occur within the data frame. Are you refering to label weighting? i.e. if the two labels are in conflict, show the one for the point? - Where in ArcMap should I insert the code, so it executes every time I change data-driven pages? That example is just a snippet of pseudo code. It would have to be either set up as part of a script tool that generates the maps outside of an ArcMap session (i.e. exports to a pdf mapbook), OR if you want to work in a live session, you'd probably want custom add-in tools (or copy and paste into the python window, but that's not as user-friendly). Either way, you're looking at investing some time in learning python or finding someone who can build it for you (unfortunately, I just don't have the time to put the whole thing together). If you do a lot of this sort of custom mapbook work and if you can make the time, I would highly recommend learning python. Even just a foundation in the basics can be pretty liberating.
... View more
01-09-2014
08:29 AM
|
0
|
0
|
554
|
POST
|
It can be done with python using os.listdir() to list the folders and arcpy.ListFeatureClasses() to grab all the feature classes in the folder: Something like:
import arcpy
import os
mainLoc = r"c:\testing"
outputLoc = r"c:\finalLocation\Output.gdb" #Note: ouput location should be outside the "testing" folder or additional runs will include any previously generated output
FCList = []
for dir in os.listdir(mainLoc):
arcpy.env.workspace = dir
FCsubList = arcpy.ListFeatureClasses("*_CadastralPolygons.shp", "Polygon")
FCList.append(FCsubList)
arcpy.Merge_management(FCList, outputLoc)
... View more
12-26-2013
07:38 AM
|
0
|
0
|
520
|
POST
|
Totally possible. Not sure what the level of effort would be though, as I've never delved into using python on the web. Python itself isn't Esri's, just the arcpy site package. There are a ton of modules out there, including ones for doing both server-side and client-side web programming. https://wiki.python.org/moin/WebProgramming
... View more
12-23-2013
07:33 AM
|
0
|
0
|
159
|
POST
|
You could add attributes to the index features and use that to drive which layer to label. I.e. add a yes/no "LabelPoints" field and then add something like the following: # untested, ~psuedo code
rows = arcpy.SearchCursor(indexGridLayer, "{0} = '{1}'".format(arcpy.addFieldDelimeters(indexGridLayer,"PageName"), currentPageName)
for row in rows:
if row.getValue("LabelPoints") == "yes":
pointsLayer.showLabels = True
polygonsLayer.showLabels = False
else:
pointsLayer.showLabels = False
polygonsLayer.showLabels = True
This does add a little maintenance to the process, as you need to review that the attribute is correct periodically, but if things don't change much, that's probably not a big deal. With that added maintenance, I'm not sure if this is the best solution but it is a solution.
... View more
12-23-2013
07:19 AM
|
0
|
0
|
554
|
POST
|
Nope. I think it would have to be a setting somewhere that lets you adjust how dates are displayed. You can even try manually typing the date in as "01/01/1950" and it will show up as "1/1/1950" after it updates. And again, it's really just aesthetics. If you want them in a different format for displaying on a map or in a report, you can probably still do that. If you need to do math on the dates, you can also use python for that. Here's a thread where someone needed to get time deltas in days: http://forums.arcgis.com/threads/97156-Calculate-date-difference
... View more
12-04-2013
10:15 AM
|
0
|
0
|
608
|
POST
|
Are you doing this through a normal script tool (like in a toolbox) or through an add-in tool? In the first case, you could modify the validation code (right-click the script tool, properties, validation tab) so that when the first parameter is altered, you use the value to filter the list of the next parameter. http://resources.arcgis.com/en/help/main/10.1/index.html#//00150000002m000000 Example of some validation code I modified. Have to fill in the first parameter, database connection, first (everything else is disabled). Once it's been entered, the connection is used to path to a feature class and derive a picklist from one of its fields. The script then enables the other parameters. #-------------------------------------------------------
# BufferFeeder.py validation code
# Feb 2012 msayler
# Updated Jul 2012
# Must be copied into the script tool's validation code
# in the Validation tab under Properties
#-------------------------------------------------------
class ToolValidator:
"""Class for validating a tool's parameter values and controlling
the behavior of the tool's dialog."""
def __init__(self):
"""Setup the Geoprocessor and the list of tool parameters."""
import arcpy
self.params = arcpy.GetParameterInfo()
self.X = 0
self.fcfield = (None,None)
def initializeParameters(self):
"""Refine the properties of a tool's parameters. This method is
called when the tool is opened."""
self.params[1].enabled = False
self.params[2].enabled = False
#self.params[3].Value = self.X #for debugging
return
def updateParameters(self):
"""Modify the values and properties of parameters before internal
validation is performed. This method is called whenever a parameter
has been changed."""
if self.X == 0:
if self.params[0].altered == True:
FC = str(self.params[0].value) + "\\gis2.ELEC.ElectricDataset\\gis2.ELEC.eCircuitBreaker"
Col = "FeederID"
self.fcfield = (FC, Col)
self.params[1].filter.list = [str(val) for val in \
sorted(\
set(\
row.getValue(Col) for row in \
arcpy.SearchCursor(FC, None, None, Col)\
)\
)\
]
self.params[1].enabled = True
self.params[2].enabled = True
self.X = 1
#self.params[3].value = self.X #for debugging
# if self.params[1].Value not in self.params[1].filter.list:
# self.params[1].Value = self.params[1].filter.list[0]
return
def updateMessages(self):
"""Modify the messages created by internal validation for each tool
parameter. This method is called after internal validation."""
return
For the second case, I haven't worked with add-ins yet, but I think you could do a similar sort of process. Catch that the field has changed, then use the value it changed to to calculate the choices for the next one.
... View more
12-04-2013
09:24 AM
|
0
|
0
|
416
|
POST
|
If the field is a 'date' data type, then it's probably stored correctly, and that's just how ArcGIS is programmed to interpret for display. Dates are a little different than other data types. You can pull the dates out in the format you want using strftime like Shaun said. I'm not sure if you can change the default way they're displayed in ArcMap. I didn't find a setting doing a quick search of the usual spots anyway. Here's a link on strftime and the various '%' codes that can be used for the format string: http://docs.python.org/2.7/library/datetime.html?highlight=datetime#strftime-and-strptime-behavior
... View more
12-03-2013
02:25 PM
|
0
|
0
|
608
|
Title | Kudos | Posted |
---|---|---|
1 | 06-27-2013 01:01 PM | |
20 | 09-30-2011 10:33 AM | |
5 | 09-09-2010 05:18 PM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|