|
POST
|
I believe you will still have to rely on a custom python script, although using arcpy geometry objects will likely shorten Kim's script considerably. I'll try to follow up on this.
... View more
02-27-2015
02:09 PM
|
0
|
4
|
7519
|
|
POST
|
If you have a polygon shaped like the letter 'C', the centroid will be outside the lines of the polygon 'C', right in the middle (similar for many other complex shapes).
... View more
02-27-2015
01:38 PM
|
1
|
2
|
2855
|
|
POST
|
You have obviously found the Con tool. Save us some time and post what you have so far. edit: the short answer to your first question is, yes, it is possible to do this using Con.
... View more
02-27-2015
01:33 PM
|
0
|
1
|
4208
|
|
POST
|
Xander, I believe you are hitting a limitation regarding multipart geometry, not arcpy, outlined here (although I could have sworn I've seen such multipart polygons before): Keep in mind that parts in a multipart polygon are spatially separated. They can touch each other at vertices, but they cannot share edges or overlap. When you are sketching a multipart polygon, any parts that share an edge will be merged into a single part when you finish the sketch. In addition, any overlap among parts will be removed, leaving a hole in the polygon.
... View more
02-27-2015
11:42 AM
|
1
|
3
|
7491
|
|
POST
|
Dan, you seem to have a handle on this - is Xander's polygon "flattened" (dissolved) at the call to create the polygon ("polygon= arcpy.Polygon(array)"), or elsewhere? edit: I tried your script and it does not seem to address Xander's problem, specifically creating one multipart polygon containing shared edges.
... View more
02-27-2015
11:09 AM
|
0
|
0
|
7491
|
|
POST
|
When you use the Merge tool, make sure you match up the fields you want to populate in the field mapping section. Instructions on how to use the field mappings control can be found here. edit: technically, it sounds like you want the Append tool (adds features to an existing feature class rather than creating a new feature class), but Merge is nice to use for practice.
... View more
02-27-2015
09:53 AM
|
0
|
0
|
1652
|
|
POST
|
When you make a parameter from a pre-made tool (e.g. Merge, Add Field, etc.) the parameter type is automatically set. So, if you make a model parameter out of the input box in the Merge tool, it automatically creates a parameter in your tool dialog that looks just like that in the Merge tool, that you can drag and drop into like usual, because it has chosen the parameter data type for you (check out the help page for each tool to see the parameter data types). You can get into trouble creating your own parameters from model variables because you have to choose the data type yourself. Say you want to drag and drop some data from your table of contents and you choose Feature Class for the parameter data type - doesn't work! But, Feature Layer parameter data type does allow drag and drop, so try that. A good way to get started figuring this out is to find a tool with the type of parameter action you're looking for, look up its help page, find the parameter data type, and use that.
... View more
02-26-2015
04:40 PM
|
0
|
0
|
3042
|
|
POST
|
Python will print integers just fine without casting it to string. The problem I think you are referring to arises when you try to concatenate strings with integers. This works: >>> for i in range(100):
... count = count + 1
... print count This doesn't work: >>> for i in range(100):
... count = count + 1
... print "Count: " + count
... View more
02-26-2015
11:54 AM
|
1
|
2
|
3367
|
|
POST
|
Untested, but should work like so: counter = 0
with arcpy.da.UpdateCursor(table, [field]) as cursor:
for row in cursor:
if row[0] == find
row[0] = replace
cursor.updateRow(row)
counter = counter + 1
print counter
return counter To pass counter back to the calling function, you would 'return counter', but since we don't see where you call the function, it's hard to write it. It would be something like: count = find_and_replace(table, field, find, replace)
print count # the number returned by function
... View more
02-26-2015
10:25 AM
|
0
|
5
|
3367
|
|
POST
|
Are you mostly stuck on how to automate this by row (could use the Field Calculator or python update cursor or python to call Calculate Field) or through multiple feature classes (same as repeating by row, but also using python to loop through feature classes)? Or are you asking how to automatically calculate the field by editing a different field?
... View more
02-26-2015
09:37 AM
|
0
|
0
|
864
|
|
POST
|
Do you get an error outside ArcMap, perhaps something like "no module named arcpy"? Along those lines, do you have multiple python installations on your computer, and are your IDEs pointing to the correct one?
... View more
02-25-2015
02:55 PM
|
0
|
1
|
2937
|
|
POST
|
Once you dissolve based on land use, you can split apart the separate blocks using Multipart to Singlepart, or select all, then Explode. Either method will separate disjoint polygons.
... View more
02-25-2015
02:18 PM
|
1
|
1
|
1562
|
|
POST
|
You mention dissolving, so I assume you've tried the Dissolve tool. Have you?
... View more
02-25-2015
02:06 PM
|
0
|
3
|
1562
|
|
POST
|
Are you asking how to perform these functions in ArcMap, or hoping for something better than going through the usual routes (e.g. Add Field, Create New Feature via editing, and using GDB domains)? Deviating from the usual routes will require coding, and even then will likely rely heavily on the usual methods through code. edit: I'll add that it is possible to edit a personal geodatabase feature class through Access, although not recommended.
... View more
02-24-2015
10:53 AM
|
0
|
2
|
1149
|
|
POST
|
Dave, full disclosure, I'm not familiar with directional derivatives and probably not going to read the entire article in your link (too long). Are you looking for the slope to the horizon at the given bearing, or the slope at some distance from a point along the bearing, or neither?
... View more
02-22-2015
02:40 PM
|
0
|
0
|
2684
|
| 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
|