POST
|
More info may help. The techs are placing a pipe exposure on either a main or a service. As part of their workflow, they then copy/paste info to various fields. While the placing of the pipe exposure is a one at a time process, if I could take advantage of the process and populate some attributes, it would help.avoid data entry errors. When they place the point it's still selected, so I wanted to make a button that would do a quick intersect, and if it was a service do this, if a main do that. It checks if it's a service first, and if it isn't the select by location fails, so I was using a try/except and if it failed, then try the main. Problem is if it's a service it still says it's a main.
... View more
09-21-2020
05:49 AM
|
0
|
1
|
578
|
POST
|
I'm working for a GAS utility, I have Pipe Exposures (Points) and they are snapped to either a Main(line) or a Service (Line). Using ArcPy I've tried to do a intersect with a try/except block, if try the service and if not try the main. Along the way set a variable to let me know which layer it's on. It's part of editing, as each gets different values. My code snippet below: try: arcpy.Intersect_analysis('Pipexposure #;Service #', PipeExposure_Intersect, "ONLY_FID", "", "INPUT") theLayer = "the Service" except: arcpy.Intersect_analysis('PipeExposure #;DistributionMain #', PipeExposure_Intersect, "ONLY_FID", "", "INPUT") theLayer = "the Main" arcpy.AddMessage('The Pipe Exposure is on '+ theLayer) No matter what I put a point on, it returns on the Main. I'm stumped and wondering if there is a better way to determine what layer is intersected. I do have an "Exists/than Delete" for my in_memory/PipeExposure_Intersect FeatureClass. that runs before I check.
... View more
09-18-2020
01:40 PM
|
0
|
3
|
642
|
POST
|
Hope this helps. The map uses the tables in the MXD, the relationship class manages the relationship between the feature and the other tables. So in a Map doc (mxd) you can set the primary display field to use when you identify. I noticed in the relationship it was showing the related records but that number you see was an attribute value for the field it was using. If I went to the table, set it to display the primary display field, it showed the value for my field, which made more sense to me. Now if I clicked on this value, in the bottom part of the identify dialog, it showed the other fields and attribute values.
... View more
08-31-2020
01:04 PM
|
0
|
1
|
828
|
POST
|
My mistake, you need to add all the tables into ArcMap, Right-click Display, pick the Field, for each table. So it's stored in the MXD somewhere, can you hit this with Python?
... View more
08-31-2020
12:11 PM
|
0
|
0
|
828
|
POST
|
Looks like you can't do it yet. primary display field on table with relationship class https://community.esri.com/ideas/15324
... View more
08-31-2020
12:02 PM
|
0
|
0
|
828
|
POST
|
I've create relationship classes but they want to see specific fields as the attribute index. .i.e. See yellow highlighted text. In my case I have points and have about 10 Relationship class tables. They all seem to work properly, but for each attribute table the field value it's showing under "Attributes from xxx" is coming from different fields. How do I specify which field to use? I'm using a script to create these and the tables are related all on the same field names. Is there a way to set the fields it uses for this? I'm using python to create these, here is my code: tables = arcpy.ListTables() for i in tables: if (i != 'Structure'): print(i) tab = i relClass = i+"_rc" forLabel = "Attributes from Table" backLabel = "Attributes from " + i foreignKey = "equipment_number" primaryKey = "PARENT_EQUIPMENT_NUMBER" arcpy.CreateRelationshipClass_management(tab, "StructurePts", relClass, "SIMPLE", forLabel, backLabel, "NONE", "ONE_TO_MANY", "NONE", primaryKey, foreignKey)
... View more
08-31-2020
11:42 AM
|
0
|
5
|
861
|
POST
|
Jake, Wow, everything I was trying to do an more, and to top it off it ran on the first try. This should be listed in the help docs, that I've spent hours looking through. Thanks, Bill
... View more
07-31-2020
02:24 PM
|
0
|
0
|
2032
|
POST
|
Yes, I have used both, this was the first one I saw when I googled it. Since I’m updating less than 2,000 records a time this is still very fast. Sent from my iPhone
... View more
06-18-2020
04:36 PM
|
0
|
0
|
232
|
POST
|
Not sure what caused my error, tried modelbuilder and exported that to python, While modelbuilder worked I noticed it had a couple intermediate variables created, and didn't work in my script. Leading me to believe I screwed up elsewhere and this was a result. Frustrated I just decided to go with a updateCursor and that worked the first time. try: Ucursor = arcpy.UpdateCursor(oh, query) for row in Ucursor: for fieldname, value in (('MEASUREDLENGTH', '100'), ('LENGTHSOURCE', 'USER')): row.setValue(fieldname, value) Ucursor.updateRow(row) .
... View more
06-18-2020
02:03 PM
|
1
|
3
|
991
|
POST
|
I've tried the value 'User-Derived' and the key 'USER', and no luck. I've used the key outside of python and it populates with the value but not in my script. I can populate the MEASUREDLENGTH field with a value in python without a problem, but that domain field is failing.
... View more
06-16-2020
10:24 AM
|
0
|
3
|
991
|
POST
|
Hi, using arcpy I'm trying to calculate a field that's using a domain. I'm actually calculating 2 fields, one after the other. The first one works but the second one doesn't set it's new value. No error messages. If I'm not using python and just field calculate it "USER" puts "User-Derived" in the field. However my script just doesn't. ArcMap 10.6 with a File GeoDataBase Featureclass Any ideas? try: # Execute CalculateField # this one works well. arcpy.CalculateField_management(ug, "MEASUREDLENGTH", dist, "PYTHON_9.3") arcpy.AddMessage("Calc'd MEASUREDLENGTH") # this one is supposed to end up with "User-Derived" but doesn't do anything arcpy.CalculateField_management(ug, "LENGTHSOURCE", "USER", "PYTHON_9.3") arcpy.AddMessage("Calc'd LENGTHSOURCE") Domain Key/Value: FM Field Measurement MS Mapping System USER User-Derived WM Windmil WO Work Order Package
... View more
06-16-2020
09:03 AM
|
0
|
11
|
1352
|
POST
|
Got it. While I was running my script thru Python 3.6.8 IDLE, I had never logged into Pro on this laptop. Once I logged in, it threw an error and I found some Lat/Lngs were actually null throwing a bad geometry error. By making a shapefile these were just ignored, to a featureclass these were an issue. So .fillna(0) fixed that. My working script is attached as a text file. Thanks for the help.
... View more
06-12-2020
07:41 AM
|
1
|
0
|
6309
|
POST
|
I'm converting a panda DF to a spatial DF.: # convert Pandas dataframe to Spatial Data Frame sdf= pd.DataFrame.spatial.from_xy(df=df, x_column='Structure_Lng', y_column='Structure Lat', sr=4326) I got that from Esri Training, so it must be right.... https://www.esri.com/training/catalog/5ea8a5c359bcad254d2eb63b/arcgis-api-for-python%3A-getting-to-know-pandas-and-the-spatial-enabled-dataframe/ Now to export it as a shapefile. : # this works so my spatial dataframe should be ok? sdf.spatial.to_featureclass(location="C:/temp/myPts.shp", overwrite=True) Trying a FC in a File gdb #Convert SDF to Featureclass. ### This fails sdf.spatial.to_featureclass(location="C:/temp/test.fdb/myPts", overwrite=True);
... View more
06-11-2020
05:47 PM
|
0
|
1
|
6309
|
POST
|
It was gdb on my code but I must have typed it wrong when posting. Either way, no featureclass.
... View more
06-11-2020
05:11 PM
|
0
|
3
|
6309
|
POST
|
Below is the abbreviated copy of my code. I take an Excel file, read into a panda dataframe, convert that to a spatial dataframe and write it out as a point featureclass. If I write a shapefile it works but when I write to a File GDB it writes nothing and doesn't even show an error. My Code: import pandas as pd from arcgis.features import GeoAccessor, GeoSeriesAccessor df = pd.read_excel (filename) # convert Pandas dataframe to Spatial Data Frame sdf= pd.DataFrame.spatial.from_xy(df=df, x_column='Structure_Lng', y_column='Structure Lat', sr=4326) # show first 5 records in SDF print(sdf.head()) # looks good #Convert SDF to Featureclass. ### This fails sdf.spatial.to_featureclass(location="C:/temp/test.fdb/myPts", overwrite=True); # this works sdf.spatial.to_featureclass(location="C:/temp/myPts.shp", overwrite=True)
... View more
06-11-2020
02:56 PM
|
0
|
7
|
6542
|
Title | Kudos | Posted |
---|---|---|
1 | 06-12-2020 07:41 AM | |
1 | 12-05-2016 09:27 AM | |
1 | 12-23-2016 05:32 AM | |
1 | 11-01-2016 08:49 AM | |
1 | 06-18-2020 02:03 PM |
Online Status |
Offline
|
Date Last Visited |
09-22-2021
12:31 PM
|