POST
|
Hi, this is not a question but a way to trace a network on ArcGis 10 (trace tool is only available as of 10.1), provided it is topologically correct and the direction of the network is correct. Basically - Select the first segment of interest, in my case i did it with select by location. - Extract vertex: if you are going upwards up the network then choose START vertex, if you are going downwards then choose END vertex. - Create the following loop: Select next group of segments based on the extracted vertex; carefull it should be with the option BOUNDARY_TOUCH. Create feature/shape based on this selection Extract vertex again. So, solved the looping control quite easily and fast, so here goes the whole deal (not such a big deal): # Note: In my case I selected my first segment as being the one that intersects a given point. Of course you change this according to your needs. arcpy.MakeFeatureLayer_management(your_point, 'your_point_lyr') arcpy.MakeFeatureLayer_management(your_network, 'your_network_lyr') arcpy.SelectLayerByLocation_management('your_network_lyr', 'INTERSECT', 'your_point_lyr') arcpy.FeatureVerticesToPoints_management('your_network_lyr',start_vertex, "START") print 'done start vertex' # It is important to use BOUNDARY_TOUCHES, only then will it choose all segments touching that point. If you use INTERSECT it will only choose one segment. # Save the new network outside the loop. segment_river_before = 0 segment_river_after = 1 n = 0 while segment_river_after != segment_river_before: n +=1 segment_river_before = int(arcpy.GetCount_management(your_network_lyr).getOutput(0)) arcpy.MakeFeatureLayer_management(start_vertex, 'start_v_lyr') arcpy.SelectLayerByLocation_management('your_network_lyr', 'BOUNDARY_TOUCHES', 'start_v_lyr') segment_river_after = int(arcpy.GetCount_management(your_network_lyr).getOutput(0)) arcpy.FeatureVerticesToPoints_management('your_network_lyr, start_vertex, "START") print 'No. of loops made, No. of river segments before and after', n, segment_river_before, segment_river_after arcpy.CopyFeatures_management("net_lyr", new_net, "", "0", "0", "0") print 'Yeiiiii, it worked'
... View more
10-31-2014
04:50 AM
|
0
|
0
|
2744
|
POST
|
So, I managed to solve the issue. My problem was the "separator". I was using " ; " instead of " , " thus the input was being interpreted as one single file. Thanks Dan by the way.
... View more
10-21-2014
03:41 AM
|
0
|
0
|
600
|
POST
|
I actually started with a Model on Model Builder (as I usually do), after it worked I exported to Python and begann to edit it. It came out as follows: arcpy.MosaicToNewRaster_management("full_path1\\grid1;full_path2\\grid2", target_dir.... ) when I make a print out of any of my three options, it comes out as the input above, unless there is some hidden character which I doubt, and that is what is most mind boggling.
... View more
10-21-2014
12:12 AM
|
0
|
1
|
600
|
POST
|
Hi, I am trying to mosaic a list of grids with arcpy.MosaicToNewRaster_management but keep getting a series of errors, no matter what I try. My problem seems to lie on the input rasters. Since I need to mosaic a series of grids, then the input becomes a multi value input, thus I have tried the three ways suggested by ArcGIS Desktop . Yes I am working with ArcGis 10.0 So, first thing with Python List: ERROR 000157: Input and target dataset should have the same number of bands Whith following code: dem_list = ["path1\\grid1;path2\\grid2"] arcpy.MosaicToNewRaster_management(dem_list, target_gdb, "mos_wat", varGeo_SpatRef, "32_BIT_FLOAT", "", "1", "MEAN", "REJECT") Now, with Value Table ERROR 000732: Input Rasters: Dataset F:\FLOODS_USA\A_FLOODS\DEM_SRTM\ADEM_10mUSA_Neue\n25w081\grdn25w081_13;F:\FLOODS_USA\A_FLOODS\DEM_SRTM\ADEM_10mUSA_Neue\n25w081\grdn25w082_13 does not exist or is not supported Whith following code: dem1 = "path1\\grid1" dem2 = "path2\\grid2" vt = arcpy.ValueTable(1) vt.addRow(dem1) vt.addRow(dem2) arcpy.MosaicToNewRaster_management(vt, a_gdb, "mos_wat", varGeo_SpatRef, "32_BIT_FLOAT", "", "1", "MEAN", "REJECT") Finally with String ERROR 000157: Input and target dataset should have the same number of bands Whith following code: dem_list = "path1\\grid1;path2\\grid2" arcpy.MosaicToNewRaster_management(dem_list, target_gdb, "mos_wat", varGeo_SpatRef, "32_BIT_FLOAT", "", "1", "MEAN", "REJECT") For all three cases, if I print the input variable it seems to be in the correct format as bellow path1\grid1;path2\grid2 I have also tried wraping it in quotes as to have "path1\grid1;path2\grid2" and I get the same problem. I have of course searched for answers here and somewhere else, and I find no definitive answer to it, since everything points to what I have already tried without success. I would appreciate any help here. By the way: paths, bands, type and projection are all OK.
... View more
10-20-2014
08:00 AM
|
0
|
4
|
2018
|
POST
|
Hi, it is quite long to explain, but is basically a workaround and what is important is that I only need the triangle geometry as created from a TIN, I do not need the TIN itself. Thus I do not care for elevation values.
... View more
03-11-2014
12:41 AM
|
0
|
0
|
185
|
POST
|
Hi there, while working on a huge project with ArcGis 10 (ArcInfo license fully loaded) I needed to generate some TINs. So long story made short, prototype on Model Builder, Export to Python Script and of course it did not work. Search on the forum gave me some hints, but to my "surprise" not many threads on the subject. The hints where basically two: - CreateTin has some issues working with projections ==> As far as I have tested it is not true, but with it in mind I edited my projection "grammar" and then it worked. - CreateTin requires that at least one input is of type shape.Z ==> Also not true as far as I tested, but with it in mind I then found out that the <None> key word to designate the height field to be used, does not work and I do not seem to find anything wrong with my syntax. Here are the snipets: This one does not work: # arcpy.CreateTin_3d(qq, proyeccion,"F:\\FLOODS_USA\\ASSET_TRIAL\\VertFlood_08_9.shp <None> masspoints <None>", "CONSTRAINED_DELAUNAY") Result: ERROR 000800: The value is not a member of <None> | OBJECTID | STATIC_BFE | DEPTH | VELOCITY | BFE_REVERT | DEP_REVERT | X_Cent | Y_Cent | ORIG_FID. This one works: arcpy.CreateTin_3d(qq, proyeccion, "F:\\FLOODS_USA\\ASSET_TRIAL\\VertFlood_08_9.shp OBJECTID masspoints <None>", "CONSTRAINED_DELAUNAY") Result: Exit code 0. It works The only difference isthat I specified the OBJECTID, which is a field on my attribute table, and then it worked. Why is <None> not being accepted? Any insights on this would be much appreciated as well as any other issue with TINs.
... View more
02-03-2014
06:45 AM
|
0
|
2
|
363
|
POST
|
Hi there, maybe somebody has an idea on this. I am making triangle features from a pretty small TIN. This works fine, I can see the feature layer, its attributes and all. Then I want to extract a zonal statistic from a raster based on one triangle of this feature; so I select the triangle (feature) of interest and then the corresponding analysis tool does not recognizes it / finds it. What works? Well the long way, export the selected triangles to a new feature file (shapefile) and do the zonal statistic from there. Any ideas on how fix this? I wonder if it has something to do with transforming the TIN into a feature layer , but not sure. Thanks. Rafael
... View more
11-18-2013
01:12 AM
|
0
|
0
|
493
|
POST
|
Thanks for the comment Matt, I will try what you said. One thing I noted later today, and that I forgot to post is that things start working once I change the name of the output variable. You see when you leave it to ArcGis to name your output variables, it will put "InputVariableName", "InputVariableName(2)" in my case where the output is only a virtual operation on the same file. Once I changed "InputVariableName(2)" to whatever else, things worked again. Are output variable names actually important? Aren't they just meant for visualization purposes? Isn't the file name what is important? and if in did the output variable name is important, why the hell does ESRI places names automatically that are "automatically" not going to work? Any thoughts on that Matt? Rafael
... View more
10-09-2013
01:44 PM
|
0
|
0
|
712
|
POST
|
Hy everybody, I am trying to make a model on ArcGis 10 Desktop which is going to be part of a huge analysis routine but my problem comes up at the very beginning of things and is quite simple. I need to select a poligon feature which intersects previously selected point feature which is a feature "not intersecting" a third layer, thus the result of a "switch selection". The routine goes like this (see the picture) [ATTACH=CONFIG]28162[/ATTACH] 1) Select points from layer "P" that intersect polygon layer "A" (select by location). 2) Switch selection (select by attribute) because I am interested in the points not intersecting layer "A". 3) Select feature polygons from layer "B" that intersect the result of the switch selection (select by location). As far as I understand, I need to the put the selection type for step 1) and step 3) as "NEW_SELECTION", since I am only interested in these precise features. During my first trials this was not working. The problem actually came during step 2), where the SWITCH_SELECTION instead of switching the selected points, added the previously not selected points. Thus I ended up with my whole point layer being selected. Then I decided to set the selection type to "ADD_TO_SELECTION" on both step 1) and 3). Since on each layer i have nothing else chosen, this should work exactly like "NEW_SELECTION". And Voila, it did worked. Now just for fun I changed back to "NEW_SELECTION" on step 1), and guess what? It also worked. And finally I have tried all combinations: Step 1 Step 3 NEW_... NEW_... NEW_... ADD_... ADD_... NEW_... ADD_... ADD_... and now they all work as expected. That sounds like good news, but I am fearing that there is some bug, that goes away when you start tampering with the selection type. Does anybody knows something about? Similar experience? Some sort of environmental variable or any other crap that needs to be taken care off? It would be of great help since I do not want to get any surprises once I have the full working model. Cheers Rafael
... View more
10-09-2013
02:27 AM
|
0
|
4
|
3319
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|