POST
|
I have created a PyQT GUI and can invoke it in ArcMap via a script tool. It can do the usual things that you expect from a GUI, for example, on the click of a button it populates a combo box from a database lookup. I also have a script tool that when invoked adds a layer to the map. However, when I try to combine these two scripts, the GUI does nothing. For example, when I click the button, instead of populating the combo box I have coded: mxd = arcpy.mapping.MapDocument("CURRENT") # etc ...but nothing happens. It think that part of the problem is that for the GUI I have to uncheck "Always run in foreground" but for the other script I have to check that box. So my question is, is it possible for a Python script to interact with the map when it is in a script that invokes a GUI using PyQt? Thanks
... View more
09-16-2015
07:30 AM
|
0
|
0
|
3796
|
POST
|
Yes, that works. You still have to join the full path name to the feature class name, but you don't have to set the env.workspace. Thanks
... View more
08-04-2015
01:57 PM
|
0
|
0
|
1320
|
POST
|
This code return "IOError: Roads does not exist." ----------------code BEGINS---------------------- from arcpy import * env.workspace = r"C:\folder1\USA.gdb" # Get a list of the feature classes in the current workspace lstFeatureClass = arcpy.ListFeatureClasses() # Make an empty list to hold the feature classes in the current GDB lstFeatureClassStored = [] # Populate the list with the feature classes from the current workspace for featureClass in lstFeatureClass: lstFeatureClassStored.append(featureClass) # Change the workspace env.workspace = r"C:\folder2\Iowa.gdb" # Loop through the stored feature classes. Here is where the exception is raised for featureClassStored in lstFeatureClassStored: desc = arcpy.Describe(featureClassStored) print desc.Name --------------------code ENDS--------------------------- However, I think it is because the lstFeatureClassStored only stores the name of the feature class, not the feature class object itself, and when I change the environment it doesn't know "Roads". By adding the whole path to the feature class as below, I can then loop through the list and access each feature class by the absolute file name. -------------------code BEGINS--------------------------- import arcpy from arcpy import * pathToFirstWorkspace = r"C:\folder1\USA.gdb" env.workspace = pathToFirstWorkspace lstFeatureClass = arcpy.ListFeatureClasses() lstFeatureClassStored = [] for featureClass in lstFeatureClass: # Store the absolute path to the feature class inside the GDB pathToFeatureClass = r"%s\%s" % (pathToFirstWorkspace,featureClass) lstFeatureClassStored.append(pathToFeatureClass) # Change the workspace env.workspace = r"C:\folder2\Iowa.gdb" # Access the feature class by the absolute path to the GDB for pathToFeatureClass in lstFeatureClassStored: desc = arcpy.Describe(pathToFeatureClass) print desc.Name --------------------code ENDS----------------------------- So this works, but it still doesn't answer my question, is there a way to get a listing of classes without using env.workspace and ListFeatureClasses()? It seems very limiting to have to set the environment when you want to know what is in a geodatabase. Thanks
... View more
08-04-2015
01:02 PM
|
0
|
3
|
1320
|
POST
|
I would like to get a list of feature classes in multiple GDBs. This is inconvenient because I have to set env.workspace on each one in order to use ListFeatureClasses(). When I set the environment on the second GDB, I lose access to the feature classes in the first GDB. Is there a way to get access to feature classes in each GDB without having to set the environment or use ListFeatureClasses()? Thanks
... View more
08-04-2015
09:12 AM
|
0
|
7
|
4742
|
POST
|
I have installed Portal for ArcGIS 10.2 on our network, have installed the SSL certificate, and configured the Web Adapter. I have also created user accounts with both Publisher and Administrator privileges. So far so good. However, when I log in as one of those users, go to My Content and upload a shapefile, I do not get the "Publish this file as a feature layer" checkbox. If I upload the shapefile and then edit its properties, I do not see the Publish button. Thus I can't add any layers to a map. Any suggestions? Thanks
... View more
05-08-2015
07:52 AM
|
0
|
3
|
4510
|
POST
|
Thanks Bruno. I think this refers to creating a geodatabase, though, not running the Create Spatial Type, which would actually create the ST_GEOMETRY type.
... View more
03-16-2015
11:50 AM
|
0
|
2
|
595
|
POST
|
The layer is a table in Oracle Spatial, and is not joined to any other table, and is not a view. It is not versioned. The Data Type for the geometry column is SDO_GEOMETRY. When I execute the following query: select t.x, t.y from fire_stations, table(sdo_util.getvertices(geom)) t ...I can see x and y rows for each feature. However, when I use ArcMap 10.2 to export the table into a file GDB, I cannot add the file GBD table to ArcMap, and when I try to view it in FME Data Inspector, FME tells me that it has no geometry. One difference between this database and the databases for which I can add features to ArcMap is that the tables in this database were created by FME. However, FME is very sophisticated and should take care of all details needed when creating a spatial table. For example, it correctly inserts a record into ALL_SDO_GEOM_METADATA. So I don't know what the difference is. Thanks for your help.
... View more
03-11-2015
12:37 PM
|
0
|
1
|
2304
|
POST
|
I am using ArcMap 10.2 and have connected to my Oracle database, and can see the tables in Catalog. However, when I try to add a layer I get "Could not add the specified data object to the map. Underlying DBMS error[ORA-00936: missing expression]" I am able to add this Oracle layer to other GUIs such as FME Data Inspector and QGIS. I have added both spatial and non-spatial indexes and have a primary key. I have been able to connect to and show layers in other Oracle databases in our network, just not from this database. I connected to this database as a user that has select, update, delete, and insert permissions. Any suggestions? Thanks
... View more
03-11-2015
10:44 AM
|
0
|
3
|
9806
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:25 AM
|