# Tag Info

1

Since I cannot comment on his post yet, I would like to add to what Tangnar said. We use a few different methods similar to this to estimate the distance that coastlines have moved. The first is called DSAS (http://woodshole.er.usgs.gov/project-pages/DSAS/). It uses a baseline "offshore" and then casts lines and measure the intersect with each of your ...

2

The crux of the matter is finding a quantitative definition of "width" of the channel. Consider a point P located anywhere within the river. The width certainly cannot be any less than the shortest distance from P to the left bank plus the shortest distance from P to the right bank. A moment's thought suggests this is an excellent candidate for the width ...

2

Here is a list of some of the tools I know of that could be helpful for you: The Arc Hydro Tools or the HEC-GeoRas tools (which I think were developed partially from Arc Hydro tools). While there is a lot going on with these you may not need, they have the ability to create Cross Sections at specified distances, from which you could get your widths. The ...

1

After some further tinkering with Paul's example, I came to the following solution. def nmshort(stname,stnum): s = stname.split() s2 = s[:] = [elem[:stnum] for elem in s] s3 = ' '.join(s2) if s3 == stname: return None else: return s3 try: cursor = arcpy.UpdateCursor(inFC) for row in cursor: ...

3

Since you already have a function in your code-block, you can just re-use it in your cursors. Here's the untested code to get you started: def nmshort(stname,stnum): s = stname.split() s2 = s[:] = [elem[:stnum] for elem in s] s3 = ' '.join(s2) if s3 == stname: return None else: return s3 cursor = arcpy.UpdateCursor(inFC) ...

2

This is a pure Python example to show you the principle: def nmshort(stname,stnum): s = stname.split() s2 = s[:] = [elem[:stnum] for elem in s] return ' '.join(s2) exString = "THIS IS AN EXAMPLE STRING" exNumber = 2 print nmshort(exString,exNumber) This is your code adapted, but untested - I am assuming that you do not yet have the fourth ...

1

You were so close at getting it right... As per one of my previous comments the exclamation marks need to be there so: "blocklow(inLF, inLT, inRF, inRT)" needs to change to: "blocklow(!{0}!, !{1}!, !{2}!, !{3}!)".format(inLF, inLT, inRF, inRT) This is python string manipulation where the values in the format statement get substituted into the string, ...

Top 50 recent answers are included