POST
|
I have found this script to list shapefiles/geodatabases/dbase files/coverages on a disc. The script runs well, BUT when i run it a second time, datalines are addded,; so my listing is getting larger every time. I suppose it is because I use that yield command? Is there a way to avoid this? I am a new user of python/arc python. Can anyoen help me a little bit. I have already read that yield is difficult to understand for new users. Thanks in advance, Bart De Bruyn **************************************************************** import os import arcpy workspace = r"T:\test" output = r"H:\testlist.txt" outFile = open(output, "w") lijn="" def inventory_data(workspace, datatypes): """ Generates full path names under a catalog tree for all requested datatype(s). Parameters: workspace: string The top-level workspace that will be used. datatypes: string | list | tuple Keyword(s) representing the desired datatypes. A single datatype can be expressed as a string, otherwise use a list or tuple. See arcpy.da.Walk documentation for a full list. """ for path, path_names, data_names in arcpy.da.Walk( workspace, datatype=datatypes): for data_name in data_names: yield os.path.join(path, data_name) for feature_class in inventory_data(r"T:\test", "Any"): lijn = lijn + feature_class + "\n" outFile.write(lijn) outFile.close()
... View more
03-12-2014
08:52 AM
|
0
|
6
|
3683
|
POST
|
Hi, Do you mean that you want to combine values from multiple fields into one value in one field? Say you have field A and field B. A B 45 66 56 77 67 88 Do you want to create a new field C which would have something like this: A B C 45 66 "45/66" 56 77 "56/77" 67 88 "67/88" ? Or you mean that you have used various symbols for various features (I guess based on some attribute) and now you want to calculate a new field which would have values based on the symbol used for this feature (green circle will be "123" and black square will be "456")? In this case, you do not have to bother with symbols at all since the symbology in ArcMap is always attribute-driven. This is because you have to differentiate features based on their properties (it could either non-spatial attributes (properties) or geometrical properties like area, length, etc.) Your last calculation is the one I want to do. I want to give values based on the symbol used for each feature. But it is rather difficult to gather all the value combinations for each symbol symbol1: A=45 B=b, A=45 B=c, A=45 B=e, A=66 B=f symbol2: A=36 B=<space>, A=36 B=k, ........ I know that my method was very bad, but my map image is correct now.... Is it possible to calculate automatically a new field C with: feature 1: symbol 1, C=123 feature 2: symbol 2, C=456 feature 3: symbol 1, C=123 and so on ... Is this possible in ArcGIS? In ArcInfo workstion It is possible, something like: arcedit: calculate <field> $symbol But here I have no workstation commands..
... View more
03-21-2012
01:41 PM
|
0
|
0
|
209
|
POST
|
I have been working on a symbolisation based on the values in different fields. Now I should like to define a new field based on the symbols I use in the symbolisation. Is this possible ?? I am using arcgis 10. It's okay if I have a different number for each symbol. thanks in advance for your suggestions.
... View more
03-21-2012
01:25 AM
|
0
|
3
|
354
|
Online Status |
Offline
|
Date Last Visited |
05-04-2023
05:34 PM
|