|
POST
|
Joe, When a parcel is split for example, a split comes through for R00062, R00062 stays as the mother account and the new parcels (child parcels) get 010 or 011 or 012 etc. There is currently no efficient way of maintaining this data, one would just have to look to see of there is a R00062010 or R00062010 or R00062011 or R00062012 etc. This is not my data this is data i am working with.
... View more
09-24-2019
07:59 AM
|
0
|
0
|
2495
|
|
POST
|
I am trying to query a filed to find original parcels, i would like to create a filled and mark the ones that are original and don't have not split. Currently the field is a string with a length of 11. Some parcels have 5, some 8 and some 10 - not including the alph letter. Hopefully i have explained good what I am needing, i am just not sure how to do this. At first i thought of doing unique numbers but some how it would need to know if the first 5 digits are used, there are some duplicate numbers as well. I am kind of lost on how to proceed, if anyone has done something similar could share some code please? the attributes are as follows for example; R00062 (Original parcel)--> has R00062010 (Split parcel, next one below) - this is not one i need marked. R00062010 - Not Original parcel R32073114 - Not Original parcel R32078 - Original parcel because there is no other parcel number associated with it, need this one mark in the new filed. R32079 - Original parcel because there is no other parcel number associated with it,, need this one mark in the new filed. R32081 - Original parcel because there is no other parcel number associated with it,, need this one mark in the new filed. R32082012 - Not Original parcel R32083012 - Not Original parcel
... View more
09-23-2019
03:48 PM
|
0
|
26
|
5888
|
|
POST
|
Randy, Thanks that worked, at some point i thought it was the Merged Join features so i tried '"' + HwyNpaPub + ';' + HwyNpaPr + ';' + HwyCan + ';' + HwyG + ';' + HwyNP + '"','D:/GIS Folder/HighwayDistricts.gdb/TEST'
... View more
09-06-2019
01:14 PM
|
0
|
0
|
4124
|
|
POST
|
Are mapping field not allowed with the Merge? I guess i am not seeing what i am doing wrong.
... View more
09-05-2019
02:24 PM
|
0
|
1
|
4124
|
|
POST
|
Guys, thanks for the replay. Changing the True and False to upper case and adding {0}.STREET also didn't do anything. The layer still got merged but the fieldmapping didn't.
... View more
09-04-2019
09:54 AM
|
0
|
0
|
4124
|
|
POST
|
I am trying to merge five layers into one with only three fields. The code merges the layers fine with out error but the output layer has all the layers fields and the RD_Owner field doesn't have the attributes merged. so i am guessing my fieldmapping isn't correct. I would appreciate any help. HwyNpaPub = 'C:/Temp/HighwayDistricts.gdb/HWY1'
HwyNpaPr = 'C:/Temp/HighwayDistricts.gdb/HWY2'
HwyCan = 'C:/Temp/HighwayDistricts.gdb/HWY3'
HwyG = 'C:/Temp/HighwayDistricts.gdb/HWY4'
HwyNP = 'C:/Temp/HighwayDistricts.gdb/HWY5'
FieldMapString = '''
STREET "STREET" true true false 50 Text 0 0,First,#,{0},STREET,0,11;
ROAD_TYPE "ROAD_TYPE" true true false 70 Text 0 0,First,#,{0},ROAD_TYPE,0,11;
RD_Owner "RD_Owner" true true false 255 Text 0 0 ,Join,#, {0}, RD_Owner,-1,-1;
'''
def Layers1(HwyNpaPub,HwyNpaPr,HwyCan,HwyG,HNP1):
fieldmappings = arcpy.FieldMappings()
fieldmappings.loadFromString(FieldMapString)
return fieldmappings
def main(args=None):
if args is None:
args = sys.argv
arcpy.Merge_management([HwyNpaPub, HwyNpaPr, HwyCan, HwyG, HwyNP], 'D:/GIS Folder/HighwayDistricts.gdb/TEST', Layers1(HwyNpaPub, HwyNpaPr, HwyCan, HwyG, HwyNP))
... View more
09-04-2019
08:31 AM
|
0
|
10
|
4870
|
|
POST
|
I got a typeError
fldnames = [fld.name for fld in flds if fld.name != desc['OIDFieldName'] and fld.type != 'Geometry']
TypeError: 'geoprocessing describe data object' object is not subscriptable
... View more
08-27-2019
11:41 AM
|
0
|
0
|
1652
|
|
POST
|
Yes that did it and 'Shape.STArea()' and fields.name != 'Shape.STLength()' would have probably worked too. fields.name for fields in fields if fields.name != desc.OIDFieldName and fields.type != 'Geometry' and fields.name != desc.areaFieldName and \
flds.name != desc.lengthFieldName]
... View more
08-27-2019
11:38 AM
|
0
|
0
|
1652
|
|
POST
|
I am trying to copy attributes from a layer to a table but the Geometry fields are giving me problems. I need help ignoring the OID and Geometry fields and i though line 11 would do it. The feature class fields Shape.STArea() & Shape>STLength() Table fields Shape_STarea_ & Shape_STLength I have the following but get error. line 17, in <module> iCur.insertRow(row) RuntimeError: Cannot find field 'Shape.STArea()' arcpy.env.workspace = r"C:Temp\Test.gdb"
database = r"C:Temp\Test.gdb"
fc1 = "TestLayer1
fc2 = "Table1"
dsc = arcpy.Describe(fc1)
fields = dsc.fields
# List all field names except the OID field and geometry fields
#
fieldnames = [fields.name for fields in fields if fields.name != dsc.OIDFieldName and fields.type != 'Geometry']
# Create cursors and insert new rows
with arcpy.da.SearchCursor(fc1,fieldnames) as sCur:
with arcpy.da.InsertCursor(fc2,fieldnames) as iCur:
for row in sCur:
iCur.insertRow(row)
del sCur
... View more
08-27-2019
09:03 AM
|
0
|
4
|
1762
|
|
POST
|
Based on what you stated that you can't pass a list of fields. Here is what i came up with, correct? This took about 2.06 mins where using arcpy.da.UpdateCursor only took 4 seconds. The only issue with the code below is that it removed everything that was not alphabet character but it didn't leave a space, like so. I need there to be a space. Drain High Drain #2 Dist --> HighDrainDist #2High Drain Dist --> HighDrainDist High Drain Dist #2--> HighDrainDist code I used. fc = r"C:\Temp\Lyr1"
fields = ['HomeOwners', 'Irrigation', 'Drain']
for fld in fields:
exp = "''.join([i for i in !HomeOwners! if i.isalpha()])"
arcpy.management.CalculateField(fc, 'HomeOwners', exp, "PYTHON3")
exp = "''.join([i for i in !Irrigation! if i.isalpha()])"
arcpy.management.CalculateField(fc, 'Irrigation', exp, "PYTHON3")
exp = "''.join([i for i in !Drain! if i.isalpha()])"
arcpy.management.CalculateField(fc, 'Drain', exp, "PYTHON3")
... View more
08-23-2019
01:54 PM
|
0
|
1
|
1724
|
|
POST
|
I was able to get to work with arcpy.da.UpdateCurosr. def dump_stuff(fld):
"""add to dump if needed"""
dump = list('0123456789#')
return "".join([i for i in fld if i not in dump])
with arcpy.da.UpdateCursor(fc, fld) as cursor:
for row in cursor:
s = row[0]
row[0] = dump_stuff(row[0])
row[1] = dump_stuff(row[1])
row[2] = dump_stuff(row[2])
cursor.updateRow(row)
del cursor
... View more
08-23-2019
01:35 PM
|
0
|
0
|
1724
|
|
POST
|
I was always told to avoid functions when using field calculator and therefor never done it. So i am not sure how to use the function with field calculator.
... View more
08-23-2019
08:31 AM
|
0
|
2
|
1724
|
|
POST
|
I have some fields with alphabetic and numbers i want to remove all the numbers. I have tried some things but the issue i have is that the numbers are between the alphabetic text for example Homeowners field "Homeowners 456 Exempt",---> Homeowners Exempt "456 Homeowners Exempt"--> Homeowners Exempt "Homeowners Exempt 456" --> Homeowners Exempt Irrigation Hill Irrigation #2 Dist --> Hill Irrigation Dist #2Hill Irrigation Dist --> Hill Irrigation Dist Hill Irrigation Dist#2 --> Hill Irrigation Dist Drain High Drain #2 Dist --> High Drain Dist #2High Drain Dist --> High Drain Dist High Drain Dist #2--> High Drain Dist I have tried .strip('0123456789. -#') but it only removes them from the beginning and end not in between. Ive been working with this but i can't seem to get right. I would appreciate any help. fc = r"C:\Temp\Lyr1"
fields = ['HomeOwners', 'Irrigation', 'Drain']
exp = ''.join(c for c in fields if not c.isnumeric())
arcpy.management.CalculateField(fc, fields, exp, "PYTHON3") get the following error RuntimeError: Object: Error in executing tool
... View more
08-22-2019
03:33 PM
|
0
|
7
|
1812
|
|
POST
|
That didn't work as it only adds the map image layer i can't query or identify the layer. Interesting enough i have pics of people that post that appear to have grouped layers...
... View more
07-05-2019
10:37 AM
|
0
|
0
|
1698
|
|
POST
|
You have to add the Map service (dynamic), Map Image Layer to the map. Once i added the map image layer i was able to see the layers in the group.
... View more
07-03-2019
01:17 PM
|
0
|
0
|
1698
|
| 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 |
09-10-2024
10:42 AM
|