IDEA
|
It would be very useful to us to be able to print the expanded results of a query in the Zone Lookup app (without the map). As it is, we have to expand all results, highlight the information, and copy-paste to a Word document. It's already a fantastic, very useful app though!
... View more
09-09-2019
07:51 AM
|
3
|
0
|
263
|
POST
|
I figured it out and thought I'd post my code here in case it helps anyone (and in case someone wants to pick it apart - suggestions for improvement are welcome!). from arcgis.gis import GIS import pandas as pd from arcgis.features import SpatialDataFrame gis = GIS(<portal_url>, <username>, <password>") workOrderMaster = GIS().content.get(<itemID>) workOrderFlayer = workOrderMaster.layers[0] workOrderSdf = SpatialDataFrame.from_layer(workOrderFlayer) approvals = GIS().content.get(<itemID>) approvalFlayer = approvals.layers[0] approvalsSdf = SpatialDataFrame.from_layer(approvalFlayer) df=approvalsSdf.sort_values('CreationDate', ascending=True) df=df.drop_duplicates(subset="workOrderId") workOrder_fset = workOrderFlayer.query() approval_fset = approvalFlayer.query() overlap_rows = pd.merge(left = workOrderSdf, right = df, how='inner', on = 'workOrderId') all_features = workOrder_fset.features approval_updates = approval_fset.features for workOrderId in overlap_rows['workOrderId']: original_feature = [f for f in all_features if f.attributes['workOrderId'] == workOrderId][0] update_feature = [f for f in approval_updates if f.attributes['workOrderId'] == workOrderId][0] workOrder_edit = original_feature approval_edit = update_feature workOrder_edit.attributes['apprName'] = approval_edit.attributes['approved_by'] workOrder_edit.attributes['isAppr'] = approval_edit.attributes['approvedecline'] workOrder_edit.attributes['apprDate'] = approval_edit.attributes['approved_on'] workOrder_edit.attributes['apprNote'] = approval_edit.attributes['approvalNotes'] update_result = workOrderFlayer.edit_features(updates=[workOrder_edit])
... View more
09-08-2019
10:57 AM
|
1
|
1
|
2983
|
POST
|
I have what I hope is a simple question. I simply need to use the Python API to update attribute values in a feature layer based on values in another feature layer, using a common ID. Here's the scenario: I have a feature layer of work orders I have another feature layer with approvals for those work orders Both layers have a common work order ID I need a script to check the approvals layer and write "Approved" in a relevant field of the work orders layer for any matching records I need to avoid ArcPy (because the script will run on PythonAnywhere so there's no way to set up the licensing necessary for ArcPy). Thanks in advance, your help is much appreciated!
... View more
09-07-2019
10:08 AM
|
0
|
2
|
3429
|
POST
|
Hello, I've built an application that includes the out-of-the box Sketch Widget. I need to disable the popup for active operational layers when selecting graphics created with the widget (to delete them or use the move/reshape tools). As it is, when the user selects a graphic, it opens the popup for any active layers beneath, meaning they have to close or dock the graphic to get it out of the way before they can interact with the graphic. I assume I need to get the mappoint based on a click event, check it against the graphic's geometry, and set enablePopup to false. Here's my stab at it (at least for polygon graphics): map.on("click", function (evt) { var g = tempGraphicsLayer.graphics; for (var loopCnt = 0; loopCnt < g.length; loopCnt++) { if((g[loopCnt].geometry).contains(evt.mapPoint)){ parcels_noLabel.enablePopup=false } } }); Console shows tempGraphicsLayer as undefined (therefore can't read property "contains"). Help is much appreciated! Thanks.
... View more
08-02-2019
10:25 AM
|
0
|
2
|
3877
|
Title | Kudos | Posted |
---|---|---|
1 | 09-08-2019 10:57 AM | |
3 | 09-09-2019 07:51 AM |
Online Status |
Offline
|
Date Last Visited |
09-18-2024
11:05 PM
|