POST
|
I made a story map journal with a map as the main stage. The main stage map has pop-ups configured, but on certain (Samsung tab, galaxy) mobile devices, the pop-ups do not display when tapped in the main stage. The pop-ups work correctly on a desktop PC and apple devices. The pop-ups work on android devices only when the main stage map is accessed independent of the story map journal. Here is the link the the story map journal: http://arcg.is/1yYtT1L Any help is greatly appreciated, thanks.
... View more
06-16-2015
12:30 PM
|
0
|
1
|
2945
|
POST
|
Thanks Josh, this was good advice. Unfortunately I do need the near tool to recalculate each iteration of the loop. My tentative solution is to nest the entire script(except the initial variable declaration) within a where loop so that the update cursor can be deleted for the next near analysis to be run. I am still working out the appropriate syntax for the where clause. I appreciate the help!
... View more
02-18-2014
05:54 AM
|
0
|
0
|
278
|
POST
|
I am new to python and trying to create a script that will help individuate trees from a LiDAR point cloud. I'm starting with a point feature class of LiDAR returns and using it as a template for another point feature class for spatial comparison. An update cursor is then created for the initial feature class and a variable declared as zero to assign a tree ID number. Using a for loop, each row is assigned a tree ID number based on the results of a near analysis(proximity toolset). The row is assigned a unique tree number(if no near feature was found) or given the tree ID number of the near feature(if one was returned by the near analysis). Then a copy of the current row is inserted into the comparison feature class and the loop iterates again until all features have been assigned a tree ID number. That's the concept, but at the moment my script will simply assign every row a unique tree ID number rather than several rows sharing tree ID numbers. Here is what my script looks like now: #import required modules import arcpy from arcpy import env #specify workspace env.workspace = "C:/Columbus_OH_LiDAR_2011/Canopy.gdb" #specify source geometry points = "C:/Columbus_OH_LiDAR_2011/Canopy.gdb/Extract_BS868661" #create comparison geometry feature class ind_trees = arcpy.CreateFeatureclass_management(env.workspace, "ind_trees", "POINT", points, "DISABLED", "SAME_AS_TEMPLATE", points) #create update cursor Ucur = arcpy.updateCursor(points, "", "", "", "HEIGHT D") #declare variable used to assign tree ID number x = 0 for row_u in Ucur: [INDENT]#find nearest feature within a search distance[/INDENT] [INDENT]arcpy.Near_analysis(points, ind_trees, row_u.HEIGHT / 4)[/INDENT] [INDENT]#tree ID assigned where no near feature was found[/INDENT] [INDENT]if row_u.NEAR_FID == -1:[/INDENT] [INDENT=2]row_u.TREE_NUM = x[/INDENT] [INDENT=2]Ucur.updateRow(row_u)[/INDENT] [INDENT=2]x = x + 1[/INDENT] [INDENT]#assign tree ID from near feature[/INDENT] [INDENT]else:[/INDENT] [INDENT=2]Scur = arcpy.SearchCursor(ind_trees)[/INDENT] [INDENT=2]for row_s in Scur:[/INDENT] [INDENT=3]if row_s.OBJECTID == row_u.NEAR_FID:[/INDENT] [INDENT=4]row_u.TREE_NUM = row_s.TREE_NUM[/INDENT] [INDENT=4]Ucur.updateRow(row_u)[/INDENT] [INDENT=2]del row_s[/INDENT] [INDENT=2]del Scur[/INDENT] [INDENT]#insert a copy of current update cursor row object to comparison geometry feature class[/INDENT] [INDENT]Icur = arcpy.InsertCursor(ind_trees)[/INDENT] [INDENT]Nrow = Icur.newRow()[/INDENT] [INDENT]Nrow.Shape = row_u.Shape[/INDENT] [INDENT]Nrow.PointCount = row_u.PointCount[/INDENT] [INDENT]Nrow.ORIG_FID = row_u.ORIG_FID[/INDENT] [INDENT]Nrow.Z = row_u.Z[/INDENT] [INDENT]Nrow.RASTERVALU = row_u.RASTERVALU[/INDENT] [INDENT]Nrow.HEIGHT = row_u.HEIGHT[/INDENT] [INDENT]Nrow.TREE_NUM = row_u.TREE_NUM[/INDENT] [INDENT]Nrow.NEAR_FID = row_u.NEAR_FID[/INDENT] [INDENT]Nrow.NEAR_DIST = row_u.NEAR_DIST[/INDENT] [INDENT]Icur.insertRow(Nrow)[/INDENT] [INDENT]del Icur[/INDENT] del row_u del Ucur It appears that the update cursor does not recognize the values generated by the near analysis after it was created, causing the loop never to fall to the else statement. Due to my inexperience, I'm sure there are many things wrong with this script and there's probably a more optimal method to accomplish this task. Any advice would be a huge help. Thanks!
... View more
02-10-2014
10:04 AM
|
0
|
3
|
1022
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|