|
POST
|
ArcIMS Metadata Server is their story, and they are sticking to it. I guess it took 3 versions and 4 years for the unnecessary SQL Server Express components to be removed for Desktop and Workgroup database, quite the process for tracking on requirements changes between versions.
... View more
01-15-2015
11:31 AM
|
0
|
0
|
1313
|
|
POST
|
I decided to open an Esri Support case on this issue. First response, Advanced Services was "needed with ArcIMS Metadata Server." Say what? Maybe ArcIMS Metadata Server did require Advanced Services, I don't know and don't care enough to know given ArcIMS's last release was 4+ years ago, but I simply can't believe ArcIMS had anything to do with dropping Advanced Services for Desktop and Workgroup database at ArcGIS 10.3. We'll see what the next response brings....
... View more
01-14-2015
08:56 AM
|
0
|
1
|
1313
|
|
POST
|
I revisited the Help for Building a query expression, where it states: If the string contains a single quote you will first need to use another single quote as an escape character. In Python, the backslash is the dominant escape character, but there are some additional escape sequences. My sample code above that used text replacement to escape the single quote used the backslash, but ArcGIS wants users to escape a single quote by using another single quote. The updated code worked for an example I ginned up on my machine: expression = "{} = '{}' AND {} = '{}'".format(SelectCriteriaF,
str(list_UV_CriteriaF ).replace("'","''"),
SplitCriteria,
str(listSplit ).replace("'","''"))
... View more
01-13-2015
02:39 PM
|
0
|
0
|
844
|
|
POST
|
Unfortunately without specifics of what the variables are when the code errors, or even the exact error text, those of us trying to help are grasping as straws to some extent.
... View more
01-13-2015
01:09 PM
|
0
|
6
|
2461
|
|
POST
|
If you print out an example using all the variables along with the error messages, it might help narrow down the issue.
... View more
01-13-2015
09:49 AM
|
0
|
0
|
2461
|
|
POST
|
As imperfect as PatchFinder may be, I think it's batting average is higher than relying on Build Numbers, especially from applications other than ArcGIS Administrator. Looking at FAQ: What are the build numbers for releases of ArcGIS Desktop?, one can see that build numbers for ArcGIS 10.1 SP1 QIP are incorrect in ArcMap and ArcCatalog. The ArcGIS 9.3.1 SP2 QIP had a similar issue. Taking the above information together with the fact that most patches don't update build numbers, our organization has moved away from using build numbers for identifying anything beyond major/full releases. In fact, we have an Esri Support Case open right now over how to definitively show the OpenSSL patch has been applied because PatchFinder isn't showing the patch on some machines that it has been applied on. Of course, the issue only gets muddier when dealing with patching Background Geoprocessing as well as Desktop. Just be aware that identifying installed patches has historically been as much an art as a science.
... View more
01-13-2015
08:44 AM
|
2
|
0
|
2540
|
|
POST
|
I encourage you to check out Python string formatting. Not only is using built-in string formatting more Pythonic than concatenating several strings together, I would also argue it is more readable. First, I would just try restructuring the expression using string formatting to see if that works: expression = "{} = '{}' AND {} = '{}'".format(SelectCriteriaF,
str(list_UV_CriteriaF ),
SplitCriteria,
str(listSplit )) If that doesn't work, then you might have to try string replacement to insert an escape character before the quote. From looking at the code, I am not sure which variable is causing the problem, so I just replaced text on both. This might work: expression = "{} = '{}' AND {} = '{}'".format(SelectCriteriaF,
str(list_UV_CriteriaF ).replace("'","\\'"),
SplitCriteria,
str(listSplit ).replace("'","\\'"))
... View more
01-13-2015
07:51 AM
|
1
|
2
|
2461
|
|
POST
|
Another idea, are both your datasets in the same workspace? That is a requirement for this tool.
... View more
01-08-2015
02:46 PM
|
0
|
0
|
4562
|
|
POST
|
There is basically a bug in the expression builder. Try removing the quotations from around the fields. Even if you verify the expression and it fails, it can still run correctly. Not sure if this is exactly your problem, but I run into the errand quotations with the expression builder all the time.
... View more
01-08-2015
02:38 PM
|
0
|
0
|
4562
|
|
POST
|
Are your keys currently row numbers from a table? If so, you are basically treating a dictionary like a list, which is more awkward to work with than if it was just a list. The focus of the dictionary key should be the BuildingID, not the row number. Assuming you want each building to have the three hazards mentioned above, and only those three hazards, the following (untested) code might work: # import functions from modules that are available but not commonly imported
from collections import defaultdict
from numpy import fromiter, dtype
# group hazards by building
haz_group = defaultdict(list)
with arcpy.da.SearchCursor(in_table, ['BuildingID', 'HazardID']) as cur:
for k, v in cur:
haz_group .append(v)
# create iterable and populate with flagged buildings
build_iter = (k for (k, v) in haz_group.iteritems() if v.sort() != [16, 17, 18])
tmp1 = fromiter(build_iter, dtype([('BuildingID', 'S10')]))
# dump numpy array to table
arcpy.da.NumPyArrayToTable(tmp1, out_table)
# or just print BuildingIDs to console
for build in build_iter:
print build Note that if you are going to just print the buildings, drop lines 13 and 16 because line 13 will exhaust the generator so lines 19 and 20 won't print anything. Instead of creating a generator expression, you could use a list comprehension and the list would persist. I tend to work with generator expressions because lists can consume large amounts of memory with very large data sets. NOTE: Updated Line 12 to address the HazardID not necessarily being sorted in original table.
... View more
01-08-2015
01:44 PM
|
1
|
1
|
4327
|
|
POST
|
Your welcome. Keeping plugging away at learning Python, I know I have really enjoyed learning and applying it, there is so much you can do with it. Cheers....
... View more
01-08-2015
01:04 PM
|
0
|
0
|
2614
|
|
POST
|
I believe Add Geometry Attributes is replacing Calculate Geometry in ArcGIS Pro, at least that was the word during beta testing. UPDATE: Since ArcGIS Pro 2.2, a comparable Calculate Geometry tool has been available.
... View more
01-08-2015
11:10 AM
|
5
|
1
|
8632
|
|
POST
|
For inserting scripts, i.e., syntax highlighting, you need to use the advanced editor that is accessed from a link in the upper-right corner of the reply window/frame. Try the following: for lyr in arcpy.mapping.ListLayers(mxd):
if lyr.symbologyType in ["GRADUATED_COLORS", "GRADUATED_SYMBOLS"]:
labels = lyr.symbology.classBreakLabels
for i, label in enumerate(labels):
labels = label.replace("_", " ")
lyr.symbology.classBreakLabels = labels
elif lyr.symbologyType in ["UNIQUE_VALUES"]:
labels = lyr.symbology.classLabels
for i, label in enumerate(labels):
labels = label.replace("_", " ")
lyr.symbology.classLabels = labels Since the class labels are properties and return a list, you need to "get" the lists, which is what I am doing in lines 03 and 08. Since the labels are stored in a list, you need to iterate over the list and do the text replace/substitution on each element of the list. Lines 04-05 and 09-10. There are several ways to handle this part. One could create a new list, using a for loop or list comprehension I chose to edit the existing list in place, using a for loop and an enumerate object. After the label updates are done, you need to "set" the properties to the new or updated lists, which is what I am doing in lines 06 and 11.
... View more
01-08-2015
10:52 AM
|
0
|
2
|
2614
|
|
POST
|
You can also use the new-ish Walk (arcpy.da) to find geo-related files and data, including maps.
... View more
01-08-2015
08:52 AM
|
0
|
0
|
1937
|
|
POST
|
You are misunderstanding what os.path.abspath actually does. From 10.1. os.path — Common pathname manipulations — Python 2.7.9 documentation: os.path.abspath(path) Return a normalized absolutized version of the pathname path. On most platforms, this is equivalent to calling the function normpath() as follows: normpath(join(os.getcwd(), path)). New in version 1.5.2. You are joining the current working directory of the command prompt or script to the name of the file. Try replacing line 11 with: filePath = os.path.join(root, filename)
... View more
01-08-2015
08:46 AM
|
0
|
2
|
1937
|
| Title | Kudos | Posted |
|---|---|---|
| 2 | 3 weeks ago | |
| 1 | 4 weeks ago | |
| 1 | 3 weeks ago | |
| 3 | 3 weeks ago | |
| 1 | 05-22-2026 05:27 AM |
| Online Status |
Offline
|
| Date Last Visited |
Thursday
|