|
POST
|
I have done this in the past with using a searchcursor to get the SHAPE@ field. With the SHAPE@ object you can get firstpoint/lastpoint of the line. ( line[1].lastPoint.X,line[1].lastPoint.Y ) I then iterate through each line and grab the first point (from the line) and use that point to make a feature layer so that I can use it to Select by Location the appropriate manhole ad get it's ID. Then I use an update cursor to assign this MH id to the UpstreamMH field. Then, Select by Location using the last point, grab that MH id and update cursor to the DownstreamMH field. I would think you could do this fairly easy with Arcade as well using the paths of the line, but have not looked into it. The main benefit of using Arcade is that you could also use it to make an attribute rule that will populate these values automagically in the future when editing/adding new features. R_
... View more
03-04-2024
09:14 AM
|
1
|
2
|
2562
|
|
POST
|
Looks like they've added that as an 'upsert' option. I must have misunderstood your original post, and thought you were trying to update attributes based on a common field, not add new features to the data at the same time. So, suggested an appropriate set of tools for that operation instead of one that has now added that functionality to it as well. I will have to play with these options in the future when I get time and see what I can find out. R_
... View more
02-28-2024
02:26 PM
|
0
|
0
|
2076
|
|
POST
|
You say it is snapping without any other layers? Do you by chance have the grid turned on with snapping? R_
... View more
02-28-2024
09:47 AM
|
0
|
1
|
2395
|
|
POST
|
"I do know that if I click on "Open in Field Maps Designer" when I am looking at the Overview page for a Web Map, this will change the order of the fields in Field Maps despite no form being set up." Not sure what this means. Where are you seeing these changes? Field Map Designer shouldn't change anything unless you Save changes. If you have ever modified the Form, then changed it (you can now save form changes to the HFL or the map), it will completely change the behavior. I.e., if I don't have a Form, just the default popup, then Field Maps will use that as the "Form" for entering data. If I have a form and delete it, Field Maps App will no longer see ANY of the fields and just allow you to enter geometry until a new form is created. In my testing, if I delete all the Form entries, then "Convert Popup" in the Forms panel, it will add all the values from the configured popup and maintain the order. If I have made any changes to the popup with Map Viewer Classic, that will be the new order that the Forms will see, not the original order from Pro. Is yours behaving differently than this? Since Field Maps was set up to work with Forms, why don't you just set the order of the Form fields in Field Maps Designer (or new map viewer) and save them so they are always the order you want in Field Maps App? R_
... View more
02-27-2024
11:17 AM
|
0
|
2
|
3435
|
|
POST
|
If the data is in fact in the same coordinate system, often this means the X/Y values in the csv are reversed. Try switching them in the Display XY data tool. R_
... View more
02-27-2024
10:22 AM
|
0
|
1
|
1114
|
|
POST
|
I normally don't share web maps, but create them in AGOL directly. However, for testing, I added a SDE featureclass to Pro (3.2.1), configured the Popups, saved the project and Shared as a Web Map to AGOL. If I open it in New Map Viewer, the popups and order are exactly what was set in Pro. I can also verify that when opened in the Classic Map viewer, the popup order is the default of the attribute table. However, there are still no Forms, they don't get created automatically. If I try to edit this map in Field Maps App, the "Form" is in the order of the popup config I set in Pro. However, this is using the default popup order because no real Form has been created. If I actually go into new map viewer OR Field Maps designer into the Forms section, there is an option to convert popup to Form. This will now create a form with the values in the same order as the popup config set in Pro. Now, in the Form editor, you can modify the order all you like and save it. This will be the order of add data form in Field Maps App. R_
... View more
02-27-2024
10:17 AM
|
0
|
4
|
3443
|
|
POST
|
I just thought that was expected. The things you list always seem to run faster in ArcMap than in any version of Pro that I have tried. R_
... View more
02-26-2024
09:27 AM
|
0
|
0
|
3036
|
|
POST
|
You can also run into this issue if a filter was set (and saved) in the Visualization tab of the item properties. You can remove it in the visualization tab as well, just need to remember to save. R_
... View more
02-23-2024
02:05 PM
|
0
|
0
|
3156
|
|
POST
|
this does that. Had to change field name as my test dataset is based on OBJECTID, not GlobalID. import arcpy
import os
inFeatureClass = r'Database Connections\database.sde\database.DBO.Imagery_Points_2024' # feature class with attachments
pointFieldsList = ['OBJECTID','Feature_ID', 'PROJECT'] # fields to load into cursor
global_dict = {} # dictionary to hold OBJECTID and "name" field
fileLocation = r'C:\tmp\Attachments' # folder where attachments are saved MAKE SURE FOLDER EXISTS
with arcpy.da.SearchCursor(inFeatureClass, pointFieldsList) as point_cursor: # cursor to make dict of OBJECTID's
for row in point_cursor:
if row[1]:
row1 = row[1] # I'm using "Feature_ID" as my name field, but is
else: # not always populated. if Null, substitute "NA"
row1 = "NA"
global_dict[row[0]] = [row[0],[row1,row[2]]] # add to dict with OBJECTID as key, name and project as value list
inTable = r'Database Connections\database.sde\database.DBO.Imagery_Points_2024__ATTACH' # attachment table for feature class
tableFieldsList = ['REL_OBJECTID', 'DATA', 'ATT_NAME', 'ATTACHMENTID'] # field list in attachment table
with arcpy.da.SearchCursor(inTable, tableFieldsList) as table_cursor:
for item in table_cursor:
attachment = item[1] # grab attachemnt from blob field
filename = global_dict[item[0]][1][1] + '_' + global_dict[item[0]][1][0] + '_' + str(item[3]) + '.jpg' # create filename from value in FC dict that has matching OBJECTID
open(fileLocation + os.sep + filename, 'wb').write(attachment.tobytes()) # write the attachment as a file. basically, it adds a list (Feature_ID, PROJECT) as the value in the dictionary key:value pair. Then, extract the second value from the pair as the project name, first value of the pair is the Feature_ID. I'm sure there's a better way to extract multiple values from a dictionary key, but no time to research it. maybe someone on here can improve it. R_
... View more
02-23-2024
01:52 PM
|
0
|
1
|
3357
|
|
POST
|
I only use it for AGOL (online), FGDB or traditional versioning moving edits to base as I believe it may 'miss' some values in other versions if not reconcile/posted first. R_
... View more
02-22-2024
01:56 PM
|
0
|
0
|
7182
|
|
POST
|
Nice. I didn't realize there was a 'Remove text characters from number.' option for Number(). I may have to update some scripts with that instead of Replace(). R_
... View more
02-22-2024
01:54 PM
|
0
|
1
|
7182
|
|
POST
|
Not sure if it is an option for you, but if you create your own basemaps in EPSG:2227 and use that in the web map, then the entire web map will be in that coordinate system and Geometry($feature).X will report the coordinate in the state plane system. I do all my AGOL stuff in state plane in order to avoid these issues. R_
... View more
02-21-2024
04:50 PM
|
0
|
0
|
1482
|
|
POST
|
One way is to create an empty local FGDB with the schema, then just use arcpy append to copy the data to the local FGDB with the arcpy.env.maintainAttachments = False setting. R_
... View more
02-21-2024
04:31 PM
|
1
|
0
|
4333
|
|
POST
|
See this link for posting code. Don't have time to modify/test for your data, but this is how I have accomplished this task for online data. // example ID = 'LT00002'
if(isempty($feature.ID) && $feature.SYMBOL_TYPE == "2SL"){
var vals = FeatureSetByName($datastore,"Testing4Pro.DBO.StripingPoints",['ID'],false)
var LTvals = Filter(vals, "ID LIKE 'LT0%'")
var numarray = []
for (var n in LTvals){
var nn = Number(Replace(n.ID, 'LT',''))
Push(numarray, nn)
}
var maxnum = Max(numarray)
var maxtext = Concatenate('LT',(Text(maxnum + 1, '00000')))
return maxtext
} First checks to see if the ID field is empty, and the correct feature type (I have multiple feature types in the same feature class with their own ID prefix). Grabs the featureset with the ID field. Filters to just the matching features (remember, this is for multiple feature types). create an empty array iterate through the filtered features, strip off the text prefix (in this case 'LT') and add to the array as a number. now, find the max number in the array concatenate the prefix back on with the max number incremented by one, and formated as text with 5 digits. Done. Hope this gives you an idea. R_
... View more
02-21-2024
08:59 AM
|
0
|
0
|
7225
|
|
POST
|
See this link for future code posting. Makes it much easier to follow. Do you have an attribute for each feature with the project or are all features in the featureclass from the same project? If they are all the same project and you just want to modify the filename to add the project name to the beginning then this should do it: pointFieldsList = ['GlobalID','Feature_ID']
filename = 'ProjName_' + str(global_dict[item[0]][1]) + '_' + str(item[3]) + '.jpg' R_
... View more
02-21-2024
07:45 AM
|
0
|
3
|
3390
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 05-14-2026 04:00 PM | |
| 1 | 09-14-2022 07:53 AM | |
| 1 | 09-14-2022 08:23 AM | |
| 1 | 05-21-2026 08:53 AM | |
| 1 | 05-14-2026 04:28 PM |
| Online Status |
Online
|
| Date Last Visited |
4 hours ago
|