POST
|
My issue was, I put the polygon layer inside the geodatabase feature data set. Once I have the polygons layer and table in the geodatabase root folder, everything worked fine.
... View more
01-17-2024
01:49 PM
|
0
|
0
|
448
|
POST
|
I'm attempting to execute a straightforward select by location operation using "Have their center in" with Pro. I initially thought this was comparable to ArcMap's Select by Location with the condition "Have their centroid in the source layer feature." However, when I try to perform the same operation in ArcGIS Pro using "Have their center in," I encounter the following error: "Error 160306: The server was not found." My objective is to select features from Layer B whose centroid falls within the boundaries of polygons in Layer A.
... View more
01-16-2024
03:48 PM
|
0
|
4
|
572
|
POST
|
Essentially, I need to create point features for every record in the table, which falls within a parcel. I do have CopyFeatures which is suppose to create the features, from what I have read. What is happening is that, if I run the stand alone script the join.management works but as mentioned I creates duplicates not all the attributes from the table get transferred after doing a copyfeature. Upon incorporating the script into a model, the Join management function behaves differently from the standalone script. It fails to establish a one-to-many join as observed in the script.
... View more
01-11-2024
04:02 PM
|
0
|
0
|
273
|
POST
|
When I search for joining one to many, I found that join.management should work, unless it doesn't truly work? Add Join (Data Management)
... View more
01-09-2024
08:00 AM
|
0
|
2
|
317
|
POST
|
It is making a duplicate but for example the table will have 4 attributes and the feature class will have one attributes. It it creates a duplicate four times, how can I get it to create new records for keep the attributes from the table? Table Table Acct Field A 14970201 MH 14970201 SFR 14970201 CON 14970201 RV Feature class Acct FieldA 14970201 MH After Join. 14970201 MH 14970201 MH 14970201 MH 14970201 MH
... View more
01-08-2024
02:55 PM
|
0
|
0
|
433
|
POST
|
I have a feature class and a table that I need to join. The table and feature class share a common field, The table will have duplicate Acc (ID's), and the Feature class will have just one Acc (ID's). Both are in the same file geodatabase, both have objectIds. The following doesn't crate the one to many join, what am I missing? arcpy.env.workspace = "C:/Temp/test.gdb"
fc = "C:/Temp/test.gdb/TaxPs"
sourceTB = "C:/Temp/test.gdb/table"
arcpy.MakeFeatureLayer_management(fc, "TaxPs")
arcpy.AddJoin_management("TaxPs", "Acc", sourceTB, "Acc", "KEEP_COMMON")
arcpy.management.CopyFeatures(fc, os.path.join(arcpy.env.workspace, "Taxps_Joined"))
... View more
01-08-2024
02:42 PM
|
0
|
5
|
440
|
POST
|
I am trying to create a feature layer from the current selection. The selection can be one feature or multiple features. I have an ERROR 000358: Invalid expression on line 9. I am assuming my where clause is wrong? ptSelection = "points"
parcel = 'TaxParcels'
PF = "memory\PointFeat"
selected_features = arcpy.Describe(ptSelection).FIDSet
where_clause="OBJECTID = {}".format(selected_features)
arcpy.MakeFeatureLayer_management(ptSelection, PF, where_claus
... View more
10-25-2023
03:28 PM
|
0
|
3
|
556
|
POST
|
I need to copy features that are not Null. I need to use the arcpy.management.CopyFeatures because I am doing a join, that is one to many. The issue I am having is that my query to select "IS NOT NULL" doesn't work. I don't get an error, what is the correct syntax for this query? Source = "Parcels"
Lyr = "Par"
fieldName = "TAXID"
select = """{0} IS NOT NULL""".format(fieldName)
arcpy.management.MakeFeatureLayer(TAXSource, Lyr)
arcpy.SelectLayerByAttribute_management(Lyr, "NEW_SELECTION", select)
arcpy.management.CopyFeatures(Lyr, "C:Temp/test.gdb/TestPar") Lyr = "TaxPar"
#fieldName = "TAXID"
select = "TAXID IS NOT NULL" #"'TAXID = IS NOT NULL'"
arcpy.management.MakeFeatureLayer(TAXSource, Lyr, select)
arcpy.management.CopyFeatures(Lyr, "C:Temp/test.gdb/Testpar")
... View more
07-17-2023
03:15 PM
|
0
|
1
|
448
|
POST
|
After testing and testing, I figured out why I kept getting that error, at least I think. You have to be the owner/creator of that of that enterprise SDE gdb. The soils feature class was from another departments enterprise SDE gdb. It works on my enterprise SDE gdb but if the template is from another enterprise SDE gdb not owned or created by you it won't work. I've tested this a dozen times, that is how it functions for me.
... View more
06-15-2023
08:31 AM
|
0
|
0
|
840
|
POST
|
The soils layer resides in an SDE feature class/ feature dataset and I have other shapefiles and SDE feature classes in this project. No matter what sde feature class I changed the templateFC to, if it's in a feature class I get the error I posted. It works fine if the templateFC is a shapefile...?
... View more
06-14-2023
11:58 AM
|
0
|
3
|
862
|
POST
|
I am trying to create an empty feature class in the projects folder directory, but I get the following error. How can use arcpy.management.CreateFeatureclass to create an empty feature class in the projects folder? import arcpy
import os, sys
import time
from arcpy import env
t1 = time.time()
aprx = arcpy.mp.ArcGISProject("CURRENT")
m = aprx.listMaps()[0]
lyr = m.listLayers("Soil")[0]
arcpy.env.workspace = os.path.dirname(aprx.filePath)
wp = os.path.dirname(aprx.filePath)
outPath = wp
NewLyr = "Soils_New"
template = "Soil"
out_fc = arcpy.management.CreateFeatureclass(outPath, NewLyr, template) Error Traceback (most recent call last):
File "<string>", line 20, in <module>
File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\management.py", line 3451, in CreateFeatureclass
raise e
File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\management.py", line 3448, in CreateFeatureclass
retval = convertArcObjectToPythonObject(gp.CreateFeatureclass_management(*gp_fixargs((out_path, out_name, geometry_type, template, has_m, has_z, spatial_reference, config_keyword, spatial_grid_1, spatial_grid_2, spatial_grid_3, out_alias), True)))
File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing\_base.py", line 512, in <lambda>
return lambda *args: val(*gp_fixargs(args, True))
arcgisscripting.ExecuteError: ERROR 160142: The Field type is invalid or unsupported for the operation.
Failed to execute (CreateFeatureclass).
... View more
06-14-2023
07:42 AM
|
0
|
6
|
895
|
POST
|
I tried you function but I couldn't get it to work right. pre-logic script code: def mark_records(records):
result = []
for rec in records:
# Check if the 9th character (index is an alphabetic character
if rec[8].isalpha() or rec[8].isspace():
# Mark as ok
result.append({"Rec": rec, "Mark": "ok"})
elif rec[8].isdigit():
# Mark as Not ok
result.append({"Rec": rec, "Mark": "Not ok"})
else:
# If neither alphabetic nor digit nor space, mark as Invalid
result.append({"Rec": rec, "Mark": "Invalid"})
return result Field = (!rec!)
... View more
04-24-2023
07:29 AM
|
0
|
0
|
462
|
POST
|
oh I see, line 9 (row[0])[8].isnumeric. Thanks for the help.
... View more
04-24-2023
07:24 AM
|
0
|
0
|
464
|
POST
|
This worked in Arcmap, but how can run it outside. I tired the following but I get "Parameters are not valid." or with updatecursor? import arcpy
inTable = "fc"
fieldName = "rec"
expression = "digitron(rec)"
codeblock = """
def digitron(rec):
try:
if rec[8].isnumeric():
return 'Not OK'
else:
return 'OK'
except:
return 'Some error' """
arcpy.management.CalculateField(inTable, fieldName, expression, "PYTHON3", codeblock)
... View more
04-21-2023
02:52 PM
|
0
|
2
|
511
|
Title | Kudos | Posted |
---|---|---|
1 | 10-27-2022 11:37 AM | |
1 | 10-31-2023 10:16 AM | |
1 | 02-16-2023 01:50 PM | |
1 | 08-11-2021 11:13 AM | |
1 | 01-06-2021 10:45 AM |
Online Status |
Offline
|
Date Last Visited |
01-23-2024
11:04 AM
|