POST
|
The indents were lost in the cut and paste, its a script that's been in use for over a year. The script is provided to answer the earlier question of how I create a view, which is successfully done. The issue is more about how a view of a feature layer is hobbled in the ability to save to disk when compared to the direct feature layer. BWang, if you provide me an ArcGIS Online username I can add you to a group so you can see it firsthand.
... View more
01-21-2021
10:01 AM
|
0
|
0
|
71
|
POST
|
Here's the Python script I use to create the view. Note that the source feature layer shows in my content as a "Feature Layer (hosted)", whereas the View shows as a "Feature Layer (Hosted, View) from arcgis import GIS from arcgis.features import FeatureLayerCollection print("started") import json import os import csv view_name = "ParcelAtlas Features V2.4 - Example View" firstFIPS = "18069" # Login to the GIS gis = GIS("https://www.arcgis.com", "chuckb", "xxxxxxxxxx") # delete view if exists items = '' gis.content.search(query = view_name) if items: view_exists = gis.content.get(items[0].itemid) print("view deleted: " + str(items[0].itemid)) view_exists.delete() #This is the feature layer we are creating a view into source_fl_id = '33518827e9e24defbacd671bfdXXXXX' src_item = gis.content.get(source_fl_id) source_fl = FeatureLayerCollection.fromitem(src_item) # Create View from Source Hosted Feature Layer new_view = source_fl.manager.create_view(name=view_name) # Search for newly created View view_search = gis.content.search(view_name)[0] view_flc = FeatureLayerCollection.fromitem(view_search) # The viewDefinitionQuery property appears under layers view_layer = view_flc.layers[0] #Now open a txt file that has all the counties (FIPS) we want to incljude in the view f = open(r'C:\\PA_Work_Folder\\'+view_name+'.txt') csv_f = csv.reader(f) #scan all FIPS and build string FIPS = "FIPS IN (" for row in csv_f: #print(row[0]) if row[0] == firstFIPS: FIPS = FIPS + firstFIPS else: FIPS = FIPS + ", " + row[0] FIPS = FIPS + ")" print(FIPS) view_def = {"viewDefinitionQuery" : str(FIPS)} # Update the definition to include the view definition query view_layer.manager.update_definition(view_def) print ("done")
... View more
01-21-2021
07:36 AM
|
0
|
2
|
76
|
POST
|
Thanks Dan. When I run that I get a "Failed to load a resource" error, which is common for this layer, which is 600GB (at one point the largest ever in ArcGIS Online). Esri's had a support case open on this since July and made no progress. To work around, with a regular feature layer I do the selection and then isolate the selection into a standalone layer, which then allows me to save it to disk. It appears that a view doesn't allow the conversion to a standalone layer. I've attached 2 screenshots, one showing the "Make Layer from selected features" option I get when accessing a feature layer, and the other the lack of that option when accessing the same feature layer via a view. Any suggestions are most welcome! Chuck
... View more
01-18-2021
10:49 AM
|
0
|
0
|
136
|
POST
|
I have a large hosted feature layer on ArcGIS Online. I can load it into a map using ArcGIS Pro, then make a Selection using Attributes, then right click on the feature layer and make a new layer from the selection. I then use the Feature Class to Shapefile tool to save it to disk. We have multiple clients that access this layer, and we manage their access using Views, tailored to match their geographical area of interest (e.g. subscription). They need to save content to disk for selections they make. When the process is applied to a view, the "Make Layer from Selected Features" is not offered. I've tried enabling editing and so forth in the Settings for the view, without any impact. Is there a workflow that enables a view selection to be saved to disk as actual content, as opposed to a pointer to the content? Thanks in advance for helping! Chuck
... View more
01-18-2021
08:15 AM
|
0
|
6
|
147
|
POST
|
I'm running a 64 bit Windows Server 2016 with ArcGIS Pro 2.4.0, Anaconda3, Python 3.7, and Jupyter. The simple line "import archly" fails within a Jupyter notebook, but runs fine from the Pro Python prompt. Any suggestions on how to enable Jupyter to find arcpy? Chuck
... View more
09-19-2019
01:16 PM
|
0
|
0
|
89
|
POST
|
I have a tiled service which becomes blank when on zooms in beyond the tile limits. I would like to add a layer that displays a watermark message when zoomed that far in. I've tried following the guidance at How To: Add a watermark to a map service created a watermark .bmp, and applied that as a 3D texture fill symbol to a polygon feature class that I have added to my map as a layer. In the guidance, it states: 2.In ArcMap, open the new empty feature class and draw a polygon that covers the entire area of the data frame. I'm clearly not accomplishing that, I seem to be missing some aspect of creating a polygon that is tied to the feature class. Anybody have an ideas on what I'm missing? Chuck
... View more
10-04-2018
01:31 PM
|
0
|
0
|
84
|
POST
|
Richard, Thanks for the insights. This is coming from a shapefile that was used to create the feature layer I'm working with. I have escalated this to an ESRI support request, still getting things sorted out. Chuck
... View more
08-19-2018
10:00 AM
|
0
|
1
|
329
|
POST
|
I've escalated this to a formal ESRI support request. I'll post the results!
... View more
08-06-2018
04:39 PM
|
0
|
2
|
67
|
POST
|
It has worked on smaller datasets in the past. However, I just tried it with this dataset and it did not work. I was able to limit the search to a previous selection that was bounded by a rectangle, giving a fast processing time. However, I also change the test to "STATE"="MA", which should return all the parcels in the previous selection, and I get nothing. So I suspect its a more fundamental issue. This content is coming in from AGOL, whereas before it came from a standalone ArcGIS Server. I'm starting to wonder if that's part of the issue here. I'm thinking I need to focus on the "STATE"="MA" issue first, before chasing the text vs. int issue. All that said... I do see everything I should when I do an identify...
... View more
08-06-2018
10:56 AM
|
0
|
3
|
67
|
POST
|
In the other thread it was suggested I use "Select from Current Selection", which makes sense. In this case, I've substituted "SUBSET_SELECTION" for "NEW_SELECTION", and made a rectangular selection of a small area before running the script. Same sort of delay, but I didn't see the Code 504 error.
... View more
08-06-2018
10:23 AM
|
0
|
0
|
159
|
Online Status |
Offline
|
Date Last Visited |
3 weeks ago
|