POST
|
I placed the NOT in the variable, this worked.. It excluded all the esri_ layers owner = "* NOT esri" #content = source.content.search("title:" + title, item_type="Map Image Layer", max_items=500) content = source.content.search("Owner:" + owner, item_type="Map Image Layer", max_items=500) print("OUTPUT") for item in content: print(item)
... View more
02-12-2020
05:28 AM
|
0
|
0
|
839
|
POST
|
Greetings, I have a query, using Python that returns all the Map Image layers. I am trying to filter the query: a) to filter out owner: esri_livingatlas b) to filter out title: USA If I use != or NOT for owner, to filter. I get an error?? I can only use two parameters in the Query?? Thanks, Clive The code: source = GIS(source_portal, source_admin, source_admin_password, verify_cert=False) print("LOGGED INTO SOURCE") title = "*" owner != "esri*" content = source.content.search("title:" + title, item_type="Map Image Layer", max_items=500) print("OUTPUT") for item in content: if 'title:' != '*USA*': print(item) The output: START LOGGED INTO SOURCE OUTPUT <Item title:"National Weather Service Wind Forecast" type:Map Image Layer owner:esri_livingatlas> <Item title:"USA Weather Warnings and Watches" type:Map Image Layer owner:esri_livingatlas> <Item title:"National Weather Service Wind Gust Forecast" type:Map Image Layer owner:esri_livingatlas> <Item title:"USA Soil Map Units 2014 (Mature Support)" type:Map Image Layer owner:esri_livingatlas> <Item title:"2016 USA Organic Food Consumption" type:Map Image Layer owner:esri_livingatlas> <Item title:"2017 USA Diabetes Medication Users (Non-Insulin)" type:Map Image Layer owner:esri_livingatlas> <Item title:"2016 USA 401(k) Retirement Plans" type:Map Image Layer owner:esri_livingatlas> <Item title:"2017 USA Diabetes Medication Users (Insulin)" type:Map Image Layer owner:esri_livingatlas> <Item title:"USA USFS Lands (Mature Support)" type:Map Image Layer owner:esri_livingatlas> <Item title:"2016 USA Clothing/Accessory Store Market Opportunity" type:Map Image Layer owner:esri_livingatlas> <Item title:"2017 USA 401(k) Retirement Plans" type:Map Image Layer owner:esri_livingatlas> <Item title:"USA Soils Map Units" type:Map Image Layer owner:esri_livingatlas> <Item title:"2017 USA Transportation Fuel Spending" type:Map Image Layer owner:esri_livingatlas> <Item title:"2017 USA Child Care Spending" type:Map Image Layer owner:esri_livingatlas> <Item title:"2016 USA Online Banking" type:Map Image Layer owner:esri_livingatlas> <Item title:"USA Storm Reports" type:Map Image Layer owner:esri_livingatlas> <Item title:"USA Hazardous Waste Sites" type:Map Image Layer owner:esri_livingatlas> <Item title:"2017 USA Water and Public Services Spending" type:Map Image Layer owner:esri_livingatlas> <Item title:"USA NPS Lands (Mature Support)" type:Map Image Layer owner:esri_livingatlas> <Item title:"USA Wetlands 2015" type:Map Image Layer owner:esri_livingatlas> <Item title:"2017 USA Food Service Market Opportunity" type:Map Image Layer owner:esri_livingatlas> <Item title:"2017 USA Per Capita Income" type:Map Image Layer owner:esri_livingatlas> <Item title:"Elevation Coverage Map" type:Map Image Layer owner:esri_livingatlas>
... View more
02-12-2020
04:56 AM
|
0
|
1
|
900
|
POST
|
Greetings, I am trying to find the arcgis Python API extension for VS Code. I was able to find the ArcGIS API for JS API and the AppStudio extension in the marketplace, but not the arcgis Python extension??? Any assistance appreciated. Kind regards, Clive
... View more
02-09-2020
11:37 PM
|
0
|
3
|
5083
|
POST
|
Hi Jeremy, Thanks for the response. I am using the following: in_folder_type = "EXSISTING", in_folder = "Maps" As I am trying to upload the Service to an existing folder called Maps. The Service gets uploaded to a new Folder called "Hosted", not to an existing Folder called "Maps" I don't understand why it is not working as expected ie uploaded to Maps?? Thanks, Clive PS I won't have access to ArcGIS Server till 06th January. Regards, Clive
... View more
12-20-2019
11:52 AM
|
0
|
1
|
1521
|
POST
|
The ArcGIS Pro Stage Service example (https://pro.arcgis.com/en/pro-app/tool-reference/server/stage-service.htm#C_GUID-E4EE691D-C5C2-4F1C-BBC9-D600F4F8689E) works, but it writes to Hosted folder?? # Share to portal print("Uploading Service Definition...") arcpy.UploadServiceDefinition_server(sd_output_filename, "My Hosted Services") I modified the following code from "My Hosted Services" to "Maps". The .sd file is published to the "Hosted" folder NOT the "Maps" folder?? How do I set the Folder to Maps?? Appreciate any assistance. Regards, Clive
... View more
12-20-2019
06:59 AM
|
0
|
4
|
1616
|
POST
|
The Stage Service example is great for a simple project. https://pro.arcgis.com/en/pro-app/tool-reference/server/stage-service.htm#C_GUID-E4EE691D-C5C2-4F1C-BBC9-D600F4F8689E # Reference map to publish aprx = arcpy.mp.ArcGISProject(r"C:\Project\World.aprx") m = aprx.listMaps("World")[0] lyrs = [] lyrs.append(m.listLayers('cities')[0]) lyrs.append(m.listLayers('counties')[0]) If you have a complex project with thirty or more Layers included, do you really have to hardcode all thirty layers?? I have tried to update this using: aprx = arcpy.mp.ArcGISProject(r"C:\apps\APP10\Maps\APR\Map_All_Utilities.aprx") m = aprx.listMaps("*")[0] water_lyrs = ['Water'] water_lyr = [''] steam_lyrs = ['Steam'] steam_lyr = [''] water_lyrs.append(m.listLayers(water_lyr)[0]) for a in water_lyrs(): print(a) water_lyrs.append(m.listLayers(a)[0]) The error is Error: list index out of range Any suggestions??
... View more
12-10-2019
04:32 AM
|
0
|
0
|
406
|
POST
|
Hi Robert, If the fields are not required, it would be easier to toggle them off in ArcMAp. The fields will not be visible to the users and it simplifies the coding in Arcade. Regards, Clive
... View more
11-21-2019
12:35 AM
|
0
|
1
|
1936
|
POST
|
Greetings, I used an online article to install in a disconnected/offline environment, where Powershell is already installed on the machine. URL: https://stackoverflow.com/questions/51406685/how-do-i-install-the-nuget-provider-for-powershell-on-a-unconnected-machine-so-i I copied/exported the repository and also copied the offlinepowershellgetdeploy.nupkg to an folder, that the disconnected machine could connect to. The following modules are installed under C:\Program Files\WindowsPowerShell\Modules: ArcGIS, PowerShellGet, PackageManagement I then used the publish .nupkg command, this completed successfully. ## Install offlinepowershellgetdeploy NuGet.exe install -o extract-directory "offlinepowershellgetdeploy" -source "D:\localhost\LocalPSRepo" I also installed .nupkg for ArcGIS, PowerShellGet, PackageManagement. I then ran PS commands: Get-PSRepository Error: Unable to find module providers (PowerShellGet) Find-Module -Repository LocalPSRepo >> NuGet is required I then get a pop-up window and error message to install NuGet: >> PackageManagement\Get-PackageSource : Unable to find module providers (PowerShellGet) PowershellGet.psd1 is installed @ C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1 ## Get Packages Get-PackageProvider -ListAvailable >> NuGet 2.8.5.208 Any suggestions how to get the offline repository (LocalPSRepo) registered on the disconnected server, is much appreciated.. Clive
... View more
10-09-2019
08:04 AM
|
0
|
0
|
3791
|
POST
|
Greetings, I am trying to loop through the Portal Gallery to get the itemId for all maps and/or apps. I can get the itemId for a single app calling the item = xx e.g. # item = "6f91e6d30e8b4776b23dccb2fc560c94" # print(i['numViews']) When I use the example in https://esri.github.io/arcgis-python-api/apidoc/html/arcgis.apps.hub.html?highlight=itemid, get AttributeError: 'GIS' object has no attribute 'hub.id error. import arcgis from arcgis.gis import GIS from arcgis import apps from arcgis.apps import hub url = "https://myarcgis.com/portal/home/gallery.html" ## https://myarcgis.com:7443/arcgis/home/content.html?start=1&view=grid&sortOrder=desc&sortField=modified&focus=applications-web&searchTerm=#organization ## url = "https://sslvwd1npxapp04.b-intra.net:7443/arcgis/home/content.html?sortOrder=desc&sortField=modified&focus=applications#organization" ### Make a connection to the portal gis = GIS(url=url) myHub = gis.hub a_Initiative = myHub.initiatives.get('itemId *') for i in a_Initiative: print(I) "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\python.exe" C:/Temp/DEV/GetPortalViewCounts.py Traceback (most recent call last): File "C:/Temp/DEV/GetPortalViewCounts.py", line 7, in <module> from arcgis.apps import hub ImportError: cannot import name 'hub' Process finished with exit code 1 Regards, Clive
... View more
10-07-2019
08:38 AM
|
0
|
1
|
876
|
POST
|
greetings, I have just started using the PowerShell Automated Base Deployment, and I am updating the configuration files. I have got an odd error when updating the Install-PreReqs.ps file. The error is: Install-Prereqs.ps1 -ServerMachines ["serverName"] -ModuleSourcePath ["Path\"] Param( [System.Array] << Error at the bracket after .Array $ServerMachines, [System.String] $ModuleSourcePath ) << Error at the closing ")" This is the ESRI code, don't understand the error?? Regards, Clive
... View more
10-04-2019
06:16 AM
|
0
|
1
|
1711
|
POST
|
Hi George, Thanks for the reply. I am on holiday this week, don't have access to the code at work. The code below is a rough copy of the logic used. The only error that I get from Create Relationship is: "the feature is not Registered with the db" # Import system modules import arcpy from arcpy import env # Set environment settings env.workspace = "D:/users/user" ## Copy Data ## Copy the Spatial View to Featyre database = "TESTDB Connection.sde" arcpy.CopyFeatures_management("TESTDB.SpTable_JNS_VW", "TESTDB.SpTable_JN_VW") ##Create Relationship SptTbl = "TESTDB.SpTable_JN_VW" SptData = "TESTDB.Data_JN" # Create simple relationship class between SpTable_JN layer # and Data_JN table with additional parcel owner information SpTable = "SptTbl" relClass = "TESTDB.EQUIP_RelClass" forLabel = "SpTable.EQUIP_ID" backLabel = "SptData.SW_ID" primaryKey = "SpTable.EQUIP_ID" foreignKey = "SptData.SW_ID" arcpy.CreateRelationshipClass_management(SpTable, SptData, relClass, "SIMPLE", forLabel, backLabel, "BACKWARD", "ONE_TO_MANY", "NONE", primaryKey, foreignKey)
... View more
08-21-2018
05:57 AM
|
0
|
0
|
947
|
POST
|
I am working in a Server for ArcGIS 10.3 environment with a Versioned Enterprise Oracle 12.g gdb. We have a number of spatial tables/queries that are renewed every day. The Spatial tables are created joining several tables. We want to create spatial Views on the Default gdb. If I export the required Spatial table/query to a Spatial table they lose the Joined data?? I want to use ArcPY/Python to export the Joined Spatial Table to a Spatial table (SpTable_JN), then create a relationship with a table (Data_JN). This should be a simple task, yet I keep getting an error that the tables cannot be Registered with the database. Has anyone experienced a similar problem and found a solution?? I would appreciate any advice. Kind regards, Clive
... View more
08-21-2018
03:39 AM
|
0
|
2
|
1145
|
POST
|
The ArcGIS Service had crashed. I tried to restart the Service,there is still a Lock. Do I need to stop ArcGIS Service in Windows Services then check the mxd again??
... View more
08-01-2018
06:13 AM
|
0
|
0
|
984
|
POST
|
I am trying to add a feature into Oracle Enterprise Gdb, getting a "Stream not found" error?? The layer is available in SQL Developer, SDE cannot see it?? I tried to Register it, in case it was not present in A/D tables. Still got "Stream not found" error?? Also states there is a Lock conflict?? Any pointers to resolve this would be appreciated.
... View more
08-01-2018
04:13 AM
|
0
|
1
|
1244
|
POST
|
Versioned Oracle Enterprise Gdb using Server for ArcGIS 10.3 It is a couple of years since I have worked on a Versioned EGB and want to confirm my understanding is correct. Any updated Versioned spatial data will not be viewed unless you stop the SOC/SOM i.e. restart the Web Service. Server for ArcGIS 10.4+ does not have SOC/SOM. Where is any information that explains how the new architecture works?? Appreciate any updates, Thanks, Clive
... View more
07-25-2018
03:12 AM
|
0
|
1
|
818
|
Title | Kudos | Posted |
---|---|---|
1 | 02-22-2021 04:17 AM | |
1 | 02-05-2021 07:18 AM | |
1 | 11-06-2020 07:13 AM | |
2 | 07-07-2021 04:20 AM | |
1 | 01-07-2021 02:53 PM |
Online Status |
Offline
|
Date Last Visited |
02-23-2024
07:07 PM
|