POST
|
#SOLVED WITH THIS SCRIPT
enterprise geodatabase - Efficiently selecting related records using ArcPy? - Geographic Information Systems Stack Excha…
its the big one at the bottom of the page.
IF YOU ARE LOOKING, SIMPLY ADD YOUR FEATURES AND TABLES TO THE VARIABLES
ON A FURTHER NOTE, I AM WORKING IN A VERSIONED ENVIRONMENT SO I HAD TO USE BOTH:
arcpy.MakeFeatureLayer_management and arcpy.MakeTableView_management to accompany my script.
I am so happy with this and must thank the people who wrote this:
from here i was able to switch the selection to show my non connected records and print them, the next step
is to have it export to an excel sheet. so exciting!!
... View more
11-01-2018
12:25 PM
|
0
|
0
|
499
|
POST
|
ok so here is my deal; I am working in an SDE, I have a feature Class of civic address points and these points have a one to many link table also in the SDE. This table is linked by a roll number. Some points are not in the table and some table records are not in the points. What I want top do is have a script that selects all the related records in the link table, switch the selection so the script will then print the non related records by their unique identifier. The purpose of this is to find what records in the link table require points and vice versa. I need help finding a way to select what records have a relationship. Ive tried all of these and many more but I cant figure it out: enterprise geodatabase - Efficiently selecting related records using ArcPy? - Geographic Information Systems Stack Excha… Select Related Records https://tutel.me/c/gis/questions/50287/efficiently+selecting+related+records+using+arcpy What I basically want to do is utilize something like that nice little Select related records button in the attribute table but in python. The reason I require this script is so less "GIS savvy" people in the organization will be able to track down this missing information. all help and assistance is greatly appreciated thank you.
... View more
10-31-2018
09:08 AM
|
0
|
1
|
681
|
POST
|
Hi, did you ever get this resolved? having the same issue
... View more
10-17-2018
02:44 PM
|
0
|
0
|
631
|
POST
|
I am looking to bounce some ideas off some heads to help build an interesting flood plain mapping model for the municipality I work for. So here is what I have: 1. The city has one environment Canada water level gauge in the Elk River (the river that runs through town). Essentially the engineers can look at this meters website and get updated information on the rivers water level in that location every 15 minutes. 2. I have access to tons of classified Li-DAR data we had flown this year. Essentially what I want to create out of these two things is a model that changes the extent of the overall water levels around the city when the the meter level changes. I've made simple flood plane analysis models but would like to make this a model that updates itself and can give the engineers an indication of what areas to check at what levels. I'm open to all your great comments and constructive criticism. If you have a better thought on how to do this sort of thing id love to hear that too! Cheers!
... View more
06-21-2018
10:53 AM
|
0
|
0
|
735
|
POST
|
I am looking to bounce some ideas off some heads to help build an interesting flood plain mapping model for the municipality I work for. So here is what I have: 1. The city has one environment Canada water level gauge in the Elk River (the river that runs through town). Essentially the engineers can look at this meters website and get updated information on the rivers water level in that location every 15 minutes. 2. I have access to tons of classified Li-DAR data we had flown this year. Essentially what I want to create out of these two things is a model that changes the extent of the overall water levels around the city when the the meter level changes. I've made simple flood plane analysis models but would like to make this a model that updates itself and can give the engineers an indication of what areas to check at what levels. I'm open to all your great comments and constructive criticism. If you have a better thought on how to do this sort of thing id love to hear that too! Cheers!
... View more
06-21-2018
08:03 AM
|
0
|
0
|
856
|
POST
|
or like you know just say, replace layer.table with layer.datasetName.......... GOT IT NOW THANKS
... View more
06-14-2018
09:47 AM
|
0
|
0
|
910
|
POST
|
Look man I get my scripting sucks, I just need a solution. how do I point to my layer table so i can throw a variable into my query
... View more
06-13-2018
02:07 PM
|
0
|
1
|
910
|
POST
|
my apologies, what im trying to do is now link to the layers table so I can complete my query.
... View more
06-13-2018
01:37 PM
|
0
|
0
|
910
|
POST
|
Ok got that error figured, now it wont point to the table. thanks for your help! Traceback (most recent call last):
File "P:\Joey_Plessis\find_dupes_mxd_edition\find_dupes_mxd.py", line 54, in <module>
print layer.name.table
AttributeError: 'unicode' object has no attribute 'table'
>>>
... View more
06-13-2018
12:41 PM
|
0
|
3
|
910
|
POST
|
Basically i want to find duplicate records from my attribute tables in my mxd not my data base because my mxd. has several definition query's i would like to preserve. I am essentially trying to script this query [FIELD_NAME] In (SELECT [FIELD_NAME] FROM [TABLE_NAME] GROUP BY [FIELD_NAME] HAVING Count(*)>1 ) Any tips as to why this wont cooperate? I either get a cannot combine string and layer objects error or an invalid query error because it says my layer does not exist because it wont find the table related to my mxd. Cheers, # Set workspace environments. Workspace must be a connection file to an ADMIN (sde) connection arcpy.env.workspace = r"\\fs\GIS\admin\temp_connect_files\COF_temp.sde" arcpy.env.overwriteOutput = True print "workspace environment connected" # Set workspace variable workspace = arcpy.env.workspace # Local variables: mxd = arcpy.mapping.MapDocument(r"P:\Joey_Plessis\service_cards\pdf_map_automation_script\DEFAULT_bc_one_call.mxd") df = arcpy.mapping.ListDataFrames(mxd,"*")[0] #DONT WORRY ABOUT THIS PART layer = arcpy.mapping.ListLayers(mxd, raw_input("enter layer name"), df)[0] field = raw_input("enter field name") print layer print field where = field +" " + "In" + " " + "(SELECT" +" "+ field + " "+ "FROM" +" " + "layer" + " "+ "GROUP BY" +" " + field +" "+ "HAVING Count(*)>1 )" print where arcpy.SelectLayerByAttribute_management(layer, "NEW_SELECTION" ,where)
... View more
06-12-2018
04:04 PM
|
0
|
8
|
1109
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|