|
POST
|
Yes, RasterToPoint & Add_XY are probably what you need. But if the Raster is large then that is a lot of points. Why would you need to look at it in Excel anyway? N
... View more
11-24-2013
10:09 PM
|
0
|
0
|
745
|
|
POST
|
Doesn't this give you the functionality you are looking for... arcpy describe relationshipclass properties http://resources.arcgis.com/en/help/main/10.2/#/RelationshipClass_properties/018v0000002n000000/ Cheers, N
... View more
11-24-2013
09:49 PM
|
0
|
0
|
2222
|
|
POST
|
You could use your own "rounding" function or utilize the round function. See below...
>>> x = 345678.912
>>> CDim = 100
>>> int(x / CDim) * CDim + CDim / 2
345650
>>> round(x)
345679.0
>>> round(x, -2)
345700.0
>>>
The first bit creates an x coord in the middle of a cell of width 100, min is 345600, max is 345700. Good luck, Neil
... View more
11-19-2013
10:11 PM
|
0
|
0
|
584
|
|
POST
|
import arcpy
from arcpy import env
env.overwriteOutput = True
pointFC = "C:/Scratch/testpnts.shp"
pointList=[]
featureList= []
with arcpy.da.SearchCursor(pointFC, ["SHAPE@XY"]) as cursor:
for row in cursor:
shortList = list(row[0])
pointList.append(shortList)
for pnt in pointList:
lowX = pnt[0]
lowY = pnt[1]
highX = lowX + .5
highY = lowY + .5
array = arcpy.Array([arcpy.Point(lowX, lowY),
arcpy.Point(lowX, highY),
arcpy.Point(highX, highY),
arcpy.Point(highX, lowY),
arcpy.Point(lowX, lowY)])
polygon = arcpy.Polygon(array)
featureList.append(polygon)
arcpy.CopyFeatures_management(featureList, "Z:/Scratch/polys.shp")
print arcpy.GetMessages()
BTW, try posting code using the code blocks. When you read the SHAPE@XY token above you are first making a list from the XY tuple, then appending that into a list. Try having a look at what your variable shortList actually is. Does it look something like [(123.45, 123.45)]. Then pointList looks like this ... [[(123.45, 123.45)], [(123.45, 123.45)], [(123.45, 123.45)]] ie tuples inside a list of lists. I would just append the SHAPE@XY token directly into the list. Cheers and good luck, Neil
... View more
11-17-2013
08:58 PM
|
0
|
0
|
3191
|
|
POST
|
The hydrology tools would certainly be the place to start. http://resources.arcgis.com/en/help/main/10.2/index.html#//009z0000004w000000 At the very minimum, to get your DEM to be hydrologically correct (everything flowing in the right direction, no sinks etc). But the hydrological experts would probably need to use other tools like arcHydro or something. But if all you're looking for is possible complete discharge, wouldn't a FlowAccumulation meet your needs. Cheers, Neil
... View more
11-11-2013
09:01 PM
|
0
|
0
|
7449
|
|
POST
|
There are many available approaches in SA. Try a high pass filter (Neighbourhood/Filter). Also FocalStats with custom kernel files could be the answer. In the Surface box, Curvature enhances the differences between nearby cells. Cheers, Neil
... View more
11-10-2013
08:50 PM
|
0
|
0
|
1289
|
|
POST
|
You may want to consider updating this to use the data access module : http://resources.arcgis.com/en/help/main/10.2/#/SearchCursor/018w00000011000000/ Then you can get the length from the SHAPE@LENGTH token rather than trying to read the length attribute in the feature class. Cheers, Neil
... View more
11-04-2013
09:22 PM
|
0
|
0
|
346
|
|
POST
|
Whenever I need to "reformat" image files from, say, 3 band RGB (24bit) to single band grey scale or pseudocolour (8bit) I tend to use Adobe Photoshop Essentials. Its good at that sort of stuff. Not sure that PS will read in sid files though. Cheers, Neil
... View more
10-31-2013
11:13 PM
|
0
|
0
|
1003
|
|
POST
|
The repair paths tool just needs to know the old paths to the data (the original tiff files) vs the new path. Then I would simply rebuild the overviews. Backward compatibility from 10.2 backwards, shouldn't be a problem. As regards starting again, depending on how many Gb of data there is, is shouldn't take too long. The lengthiest part will be to build those overview. Give it a shot on just some of the data (select individual tiffs instead of the whole directory structure) first. You will find that it is not too difficult. Good luck, N
... View more
10-29-2013
11:19 PM
|
0
|
0
|
3660
|
|
POST
|
Bryan, I would start by browsing through your data using ArcCatalog, just to get a feel for what is where. The extra files along with the tiffs are the geoereferencing, pyramids (rrd) and such like stuff. Shouldn't have to worry about it. A Mosaic dataset has an icon like the jpeg attached. And if you right click on it you can get the properties page which identifies it as a Mosaic. There are quite a lot of possibilities with Mosaics. But, as far as I am concerned, the mosaic imagery should draw at any scale. That's what the overviews are for, reduced resolution images to draw at smaller scales. If you click on the mosaic in ArcCatalog, it opens the data table and you can see names of the images included in the mosaic, column "Name". Just remembered, what version of Arc are you using? A mosaic created with 10.1, is not viewable (I think) by someone using 10. Unfortunately, the "Repair paths" tool is a little confusing. And if your data provider has indeed created a mosaic with hard coded paths in it, like "Z:/DataStore/TiffFiles/Project1/" and now the data resides on your system in "M:/ProjectName/Tiffs/", but that's the sort of thing it is looking for. If you can't come right, you might consider just recreating the mosaic. It is actually not that hard. Create a new mosaic, add imagery into it, build overviews. It gets a little more complex if you have overlapping imagery of different vintages, resolutions. Good luck, Neil
... View more
10-28-2013
11:51 PM
|
0
|
0
|
3660
|
|
POST
|
Doug & Russell, thanks a lot. Look forward to seeing some more of your insights here. Back to tool validator..... Cheers, Neil
... View more
10-23-2013
11:21 PM
|
0
|
0
|
862
|
|
POST
|
Thanks Russell (or is it Doug..). I will try messing with the valueText story. You're probably right, the output of .value is not the name of the field but an object. I have seen constructs looking like this param[0].value.value, now what does that mean!!! I wonder if there is a page somewhere which details all the parameters (or is it methods...) for the param object. Your last bit was interesting and I will certainly pursue it. Construct a list of the fields before then pop them off the list as they are selected. Could be a way to do it. I am curious that in your developments, you have skipped over "normal" python script tools and gone straight to pyt's. What is the reason for this? Thanks again for your inputs. Cheers, Neil
... View more
10-22-2013
10:11 PM
|
0
|
0
|
862
|
|
POST
|
Larry, I often do this using a dictionary and a search cursor like:
Cur = arcpy.da.SearchCursor(InFc, ["Field"]) # where Field is the column to count duplicates
FDict = {}
for r in Cur:
f = r[0]
if f in FDict:
FDict += 1
else:
FDict = 1
del Cur
The dictionary FDict will contain the keys of all the possible values of Field and a count of how many there are. Cheers, Neil
... View more
10-22-2013
08:59 AM
|
1
|
0
|
5990
|
|
POST
|
I think I am reasonably competent at python / arcpy coding. But mostly I use this as py code running straight out of IDLE. Its quick and easy, but all the data sources / outputs are hard coded. So recently I have become inspired to turn some of my more re-usable code into proper scripts in a tool box. This tool takes in a PointZ Fc and uses its attribute data to create a polylineZM of the drill hole trace. You can see from the attachment that I have successfully disabled the second half of the dialog until an associated table is selected. No probs there. So a couple of questions to those of you with more experienced than me with coding the tool validator classes. I wanted to make sure that the user selects 3 different attribute fields for the numeric inputs. Selecting 2 that are the same would be nonsense. I tried to do this in updateParameters like this:
if self.params[3].value and self.params[4].value:
if self.params[3].value == self.params[4].value:
self.params[4].setErrorMessage("Cannot pick the same field")
else:
.....
But this didn't really do anything. No little red crosses appeared and the tool ran anyway. So is there an easier way to ensure that 3 different inputs are picked that I havn't noticed yet? Or what would be the correct way to do this in a toolvalidator. I have read (and re-read) all the help stuff on this but can find no pointers yet on how to do this. Also looked at some of the videos from Dev Summit 2012 re tool scripting. Thanks in advance, Neil
... View more
10-22-2013
08:46 AM
|
0
|
4
|
2261
|
|
POST
|
What doesn't work? What error do you get. Have you already defined what subtypes 1 & 4 are? Cheers, Neil
... View more
10-22-2013
05:32 AM
|
0
|
0
|
970
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 09-08-2015 11:28 PM | |
| 1 | 12-20-2013 08:59 PM | |
| 1 | 05-14-2014 10:38 PM | |
| 1 | 12-16-2013 09:05 PM | |
| 1 | 05-31-2019 02:50 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|