|
POST
|
I am running ArcGIS 10.3.0.4322, and I don't see the issue you are having if I re-source a file geodatabases using arcpy or the GUI. My original test used a SQLite database, and I think that was causing the issue for me, which makes me think it may be a client-datasource compatibility issue for you. Have the geodatabases you are using been around for a long time, created in an earlier version maybe? If so, does recreating the file geodatabases using your current version change the behavior.
... View more
02-26-2015
11:04 AM
|
0
|
1
|
3827
|
|
POST
|
I think I understand what is going on. Whether it is a bug or not is for you to debate with Esri Support. If you run the following on the problem MXD you talked about, print arcpy.mapping.Layer(r'Work Layers\Replacement Tree').dataSource I am guessing the results come back showing the original data source and not the re-sourced data source. However, running the code below probably shows you the newly re-sourced data source: mxd = arcpy.mapping.MapDocument("CURRENT")
lyr in arcpy.mapping.ListLayers(mxd):
if lyr.name == r'Work Layers\Replacement Tree':
print lyr.dataSource In the second example, since you are retrieving the layers from the "CURRENT" MXD, it is showing you what is reflected in ArcMap currently. With the first example, it appears to be going back to the MXD as originally loaded. I haven't tried it, but you could try seeing if re-sourcing the data paths using ArcPy instead of the GUI makes Exists work the way you expect. Is your script looping through the layers using arcpy.mapping.ListLayers?
... View more
02-26-2015
09:40 AM
|
0
|
3
|
3827
|
|
POST
|
In situations like this, or really always, it is helpful to state what version (build number too) and patches you are running.
... View more
02-26-2015
08:46 AM
|
1
|
1
|
3827
|
|
POST
|
The following functional code snippet will loop through all the service requests and then loop through all of the electronic waste items for each service request. Is this sort of what you are after: for sr in decoded['Response']['ListOfServiceRequest']['ServiceRequest']:
SRAddress = sr['SRAddress']
latitude = sr['Latitude']
longitude = sr['Longitude']
for ew in sr["ListOfLa311ElectronicWaste"][u"La311ElectronicWaste"]:
CommodityType = ew['Type']
ItemType = ew['ElectronicWestType']
ItemCount = ew['ItemCount']
... View more
02-25-2015
10:50 AM
|
1
|
12
|
7875
|
|
POST
|
Given that ArcSDE documentation doesn't address SQL Server's compatibility level, I would argue there is an implicit requirement that ArcSDE be installed in SQL Server databases with the default setting.
... View more
02-23-2015
08:38 AM
|
0
|
0
|
3810
|
|
POST
|
The second code sample in the ArcGIS Help 10.2 - ListFeatureClasses (arcpy) gets you most of the way there. The code below is adapted from the second code example: import arcpy
import os
gdb = #
arcpy.env.workspace = gdb
datasets = arcpy.ListDatasets(feature_type='feature')
datasets = [''] + datasets if datasets is not None else []
fcList = []
for ds in datasets:
for fc in arcpy.ListFeatureClasses(feature_dataset=ds):
fcList.append(os.path.join(gdb, ds, fc))
# fcList.append(os.path.join(ds, fc)) # if you don't want gdb path included
fcList.sort() The Esri sample code, beyond providing the functional framework, incorporated two notable tips/ideas/practices. The first is that including an empty string '' in the datasets list will allow the datasets loop to include the feature classes that aren't in a data set, i.e., the feature classes that are in the root/base of the geodatabase. The second is that os.path.join is used to create the full path of the feature classes being listed. If you are going to do any further processing of the list of feature classes, having the full path to them in the list makes the next steps easier. Even if you are just listing feature classes to know what is present, including the data set along with the feature class will provide for more context.
... View more
02-23-2015
08:21 AM
|
2
|
0
|
7191
|
|
POST
|
Huh, not sure then. For me, Background geoprocessing generates that exact error and disabling it makes it go away using the code above. Maybe close out of ArcGIS Desktop and clean out all of the PYC and PYO files in the comtypes site package folder as well as clear out the gen folder under comtypes.
... View more
02-20-2015
03:20 PM
|
1
|
1
|
5846
|
|
POST
|
Now I remember why this sounded so familiar, I ran into the same issue about six months back. Turn off "Background Processing." I am guessing you have it enabled, which means some of the code is being run out of process, so there is no AppRef.
... View more
02-20-2015
02:01 PM
|
0
|
3
|
5846
|
|
POST
|
Posting the exact snippet and error code are helpful. There are lots of snippets. How are you running the code, the interactive Python windows in ArcGIS Desktop or as a standalone script?
... View more
02-20-2015
01:13 PM
|
0
|
5
|
5846
|
|
POST
|
I would look into creating a map package: "A map package contains a map document (.mxd) and the data referenced by the layers it contains, packaged into one convenient, portable file." The creation of map packages can be fine tuned and scripted using the Package Map (Data Management) tool.
... View more
02-20-2015
07:55 AM
|
1
|
1
|
2619
|
|
POST
|
It would be helpful if you could elaborate a bit more on the final data structure you are looking at creating. The sample JSON object is large and sparse, which would create a large and sparse table if you want to load it all into a single table. I am unclear whether you are interested in all items in the list or certain subsets. You seem to be working with electronic waste, is that the subset you want to extract? When you say you want to "iterate through most of the fields shown in the JSON response(not all)," what is your criteria for not iterating over something?
... View more
02-20-2015
07:45 AM
|
1
|
14
|
7875
|
|
DOC
|
In order to decide what tool to use on-the-fly, you would have to have either an if..elif...else structure, dictionary map, or some other control structure. In that case, why not call the tool like normal. The other hang up is arguments because different tools have different arguments. Granted, some tools share syntax/arguments, but not enough to make one argument list to rule them all. From a learning perspective, and understanding more nuts and bolts of Python, code snippets like this are useful even if the real-world need is limited.
... View more
02-19-2015
01:49 PM
|
0
|
0
|
3189
|
|
POST
|
Owen Earley, although I agree that GeoNet is really about Esri and ArcGIS, the GeoNet home page does say "all things geo." Maybe the intern was excited and got a bit carried away the scope statement, but one could argue Esri did open the door to non-Esri questions, not that one should expect to get many responses.
... View more
02-19-2015
10:36 AM
|
1
|
0
|
910
|
|
POST
|
How are you "seeing" the geodatabases tables? Are you logging into SQL Server using SQL Server Management Studio (SSMS) or SQLCMD? If the former, are there no views showing up under the Views folder/tab? Originally with 10.1, versioned views ended with "_VW" but Esri changed that in 10.2 to end in "_EVW".
... View more
02-19-2015
09:13 AM
|
1
|
2
|
5484
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 06-11-2026 07:04 AM | |
| 1 | 07-17-2026 06:54 AM | |
| 2 | 07-06-2026 12:29 PM | |
| 1 | 07-06-2026 12:00 PM | |
| 2 | 06-05-2026 10:30 AM |
| Online Status |
Offline
|
| Date Last Visited |
Wednesday
|