POST
|
Good points Xander Bakker. I have included example info and fixed the mentioning. Thanks.
... View more
02-26-2015
07:09 AM
|
0
|
2
|
1036
|
POST
|
I'm having a little trouble setting up this script. Here are the bullet points. 2 Tables have the same three fields. [SiteID], [EasyID], [FeatureID]. For simplicity, lets pretend these are the only fields (besides OID). [FeatureID] is a unique integer for each feature created in Table 1. [SiteID] is a non-unique integer and groups features by location. [EasyID] is a string (typically a number) unique within the same [SiteID], but not unique in the field. Table 1 - The master table. New features have all three ID fields populated. Table 2 - New features always have [SiteID], sometimes [EasyID], and never a [FeatureID]. Table 2 - Features with [SiteID] and [EasyID], and no [FeatureID] may have a matching [SiteID] and [EasyID] in Table 1. If so, update [FeatureID] in Table 2. Table 2 - Features missing [EasyID] need to be assigned the next number for that [SiteID] in either Table 1 or 2. If current EasyID's for a site are '1', '3', '4A', '6-7','S', and '55', new features would be '2', '4', '5', '6', '7', '8'....etc. Table 2 - New features given a [FeatureID] when inserted into Table 1. The features are then updated in Table 2. Table 1 - Finally, any features with a [SiteID] in Table 2, but the [FeatureID] and [EasyID] are not in Table 2, are inserted into Table 2 At the end of the script both tables should match. I've looked through using model builder with no luck. With python dictionaries and search cursors i'm getting stuck trying to join against [SiteID] and [EasyID] at the same time. I am also don't know how to return the dictionaries with just integer EasyID's and loop through updating the next smallest integer. Here is what I've got so far. Much of it stems from what I read from Richard Fairhurst's post Turbo Charging Data Manipulation with Python Cursors and Dictionaries import arcpy
#Tables
T1 = r"C:\Python\Scratch.gdb\Table1"
T2 = r"C:\Python\Scratch.gdb\Table2"
fields = ["FeatureID", "SiteID", "EasyID"]
# Get FeatureID dictionaries for each Table
T1Dict = {r[0]:(r[0:]) for r in arcpy.da.SearchCursor(T1, fields)}
T2Dict = {r[0]:(r[0:]) for r in arcpy.da.SearchCursor(T2, fields)}
# Get SiteID+EasyID dictionaries for each Table
T1ConcatDict = {str(r[1]) + "," + str(r[2]):(r[0]) for r in arcpy.da.SearchCursor(T1, fields)}
T2ConcatDict = {str(r[1]) + "," + str(r[2]):(r[0]) for r in arcpy.da.SearchCursor(T2, fields)}
#First, If T2.FeatureID is Null but T2.EasyID and T2.SiteID are in T1, Update T2.FeatureID
with arcpy.da.UpdateCursor(T2, fields) as updateRows:
for updateRow in updateRows:
# store the Join value by combining 3 field values of the row being updated in a keyValue variable
keyValue = str(updateRow[1]) + "," + str(updateRow[2])
# verify that the keyValue is in the Dictionary
if keyValue in T1ConcatDict & updateRow[0] is None & updateRow[1] is not None:
# transfer the value stored under the keyValue from the dictionary to the updated field: FeatureID.
updateRow[0] = T1ConcatDict[keyValue][0]
updateRows.updateRow(updateRow)
#Rebuild Dictionary if it is needed again
T2ConcatDict = {str(r[1]) + "," + str(r[2]):(r[0]) for r in arcpy.da.SearchCursor(T2, fields)}
T2Dict = {r[0]:(r[0:]) for r in arcpy.da.SearchCursor(T2, fields)}
'''
#Get Max(EasyID) within SiteID
NumberList = []
for value in T1Dict[2]:
try:
NumberList.append(int(value))
except ValueError:
continue
T1EasyNumberDict = [s[2] for s in T1Dict[2] if s.isdigit()]
T1MaxEasyDict = max(T1EasyNumberDict)
'''
#Second, If T2.FeatureID and T2.EasyID are Null, Update T2.EasyID with next smallest number (as string) in either T1 or T2 for the specific SiteID
with arcpy.da.UpdateCursor(T2, fields) as updateRows:
for updateRow in updateRows:
# store the Join value by combining 3 field values of the row being updated in a keyValue variable
keyValue = str(updateRow[1]) + "," + str(updateRow[2])
# verify that the keyValue is in the Dictionary
if keyValue in T1Dict & updateRow[0] is None & updateRow[1] is None:
# transfer the value stored under the keyValue from the dictionary to the updated field.
# Perhaps retrieve max int occurs here?
updateRow[2] = max(T1Dict[keyValue][2], T2Dict[keyValue[2])
updateRows.updateRow(updateRow)
#Third, Insert into T1 if T2.SiteID is not null and T2.EasyID is not null
#Forth, Update T2.FeatureID with T1.FeatureID from previous insert where T2.SiteID=T1.SiteID and T2.EasyID=T1.EasyID
#Lastly, Insert any T1 features into T2 where T1.EasyID not in (Select EasyID from T2 where T2.SiteID = T1.SiteID) and T1.FeatureID not in (Select FeatureID from T2)
Thank you for any advise. Edit: Here is a sample of sites with 2 explanatory columns T1.FeatureID T2.FeatureID T1.SiteID T2.SiteID T1.EasyID T2.EasyID Status Result 358589 358589 136238 136238 1 1 Existing T1 and T2 Feature No Change 358590 358590 136238 136238 2 2 Existing T1 and T2 Feature No Change 358594 358594 136238 136238 4 4 Existing T1 and T2 Feature No Change 652538 652538 136238 136238 5 5 Existing T1 and T2 Feature No Change 486028 486028 136238 136238 8 8 Existing T1 and T2 Feature No Change 486029 486029 136238 136238 9 9 Existing T1 and T2 Feature No Change 525300 525300 136238 136238 34 34 Existing T1 and T2 Feature No Change 574802 574802 136238 136238 998 998 Existing T1 and T2 Feature No Change 670911 136238 300 New T1 Feature (Step 6) Inserted Into T2 493840 136238 9996 New T1 Feature (Step 6) Inserted Into T2 493839 136238 9997 New T1 Feature (Step 6) Inserted Into T2 493831 136238 9999 New T1 Feature (Step 6) Inserted Into T2 696019 136238 105-106 New T1 Feature (Step 6) Inserted Into T2 696037 136238 9999N New T1 Feature (Step 6) Inserted Into T2 696014 136238 Area1 New T1 Feature (Step 6) Inserted Into T2 670910 136238 N New T1 Feature (Step 6) Inserted Into T2 580636 136238 N30c New T1 Feature (Step 6) Inserted Into T2 360401 136401 AC Exiting T1 Feature (Skip) Not Inserted since no T2.SiteID match 360402 136401 SP Exiting T1 Feature (Skip) Not Inserted since no T2.SiteID match 360510 136427 Area 1 Exiting T1 Feature (Skip) Not Inserted since no T2.SiteID match 362653 136635 15 Exiting T1 Feature (Skip) Not Inserted since no T2.SiteID match 362943 362943 136698 136698 1 1 Existing T1 and T2 Feature No Change 362944 362944 136698 136698 2 2 Existing T1 and T2 Feature No Change 362945 362945 136698 136698 3 3 Existing T1 and T2 Feature No Change 362946 362946 136698 136698 4 4 Existing T1 and T2 Feature No Change 362947 362947 136698 136698 5 5 Existing T1 and T2 Feature No Change 362950 362950 136698 136698 11C 11C Existing T1 and T2 Feature No Change 362948 362948 136698 136698 8 New T2 Feature, Exists in T1 (Step 5) Update T2.EasyID 362949 362949 136698 136698 9 New T2 Feature, Exists in T1 (Step 5) Update T2.EasyID 362951 136698 136698 15 15 New T2 Feature, Exists in T1 (Step 1) Update T2.FeatureID 362954 136698 136698 16 16 New T2 Feature, Exists in T1 (Step 1) Update T2.FeatureID 362955 136698 136698 17 17 New T2 Feature, Exists in T1 (Step 1) Update T2.FeatureID 362956 136698 136698 18 18 New T2 Feature, Exists in T1 (Step 1) Update T2.FeatureID 362957 136698 136698 19 19 New T2 Feature, Exists in T1 (Step 1) Update T2.FeatureID 136698 20 New T2 Feature (Step 3,4) Insterted into T1, Update T2.FeatureID 136698 21 New T2 Feature (Step 3,4) Insterted into T1, Update T2.FeatureID 136698 22 New T2 Feature (Step 3,4) Insterted into T1, Update T2.FeatureID 136698 25 New T2 Feature (Step 3,4) Insterted into T1, Update T2.FeatureID 136698 New T2 Feature (Step 2,3,4) Get next lowest integer for T2.EasyID -> 6 136698 New T2 Feature (Step 2,3,4) Get next lowest integer for T2.EasyID -> 7 136698 New T2 Feature (Step 2,3,4) Get next lowest integer for T2.EasyID -> 10 136698 New T2 Feature (Step 2,3,4) Get next lowest integer for T2.EasyID -> 11
... View more
02-26-2015
12:57 AM
|
0
|
14
|
6406
|
POST
|
Give the layer a filter in the webmap feeding the Geoform. It can be anything like ObjectID = 0 so the no features show after form submission. If you want them to see their Dot after submitting you can try Filter by CreationDate = CURRENT_DATE(), but the user will see any from same time frame.
... View more
02-21-2015
06:50 PM
|
0
|
0
|
300
|
POST
|
Looks like javascript table editing is creeping into the realm of possibility with FeatureTables In beta now but readOnly:false will be great. I played around with the dgrid and its still a little sketchy with large tables. Someday.
... View more
02-21-2015
02:21 PM
|
0
|
0
|
746
|
POST
|
I have been referring to the Resource Center for a long time and it is still difficult to find the right information. Road blocks constantly occur when I'm trying to update the definition of a hosted layer and the syntax needed isn't in the examples. Lets take a look at my latest scenario. Common data types - Labeling Objects - Nowhere under any of these objects does it say whether or not they are supported when administering hosted services. Since "labelingInfo" is a property that exists in hosted services, why wouldn't the labeling object be supported? This is the example that is provided in the resources: {
"labelPlacement": "esriServerPointLabelPlacementAboveRight",
"labelExpression": "[NAME]",
"useCodedValues": false,
"symbol": {
"type": "esriTS",
"color": [38,115,0,255],
"backgroundColor": null,
"borderLineColor": null,
"verticalAlignment": "bottom",
"horizontalAlignment": "left",
"rightToLeft": false,
"angle": 0,
"xoffset": 0,
"yoffset": 0,
"kerning": true,
"font": {
"family": "Arial",
"size": 11,
"style": "normal",
"weight": "bold",
"decoration": "none"
}
},
"minScale": 0,
"maxScale": 0,
"where" : "NAME LIKE 'A%'" //label only those feature where name begins with A
} This is my labelinginfo: {
"labelPlacement" : "esriServerPointLabelPlacementBelowCenter",
"labelExpression" : "[TAG]",
"labelExpressionInfo" : { "value" : "{TAG}"},
"useCodedValues" : false,
"symbol" : {
"type" : "esriTS",
"color" : [224, 215, 255, 255],
"backgroundColor" : null,
"borderLineColor" : null,
"verticalAlignment" : "top",
"horizontalAlignment" : "center",
"rightToLeft" : false,
"angle" : 0,
"xoffset" : 0,
"yoffset" : 0,
"font" : {
"family" : "Arial",
"size" : 9.75,
"style" : "normal",
"weight" : "bold",
"decoration" : "none"
}
},
"minScale" : 36000,
"maxScale" : 2000
} They are similar, but how come there is no documentation for "labelExpressionInfo" and how to modify it? Why do "backgroundColor" and "borderLineColor" remain null after I've set them to [38,115,0,255] yet UpdateDefinition succeeds without any issues? Why is "where" in the example, but will not stick when I try to add "TAG LIKE 'A%'"? I would love to get rid of null labels that fill up the screen. Earlier this week, I contacted esri support for a question on REST functionality. The receptionist said I wasn't covered since I didn't have ArcGIS for Server. I was baffled. Desktop, EDN, and AGOL annual fees aren't enough? The link at the top of my services directory page points to the same REST API Resource Center. So why is it so difficult to identify which objects and their properties can and can't be altered?
... View more
02-20-2015
03:05 PM
|
1
|
0
|
3876
|
POST
|
I would imagine that this is difficult to reproduce because the feature service was originally published in 2013. I cannot put out a new version until field staff complete their work this week. As a side effect, the 1400 photo attachments are currently eating 90 credits a day in feature storage fees. Chomp chomp.
... View more
02-19-2015
03:23 PM
|
0
|
0
|
352
|
POST
|
Well I solved it and this is indeed a bug. The feature service in question was republished and was given a new field for GlobalIDs. So it has a string field named "GlobalID" and an esriFieldtypeGlobalID field named "GlobalID_2". Copying features also copies the value that should be unique! This is why the first feature that is copied has the photo attachments of future features. Perhaps other sync issues are related to this failure to generate unique IDs. Be careful what your users copy! Edit: I read something interesting about copying with relationships: http://resources.arcgis.com/en/help/main/10.2/index.html#/Relationship_class_properties/004t00000004000000/ When you split a feature, the original feature is maintained (with updated geometry), and a new feature is created. If you have a relationship based on the original ObjectID, only one of the two features created in the split will maintain the relationship. However, if you used another field as the key, when you split the feature, the ID value of the original feature would be copied to the two new features. As a result, the records in the related table would now be related to both new features—ideal if the relationship class is set up as many-to-many.If you won't be splitting features and are sure that all objects will remain in their original class, you can use the ObjectID as their IDs. If you can't guarantee this, it's best to set up and use your own ID field instead of relying on the ObjectID field.
... View more
02-10-2015
03:50 PM
|
0
|
2
|
352
|
POST
|
Thanks Robert, I had seen a tool on github a while back and didn't know if someone had made a widget similar to it. Ideally editing would be standard functionality built in like Flex Viewer.
... View more
02-05-2015
02:25 PM
|
0
|
0
|
746
|
POST
|
Is there a widget with these functionalities?: Editing individual cells like Excel Field Calculating selected features like in ArcMap? Thanks, Davin
... View more
02-05-2015
01:57 PM
|
0
|
5
|
4690
|
POST
|
I'm still working with support, but I'm posting in case anyone else sync problems that could be due to this issue. The bug occurs when I use continuous stream or copy features that have photo attachments; in other words, "Like the last one" functionality. My features are displaying the same attached photos. Sync Fails. If i delete one they both lose all photos. Sync Still Fails. If I delete all features. Empty Sync Succeeds. Here are images of the 1st and 5th test feature i took. for each feature i copied the previous and attached a photo via camera. but the 1st feature shows the attachments collected on the later features. Here is what happens on the 1st sync attempt During second attempt, the progress bar quickly moves to 99% but hangs indefinitely. Details: 10.3 version of Collector on 2 different Samsung Tab 3 7" and a Samsung S5 Reproduced in 2 different web maps with same hosted layers Arcmap's Copy Runtime Geodatabase to File Geodatabase tool produces features with duplicate attachments. Could not reproduce in different hosted layers in separate web map. The attachments were not carried over when copying a feature Initial download for offline mode has no issues I'll update when this gets resolved.
... View more
02-05-2015
11:18 AM
|
0
|
3
|
4244
|
POST
|
Thanks for the response Mike. I'm definitely willing to discuss these topics further. The community would benefit from having a roadmap to accompany the "What's New" Page. This should be a little more detailed than the Operations Dashboard Sneak Peek. Thanks, Davin
... View more
01-26-2015
06:59 AM
|
0
|
0
|
440
|
POST
|
I was also having issues with the default print service. Even though it says "Esri Default", it wasn't working. So I pasted in an invalid url and clicked save before the message box popped up. Went back into setting and it still said "Esri Default." Saved again and it magically allowed printing from map viewer and web appbuilder, But from hosted content only. Esri print service does not appear to receive the encrypted credentials for non hosted layers. In case it helps, I was testing with a private local feature service accessed from a non SSL IIS with the web adaptor.
... View more
01-21-2015
07:43 AM
|
0
|
4
|
1114
|
POST
|
ArcGIS Online and the supporting web API's are missing functionalities required for each department in my company. While I'd rather continue integrating the online platform into our business model, I must resolve a list of ongoing issues preventing my company from moving to the next level. I'm looking for opinions on how long it will be, if ever, until functionalities will exist that resolve each of the topics below: Hosted feature service two-way replication with local databases, geodatabases, or tables Organization level management of hosted symbology Layer rendering allowing text to be used for symbols (not picture marker symbols) Symbology for hosted services comprised of multiple Symbol Objects (i.e. simple circle with text in the center, big square with little circle) Smarter and more legible labeling for hosted feature services A single, streamlined version of Esri basemaps for both offline and online data collection Zooming in beyond 1:1,128 in Map Viewer, Collector, and Javascript API even if that means stretching level 19 tiles Dynamic default values for fields in hosted layers or geodatabases across the platform (Expressions for default values that don't need to be coded for each application. Like you can do with ArcPad and with Attribute Assistant) Hosted feature service triggers within the REST API (after insert, on update, on delete...etc. Like Attribute Assistant Add-in) Related feature editing Polygon and lasso selection in Map Viewer Field calculating only selected features in Map Viewer, instead of the all features queried with the simple non-spatial filter (alternatively: set filter to selected features similar to ArcMap's Create Layer from Selected Features) Field calculation for regular users in Map viewer and with Javascript API (within attribute tables or a widget for Web AppBuilder) Efficient editing of features via attribute tables when using Map Viewer and Javascript API Performance improvements that greatly raises Esri's recommended MaxRecordCount of 1000 for editable layers So what do you all think? 1 year...5 years...Never? As the administrator for our organization, am I expecting too much from Esri's commercial off the shelf? Bottom line, I must decide whether to wait for ArcGIS Online and the associated apps to become robust enough for my company needs or dedicate time to identify an alternative strategy.
... View more
01-21-2015
07:01 AM
|
2
|
2
|
4637
|
POST
|
After stumbling on this REST API Calculate Page (http://resources.arcgis.com/en/help/arcgis-rest-api/#/Calculate_Feature_Service_Layer/02r30000029n000000/), I'm curious if there is a sample implementing this call in javascript. For example: User selects features User Clicks Calculate button Field C values are calculated as Field A * Field B for the selected Features. This would be a great work around for the lack of dynamic default values for fields.
... View more
01-13-2015
09:00 AM
|
0
|
0
|
3996
|
POST
|
Does anyone know of a web app example where popups show a relationship between the feature layer and external data? For instance, connecting editable values in a popup or custom widget to a Google sheet, fusion table, or a SQL Web Service. Adding a new feature triggers external row creation and future updates are possible due to the related field. I'm more comfortable with JavaScript, but really an example in any language would be great! Thanks, Davin
... View more
11-07-2014
11:57 PM
|
0
|
0
|
619
|
Title | Kudos | Posted |
---|---|---|
1 | 09-22-2022 01:52 PM | |
1 | 06-22-2022 12:38 PM | |
12 | 06-09-2022 11:53 AM | |
1 | 10-16-2015 11:30 PM | |
1 | 02-27-2015 07:40 AM |
Online Status |
Offline
|
Date Last Visited |
03-21-2024
08:58 PM
|