|
POST
|
Update: I got it to work! I found the Walk function and was able to use it to reach my goal of listing the fields and their lengths. Thank you so much for your replies, David and Dan! import arcpy
import os
workspace = r'Database Connections\prvgisdb1-GIS-webadmin.sde'
feature_classes = []
walk = arcpy.da.Walk(workspace, datatype="FeatureClass")
for dirpath, dirnames, filenames in walk:
for filename in filenames:
feature_classes.append(os.path.join(dirpath, filename))
for feature_class in feature_classes:
fields = arcpy.ListFields(feature_class)
for field in fields:
if field.length > 255:
print feature_class
print("{0} {1} {2}".format(field.name, field.type, field.length)) -- Allen
... View more
03-03-2020
01:14 PM
|
1
|
0
|
5100
|
|
POST
|
Dan, Thank you for the info about formatting code! I would have never found that on my own. Yeah, the incorrect indentation of the last line turned out to be a copy/paste problem. Thanks!
... View more
03-03-2020
10:38 AM
|
0
|
0
|
5100
|
|
POST
|
EDIT: SEE MY NEWEST REPLY farther down in the discussion - I went with a different approach and got something to work!! Hi David, Thank you so much for sharing this code with me! I really appreciate it. I can see how it makes sense. I tried it out, but it did not work for me - nothing printed. I've been working on making adjustments and trying slightly different approaches, but I have not found a solution. I printed the dataset path along the way and found that the "r" was not part of it, so I was wondering if I should add the "r" back in (In previous versions of my code, I discovered that the "r" is really necessary). Below is my current version. The dataset paths are formed correctly, as far as I can tell. But feature classes within the datasets are never actually listed. There seems to be a problem with "looking inside" the datasets. Does anybody out there have any tips? import arcpy
import os
sde_path = r'Database Connections\prvgisdb1-GIS-webadmin.sde'
arcpy.env.workspace = sde_path
datasets = arcpy.ListDatasets()
dataset_path_list = []
for dataset_name in datasets:
dataset_path = os.path.join(sde_path, dataset_name)
dataset_path_list.append(dataset_path)
read_ds_path_list = []
all_fc_path_list = []
for ds_path in dataset_path_list: # For each dataset path,
read_ds_path = "r'" + ds_path + "'" # Add "r" to it
read_ds_path_list.append(read_ds_path) # Then add it to a different list
for rdp in read_ds_path_list: # For each dataset path in that list,
print rdp #test - this works
arcpy.env.workspace = rdp # Make it the workspace
fcs = arcpy.ListFeatureClasses() # List the fc's in that workspace/dataset.
print fcs # This does not work - prints "None" for each dataset.
... View more
03-03-2020
10:37 AM
|
0
|
0
|
5100
|
|
POST
|
My organization is working on figuring out Data Reviewer and deciding if we want to pursue using it in ArcMap or Pro. It is interesting that the version of Data Reviewer in ArcMap is so much more extensive, and perhaps a little more intuitive, than in Pro. Data Reviewer in ArcMap has such extensive geometry checks, for polygons and lines and points, but Pro only has feature-on-feature and cutbacks. We are in a dilemma of wanting to continue getting used to Pro and creating a Data Reviewer system that we can re-use in future years, which makes us want to use Pro, but then Pro does not have most of the checks we want, so it seems we are going to have to use ArcMap, which is kind of ironic considering the push towards Pro. Anyway, my question is, is there some way to check for geometry issues such as polyline orphans, polygon slivers, etc. in Pro? Like with topology rules or network rules? I have never used the network tools before. I have been doing a lot of Googling and research but have not been able to answer my questions yet. Note that some line feature classes we want to check for orphans are not supposed to be connected with point features at all nodes or vertices, so the edge-junction-edge network connectivity rule would not be applicable for us.
... View more
02-27-2020
01:09 PM
|
0
|
4
|
1972
|
|
POST
|
I am trying to find an efficient way to check the maximum possible field length for many feature classes that are in datasets in an enterprise database system. The problem I'm seeking to solve is that once in a while, a field within a feature class has a field length limit of over a billion characters. The actual data within the field is less than 255 characters, though. So I want to find the long fields and then I will edit the max length to 255. I would love to use Python / arcpy to find the long fields. I have taken a class in Python but am not an expert, and I am brand new to using it in ArcGIS, so it would be great if you could explain things accordingly. thank you!! Here is the code I have so far. It does begin with import arcpy - I forgot to include that in the screenshot. Here it is in a form where you can copy and paste if you want to try it out with your own workspace: import arcpy arcpy.env.workspace = r'Database Connections\prvgisdb1-GIS-webadmin.sde' data_sets = arcpy.ListDatasets() for data_set in data_sets: print data_set # Datasets printed! FCs = arcpy.ListFeatureClasses(data_set) for FC in FCs: print(FC) # Feature classes did NOT print. fields = arcpy.ListFields(FC) for field in fields: if field.length > 255: print("{0} {1} {2}".format(field.name, field.type, field.length)) #Fields did NOT print. It successfully connects to the database and prints the names of the datasets (this printing is for testing purposes). However, nothing else printed. I know the last half of the code does work, though - I have successfully gotten the long fields to print when I told it which feature class to look at. And there are indeed fields over 255 characters, so something should print. Apparently there is some problem in this code where I have tried to put all the pieces together. Any suggestions? Thank you!!
... View more
02-27-2020
09:51 AM
|
0
|
5
|
5292
|
|
POST
|
Thank you! When I manually typed https in front of the URL when viewing the map, I was able to see/use the "find my location" button! I also found out that my organization allows access to AGOL over http. So I will discuss this issue with my supervisor and see if we should change that organization setting. Thanks for your help! Allen
... View more
12-10-2019
11:42 AM
|
0
|
0
|
1988
|
|
POST
|
Thank you for your reply. Ok, good to know. I'm sorry but I don't know much about this issue... is there any way to control whether it happens via http or https, or is it just random chance in a sense? Thank you?
... View more
12-10-2019
10:05 AM
|
0
|
2
|
1988
|
|
POST
|
Hi there, My organization has a web map that shows data collected via Survey123. Field workers are collecting more data on an ongoing basis. We also have staff licensed just as viewers, who don't have access to Survey123. These viewers would like to be able to view the web map when they are out in the field making observations (not submitting data). This would really only work if they can easily see their current location on the web map, so they can tell which data point they are close to. But the web map does not have a "find my location" button. I read in the documentation that it should in theory have one. I tried the web map on my computer (with Chrome), and on my iPhone with both Safari and Firefox. I checked that my phone settings allowed the browsers to use my location. And I was using cell service, not wifi. I never had a button to find my location. The web map is shared only with certain users; it's not public. (And I am the original creator of the web map.) Any ideas as to why this is, and how to get the button? Thank you! Allen
... View more
12-10-2019
09:44 AM
|
0
|
4
|
2057
|
|
POST
|
Oh, that was easy! Thanks for telling me how to do it. Allen
... View more
12-02-2019
10:53 AM
|
0
|
0
|
1442
|
|
POST
|
Hi there, I'm building an ArcGIS Hub site for my organization. There is the main site/page, and linked to it are 7 sub-pages. These pages are tabs on the main site. They are currently not in a logical order, so I would like to reorder them. I've tried dragging them within the list of pages on the left-hand side when I'm in editing mode, but that doesn't do anything. Is there any way to change the order of the pages, so the tabs for the pages are in a meaningful order? Thank you! Allen
... View more
12-02-2019
09:39 AM
|
0
|
2
|
1494
|
|
POST
|
Thanks for your reply, James. It is helpful to know the difference between sharing cards vs. pages. One thing I learned is that I can get the Iframe code from the Insights Page and then paste that into a Rich Text widget in a Dashboard, which works pretty well. this way, it's possible to see the Page content, and the viewer doesn't even have to click on a link. Thanks again! Allen
... View more
10-22-2019
03:29 PM
|
1
|
0
|
3991
|
|
POST
|
Is it possible for Insights cards to be shared/consumed in an Operations Dashboard? I keep seeing that Insights pages can be embedded in StoryMaps or websites, and I also see that Operations Dashboard has an "embedded content" widget, but I am not sure if you can embed Insights cards in a dashboard. Does anyone have the answer? Thank you!
... View more
10-11-2019
04:06 PM
|
0
|
6
|
4635
|
|
POST
|
Is there any news about this topic? I also have the same question as the original poster. Thanks! Allen
... View more
10-10-2019
03:42 PM
|
1
|
0
|
2980
|
|
POST
|
Hi there, My organization has created a Survey123 survey that collects multiple geopoints (they are within repeats, except for the first one). Is there a way to show not only the main geopoint in the map view of the Inbox, but also the geopoints from one of the repeats? Our main geopoints are for homeless camp locations. The additional ones we'd like to have on the Inbox map are access points for these camps, so that users can find the trailhead--so to speak--for the camp that they are doing a follow-up visit for, if the camp is difficult to access. Thanks! Allen
... View more
09-23-2019
01:57 PM
|
1
|
2
|
1114
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 09-30-2025 05:49 PM | |
| 1 | 09-30-2025 03:01 PM | |
| 1 | 09-30-2025 05:42 PM | |
| 1 | 11-01-2023 11:39 AM | |
| 1 | 11-21-2024 04:21 PM |
| Online Status |
Offline
|
| Date Last Visited |
a week ago
|