|
POST
|
That's why I suggest calculate the Z-coordinates at the 2D intersection point. If it's the same for both line, then they intersect 3D.
... View more
07-10-2018
08:53 AM
|
0
|
0
|
3262
|
|
POST
|
Ah, so it was. I thought you meant comma-delimited string. You can't make a list any other way
... View more
07-05-2018
12:16 PM
|
0
|
0
|
2587
|
|
POST
|
The help example uses a list for the feature classes, not a delimited string. Append—Data Management toolbox | ArcGIS Desktop
... View more
07-05-2018
11:34 AM
|
0
|
2
|
2587
|
|
POST
|
I suppose you could test if the lines intersect in 2D. If so, find the XY coordinates where they intersect. Calculate the Z coordinate at those locations. See if they're the same. If the lines don't intersect in 2D, they don't intersect in 3D.
... View more
07-04-2018
01:09 PM
|
0
|
2
|
3262
|
|
POST
|
Question 1: change one of the z coordinates so that the lines clearly do not intersect along the z-axis, but still would intersect along the xy plane, to check. Question 2: you go through a lot of work to create a feature class called 'homeadd', and then insert into a different feature class, 'polyline1add'. Is that intentional?
... View more
07-04-2018
09:16 AM
|
0
|
4
|
3262
|
|
POST
|
The output of MakeFeatureLayer is a feature layer, not a file, so don't include the path. Then, the input to SelectLayerByAttribute is a feature layer, so again, no file path. arcpy.MakeFeatureLayer_management(os.path.join(ruta,"Vias_Join_p"), "Vias_Join_p_lyr")
arcpy.SelectLayerByAttribute_management("Vias_Join_p_lyr" , "NEW_SELECTION","descripcio = descripcio_1 AND nam = nam_1 AND na2 = na2_1 AND acc = acc_1 AND rst = rst_1 AND typ = typ_1 AND hct = hct_1 AND wtc = wtc_1 AND loc = loc_1 AND ltn = ltn_1 AND mes = mes_1 AND tuc = tuc_1 AND txt = txt_1 AND subtipo = subtipo_1")
... View more
07-04-2018
09:06 AM
|
2
|
3
|
3308
|
|
POST
|
I'll try to steer you toward creating a new field and populating it by an ID that you can use to either merge together or leave alone, then use Dissolve to make your new feature class. Selections are very slow through Arcpy. An alternative would be to loop through your features using an UpdateCursor and use the Polyline union method to make your new geometries (one feature at a time), but this would be quite a bit more complicated.
... View more
07-03-2018
03:59 PM
|
0
|
1
|
6401
|
|
POST
|
It's probably some difference in our environments. You're running on Python 3 kernel?
... View more
07-03-2018
11:27 AM
|
0
|
0
|
5235
|
|
POST
|
Hmmmm, the following works for me: from arcgis.gis import GIS
gis = GIS()
map = gis.map("Paris")
map
... View more
07-03-2018
11:22 AM
|
2
|
1
|
5235
|
|
POST
|
I'd probably go a step farther and put everything into a dictionary. Assumes all your numbers are 5 digits: vals = ['CC12345', 'CAL12345', 'CC12346', 'CAL12341', 'CC12349', 'CC12348']
vals_dict = {}
for val in vals:
vals_dict[val[:-5]] = max(val[-5:], vals_dict.get(val[:-5], 0))
print(vals_dict)
{'CC': '12349', 'CAL': '12345'}
... View more
06-29-2018
02:02 PM
|
1
|
0
|
4584
|
|
POST
|
Extract the numerical part of the code first, otherwise '+' means concatenate, and you can't concatenate string and int. vals = ['CC12345', 'CC12346', 'CC12349', 'CC12348']
print(max(vals))
max_int = int(max(vals)[2:])
print(max_int)
max_int += 1
print(max_int)
new_code = 'CC' + str(max_int)
print(new_code)
CC12349
12349
12350
CC12350
... View more
06-29-2018
01:39 PM
|
1
|
1
|
4584
|
|
POST
|
You need to enclose parameters containing spaces with quotes to keep it together. There are several ways to deal with paths using the os.path module. Bonus: it smartly handles slashes for you. import os
path = 'some/path/some_file.txt'
print(os.path.dirname(path), os.path.basename(path), os.path.splitext(path))
('some/path', 'some_file.txt', ('some/path/some_file', '.txt'))
... View more
06-29-2018
12:33 PM
|
1
|
0
|
2498
|
|
POST
|
This type of problem, where you need to keep track of key/value pairs (county/map #), is best organized in a dictionary, where for each key (county) you increment the value (map #). See: 5. Data Structures — Python 2.7.15 documentation Here's an example, not using the field calculator (sorry). In the field calculator, counter_dict should be global, and instead of appending to output_list, you'd return the value counter_dict[county]: county_list =
['Marin',
'Napa',
'Napa',
'Marin',
'Marin',
'Napa',
'Marin',
'Marin',
'Napa',
'Napa',
'Napa',
'Napa',
'Marin',
'Napa',
'Marin',
'Napa',
'Marin',
'Marin',
'Napa',
'Marin']
counter_dict = {}
output_list = []
for county in county_list:
counter_dict[county] = counter_dict.get(county, 0) + 1
output_list.append([county, counter_dict[county]])
output_list =
[['Marin', 1],
['Napa', 1],
['Napa', 2],
['Marin', 2],
['Marin', 3],
['Napa', 3],
['Marin', 4],
['Marin', 5],
['Napa', 4],
['Napa', 5],
['Napa', 6],
['Napa', 7],
['Marin', 6],
['Napa', 8],
['Marin', 7],
['Napa', 9],
['Marin', 8],
['Marin', 9],
['Napa', 10],
['Marin', 10]]
... View more
05-31-2018
03:46 PM
|
1
|
0
|
4985
|
|
POST
|
Check out UpdateCursor: UpdateCursor—Data Access module | ArcGIS Desktop Basically, read all fields, sum all values except the field you're going to write to, then write to that final field.
... View more
05-07-2018
01:38 PM
|
1
|
1
|
5602
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 08-30-2013 02:22 PM | |
| 1 | 04-12-2011 11:19 AM | |
| 1 | 09-17-2021 09:43 AM | |
| 1 | 04-04-2012 12:05 PM | |
| 2 | 07-16-2020 11:31 AM |
| Online Status |
Offline
|
| Date Last Visited |
07-15-2023
12:11 AM
|