|
POST
|
GTF is a geographic transformation file. It is used to create custom transformations. I'm not sure where Arc pulls the default transformations from in the projection tool. Is this something you want dynamic that can handle any projection or do you have a set number of projections you want this tool to handle? In the later case you can create a Filter value list that has these built in.
... View more
03-26-2013
02:49 PM
|
0
|
0
|
1859
|
|
POST
|
Something like this should work. Should be all you need after your inputs. #Build the where clause
whereClause = "{0} in ('{1}')".format(fieldName, "','".join(values.split(';')))
#Select(input, output, whereClause)
if int(arcpy.GetCount_management(lyr).getOutput(0)) > 0:
arcpy.Select_analysis(lyr, output, whereClause)
... View more
03-26-2013
02:46 PM
|
0
|
0
|
2961
|
|
POST
|
Geographic Transformation isn't a data type, it is just a string referencing the parameter that is buried in the projection engine DLL or directly in the GTF. The parameter validation that fills out valid transformations (especially in 10.1 where it takes your region into account) is a little more complicated though, if that is what you are asking about. I'm not 100% sure how that one works.
... View more
03-26-2013
02:21 PM
|
0
|
0
|
1859
|
|
POST
|
If you are only making selections from one field you can make a much easier query using the 'IN' command. Instead of this query = 'field = x or field = y or field = z' #etc It would be this query = 'field in (x, y, z)' You also don't need to run a separate selection when using the select tool, you can input the where clause directly in the tool. The main issue you are probably having is your values variable is a string and you are trying to add it how generally lists are used. How do you plan on having your users input multiple values? You would need to post a sample of your valid field values and the actual properties of your values parameter to get more help.
... View more
03-26-2013
12:50 PM
|
0
|
0
|
2961
|
|
POST
|
I don't think you can, how you envision it in any case. You can walk your workspace back one level and use the full path as a variable though. up_one_dir = arcpy.env.workspace.rsplit(os.sep, 1)[0]
... View more
03-25-2013
10:01 AM
|
0
|
0
|
776
|
|
POST
|
You cannot compile a python script importing arcpy into an exe.
... View more
03-25-2013
05:24 AM
|
0
|
1
|
3232
|
|
POST
|
It is because you start your enumerate at 1. for index, value in enumerate(fclist, start=1): This means if len(fclist) == 5 then your index will also be 5 at the last iteration whereas with this if index == len(fclist)-1: You are capturing the second to last iteration. Why is this even necessary? You can put your code outside your loop and carry over the values from the last iteration.
... View more
03-21-2013
05:17 AM
|
0
|
0
|
17993
|
|
POST
|
Your code will generate an error when there is a non-group layer in your data frame, I would check that. Edit: It could also have to do with running it as a model instead of a script. 'If you open the ModelBuilder window and run a model, all processes in the model execute in the foreground. Working in the ModelBuilder window is similar to an edit session. Any processes run do so in the foreground to prevent a situation where changing the workflow could cause undesirable results.' From here. http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00210000003q000000
... View more
03-20-2013
02:49 PM
|
0
|
0
|
1424
|
|
POST
|
How do you define your mxd variable? Are you using the 'current' keyword by any chance? Edit: Actually no that shouldn't cause issues how you are executing it. When you get the errors do they come up as soon as you try to execute it or does it process or a bit? Are you sure your layers are all groups and all have sublayers?
... View more
03-20-2013
02:38 PM
|
0
|
0
|
1424
|
|
POST
|
Can you access it directly without using a layer? Try these two. fc = r'C:\Documents and Settings\acsmith\Application Data\ESRI\ArcCatalog\[email protected]\SDE.SDE.cadastre_real_estate\SDE.SDE.parcel_area'
print(arcpy.Exists(fc))
print(int(arcpy.GetCount_management(fc).getOutput(0))) Also you may want to investigate FIDSet. http://resources.arcgis.com/en/help/main/10.1/index.html#/Layer_properties/018v00000063000000/
... View more
03-20-2013
12:38 PM
|
0
|
0
|
869
|
|
POST
|
You can just use feature class to feature class with an expression. arcpy.SelectLayerByLocation_management(CCP, "WITHIN_A_DISTANCE", SP2, "1 MILE", "NEW_SELECTION") if int(arcpy.GetCount_management(CCP).getOutput(0)) > 0: expression = "YEAR >=2009" arcpy.FeatureClassToFeatureClass_conversion(CCP, out_workspace, "CUPS", expression)
... View more
03-19-2013
01:43 PM
|
0
|
0
|
1173
|
|
POST
|
Then you don't need to bother with a cursor at all. arcpy.SelectLayerByLocation_management(CCP, "WITHIN_A_DISTANCE", SP2, "1 MILE", "NEW_SELECTION")
if int(arcpy.GetCount_management(CCP).getOutput(0)) > 0:
arcpy.CopyFeatures_management(CCP, "CUPS")
... View more
03-19-2013
12:47 PM
|
0
|
0
|
1173
|
|
POST
|
Are you wanting to copy every feature selected as its own feature class?
... View more
03-19-2013
09:59 AM
|
0
|
0
|
1173
|
|
POST
|
Lucas has it right I'd say, I'd maybe do something like this. Essentially the same thing. line = 'AKRON, OH 12345'
line_split = line.split(',')
final_line = '{0},{1}'.format(line_split[0].title(), line_split[1])
print final_line
... View more
03-14-2013
02:58 PM
|
0
|
0
|
1630
|
|
POST
|
If I understand you correctly... no, most of the the arcpy modules are only the python interface into the geoprocessor .dlls. Not only that you will need to be able to access your license as well. Your executing script will require access to the full ArcGIS installation. I'm pretty sure even attempting to circumvent this is in violation of your Esri EULA.
... View more
03-14-2013
02:49 PM
|
0
|
0
|
942
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 05-17-2011 10:36 AM | |
| 1 | 08-16-2012 10:48 AM | |
| 1 | 10-31-2012 08:39 AM | |
| 1 | 07-16-2012 01:52 PM | |
| 1 | 03-15-2012 10:57 AM |
| Online Status |
Offline
|
| Date Last Visited |
08-22-2024
11:12 PM
|