POST
|
I have a workflow scripted in which I export a Pandas dataframe to a geodatabase table using the method: df.spatial.to_table(out_table_path) After upgrading Pro to 3.2, I noticed that my script changed how it was handling dates. After a little digging, I found that my dataframe fields with a datetime64[s] data type were casting to the new ESRI 'Time Only' field during the conversion to a geodatabase table, despite containing both dates and times. This is obviously a deviation from the behavior in older versions of Pro, which had only a single type of field for handling date times. My Question: Is this the expected behavior, or a bug? Anyone else having problems? I haven't been able to find good documentation on how the new ESRI date time field types work with the arcgis.features module. I did find, via some trial-and-error, that I could get what I needed by forcing my pandas field datatype to datetime64[ns] prior to export, but this doesn't feel like it should be necessary and is far higher resolution than what I need for my data. Thanks, JF
... View more
02-20-2024
08:32 AM
|
0
|
2
|
233
|
IDEA
|
Idea Allow fields to remain editable when an Arcade Expression is used to calculate them. Reasoning Calculated expressions are great at improving efficiency in field operations, but in advanced use cases they don't always work the way I expect them to. Some of it may be user error on my part, but because I can't rely on my expressions, I generally end up not using them. Allowing the field to remain editable would increase usability in the shoulder cases where my expressions fail to return expected results. Example I provide GIS support for a forest monitoring crew. The crew maps trees in plots and fills out a bunch of information about each tree. To keep track of trees over time, each tree gets a unique identifier. I wrote an Arcade expression to create the tree ID on the fly whenever a new tree is mapped. The expression uses a geometry intersect to determine which plot the tree is in. Then it counts all the existing trees in that plot and adds 1 to the number of existing trees. Finally it returns the plot and tree number in a nicely configured format. Works like a charm, when it works. Unfortunately, it doesn't work when the accuracy threshold for data collection hasn't been met. In these cases, no point exists to do the geometry intersect, but arcade still proceeds with the calculation. It looks like it errantly picks the first plot in the list by default and returns me a blatantly wrong ID. Would be great if I could go back in and manually input the ID in these cases.
... View more
08-22-2023
04:25 PM
|
45
|
28
|
2136
|
POST
|
Bumping this thread again. I've gotten custom date ranges to work with this method: from arcgis.gis import GIS
gis = GIS('home')
item = arcgis.gis.Item(gis, itemid="########################")
date_1 = datetime.datetime(2023,7,2)
date_2 = datetime.datetime(2023,7,20)
usage_stats = item.usage(date_range=(date_1, date_2),as_df=True)
usage_stats BUT, any custom dates over a year old fail. Well, technically I don't get an error. I just get an empty dataframe. Or an empty dictionary if I use "as_df = False". Is this the expected behavior, or a bug?
... View more
07-21-2023
10:44 AM
|
0
|
0
|
372
|
POST
|
Fair enough. I was getting the same error as OP, so assumed it was related. @ShaunWalbridge do you have any additional insight as to why XTools is interfering with arcpy? I wasn't a huge XTools Pro user to begin with, so removing it isn't a big deal for me. But some of my colleagues will be less thrilled with the guidance 'just remove XTools'.
... View more
05-16-2023
03:29 PM
|
0
|
0
|
1105
|
POST
|
Thanks @KevinCheriyan for bringing up this issue, and to @Wolf and @EvanThoms for some insight. I was experiencing the same issue and removing XTools Pro solved it. I'd also be interested in seeing a bug number if available, to forward to the GIS community in my organization.
... View more
05-16-2023
05:08 AM
|
1
|
0
|
1128
|
POST
|
Hi kap, I used a portion of your code to automate my own replica unregistering. I'm not sure why your code isn't working, but I don't think it's the URL. Granted I did mine a smidge differently, but the URL looks fairly similar to the one you commented out. If I had to guess, it might have to do with the token. I get lost in the weeds a little bit when it comes to account security, so I use Jupyter Notebooks tied to ArcGIS Pro, where I'm signed in to Pro with the same account as my AGOL account. You'll notice I don't need to pass credentials to 'GIS()' or a token value to my URL. I think Pro handles all that for me. Just a thought - I'm not sure. At any rate, here is my code that worked: import arcgis
from arcgis.gis import GIS
import arcgis.features
gis = GIS()
grove_layer = arcgis.gis.Item(gis, itemid="xxxxxxxxxxxxxxxxxxxxxxx")
grove_layer_flc = arcgis.features.FeatureLayerCollection(grove_layer.url, gis)
replica_list = grove_layer_flc.replicas.get_list()
for r in replica_list:
replica = grove_layer_flc.replicas.get(r['replicaID'])
replica_id = replica["replicaID"]
print('Unregistering ' + replica_id)
grove_layer_flc.replicas.unregister(replica_id)
... View more
02-24-2023
10:17 AM
|
1
|
0
|
476
|
POST
|
For anyone else stumbling upon this problem in the future, I was able to troubleshoot the issue. The problem was solved by changing the portal URL in line 1 to the 'plain jane' ArcGIS Online (as opposed to our organization's modified URL for ArcGIS Online). var portal = Portal("https://www.arcgis.com")
... View more
07-12-2022
02:34 PM
|
0
|
0
|
393
|
POST
|
I have a dashboard utilizing data expressions to summarize some field survey data on the fly. The expressions work for everyone with whom the dashboard is shared - as long as they're in my organization. Outside the organization, the elements referencing the data expressions have a "Data Source Error" message. I'm wondering if this has to do with how I'm pulling the data in as a FeatureSetByPortalItem, i.e. // Set portal and layers
var portal = Portal('your portal URL');
var fs = FeatureSetByPortalItem(
portal,
'itemID of service',
layer index,
['list', 'of', 'fields'],
false
); Is calling in the data through my portal preventing users outside my portal from accessing the data, even though they have access via a share group? If so, is there another way to call in the data so that they maintain access? Can't seem to figure out another reason these elements would fail. Everyone in the share group has access to all feature layers, web maps, and the dashboard itself. Thanks, Josh
... View more
07-12-2022
12:04 PM
|
0
|
1
|
426
|
POST
|
I have a Field Map that is showing some unusual behavior regarding syncing. We'll get a 'Sync Failed' message. However, when looking a little closer, the data has actually been synced. Does anyone have any documentation or insight into why this would happen? Or is it just a glitch. We'd like to prevent the issue in the future, if we can.
... View more
07-08-2022
11:24 AM
|
0
|
4
|
607
|
POST
|
I assume the original poster may have resolved this issue or found a work-around by now, since it's a year and a half later. I stumbled upon this thread because I had a similar problem. In case it's helpful for the next folks, I found these resources which helped me diagnose the problem. FAQ: What are the reasons fields cannot be added to a hosted feature layer on the ArcGIS Online Data tab? (esri.com) BUG-000119730: In ArcGIS Online, after running the Join Features to.. (esri.com) In my case, the problem turned out to be the aforementioned bug. Once you create a join on your hosted feature layer, the add data capability gets turned off. I'm working around the problem by republishing the layer. It might be possible to solve it by removing the join layers, but I haven't tested that approach. Cheers!
... View more
06-10-2022
08:57 AM
|
2
|
2
|
2294
|
POST
|
Thanks Dan, you've both answered my question and provided me exactly the reference I was looking for to dig deeper! Looks like there is a handy line in the insert cursor for explicitly printing which rows are not being appended. If I have time, I will try to manually re-engineer the process and try to use that print statement to figure out why certain rows weren't being inserted into my table. To get the job done in the meantime I'll stick with to_csv.
... View more
04-19-2022
08:01 PM
|
0
|
0
|
1148
|
POST
|
I'm using the arcgis .to_table() method to convert a pandas dataframe to a GIS table. However, I'm losing records from my table in the process. My dataframe has 51,970 records. My table in GIS only has 45,314 records. If I export the exact same dataframe to csv, the records are there - so I can use the csv if necessary to construct my table in ArcGIS. But, I'm curious to find out what's going on. I already ran a function to convert the object data types to strings, and I tried resetting the index right before export. I end up with the same result. So, I'm wondering if there's a maximum number of records that the .to_table() method can handle? If not, I must be missing something in the data that I can investigate more fully.
... View more
04-19-2022
04:10 PM
|
0
|
2
|
1216
|
POST
|
Thanks Rich, that did it! My problem was that I was working in the new Map Viewer (in order to create a dashboard off the same map). Of course, the new Map Viewer doesn't have the capability to add new fields in the way you suggested, so I had to create a duplicate map for Map Viewer Classic. I have to say that the redundancy is a little frustrating. But, I guess since WAB was built to talk with map viewer classic anyway, it's probably a best practice for me to keep in mind moving forward: use whichever map viewer is most compatible with the app you're building!
... View more
03-21-2022
12:43 PM
|
1
|
0
|
1087
|
POST
|
Hi AGOL WAB community. I realize there are newer apps available for use now, so WAB may not be getting much attention these days. That said, WAB has a function that newer apps don't have yet: batch attribute editing. I've tried to set up a simple WAB just for batch attribute editing and it works nicely. That said, I'm encountering an issue that I can't seem to figure out. After demo-ing the WAB product to our customer, I got the request to add a comments field to the batch editor. Instead of republishing the whole feature service, I just added a comments field to the feature layer via its 'Data' tab. I made sure the field was editable and visible in the pop-up. I even added the field to map's 'form', even though I understand this newer setting is not being communicated to the older WAB. But, here's the issue - the new field doesn't show up when I go in to the app to re-configure the Batch Edit tool. It's not a selectable field in the list. I can't figure out why. It doesn't even show up if I try to start a new WAB from scratch. I can edit the field within the web map viewer on a feature-by-feature basis, so I think I've configured the editing privileges properly. Any insights from the community? Has this happened to anybody else? Is this a bug? Many thanks for any info.
... View more
03-21-2022
09:23 AM
|
0
|
3
|
1130
|
POST
|
Hi Josh - I actually used some of your other responses here on GeoNet to work out how to re-arrange my data; in case you don't hear it enough, thanks for being a contributor. I'm sure I'm not alone in having learned from your experience/expertise. I'm talking to a feature layer, not a map image layer, but I did figure out the issue. I was charting off of Inspection Group and Inspection Status. I thought Trail Name could still be used as a filter, but I overestimated the ability of the Dashboard in that respect. When I charted off of Trail Name, the filter worked. One additional issue I noticed is that, when attempting to filter the chart based on map extent, the whole chart breaks down. It will just return 'No Data'. To the best of your knowledge, is that just a limitation of the data expressions? I'm guessing it's just too much processing to occur any time the map is adjusted.
... View more
03-16-2022
08:48 AM
|
0
|
1
|
502
|
Title | Kudos | Posted |
---|---|---|
1 | 02-24-2023 10:17 AM | |
45 | 08-22-2023 04:25 PM | |
1 | 05-16-2023 05:08 AM | |
1 | 08-10-2021 11:51 AM | |
1 | 08-10-2021 10:56 AM |
Online Status |
Offline
|
Date Last Visited |
02-22-2024
06:01 PM
|