POST
|
Here is the code… thanks for your help def createInternalParallelLines(): import libraries import arcpy set input/output parameters polyFC = arcpy.GetParameterAsText(0) # input polygons outParallel = arcpy.GetParameterAsText(1) # output parallel lines lineSpacing = arcpy.GetParameterAsText(2) # line spacing buffDist = arcpy.GetParameterAsText(3) # inner buffer distance parse numbers from parameters lineSpaceNum = float(lineSpacing.split(' ')[0]) buffNum = float(buffDist.split(' ')[0]) establish spatial reference desc = arcpy.Describe(polyFC) SR = desc.spatialReference set overwrite environment arcpy.env.overwriteOutput = True arcpy.env.outputCoordinateSystem = SR parallels = [] create hull rectangle to establish a rotated area of interest coordSplit = row[0].hullRectangle.split(' ') collect corner coordinates coordList = arcpy.Array([arcpy.Point(coordSplit[0],coordSplit[1]),arcpy.Point(coordSplit[2],coordSplit[3]),arcpy.Point(coordSplit[4],coordSplit[5]),arcpy.Point(coordSplit[6],coordSplit[7]),arcpy.Point(coordSplit[0],coordSplit[1])]) create lines from hull rectangle currentLines = [] for pointNum in range(0,4): arcpy.Array() hullRecLine = arcpy.Polyline(arcpy.A loop through each input shape for row in arcpy.da.SearchCursor(polyFC, ["SHAPE@"], spatial_reference=SR): create inner buffer polyBuff = row[0].buffer(buffNum * -1) rray()) currentLines.append(hullRecLine) compare first and second line to determine if first line is short or long firstLong = 0 if currentLines[0].length < currentLines[1].length: firstLong = 1 calculate number of points needed along short axis numPoints = int(math.floor(currentLines[firstLong].length/lineSpaceNum)) create and join points to create parallel lines for point in range(1,numPoints+1): shortPoint1 = currentLines[firstLong].positionAlongLine(lineSpaceNum*point) shortPoint2 = currentLines[firstLong + 2].positionAlongLine(currentLines[firstLong + 2].length - (lineSpaceNum*point)) parallel = arcpy.Polyline(arcpy.Array(), SR) intersect parallel lines with buffer parallelBuff = parallel.intersect(polyBuff,2) parallels.append(parallelBuff) write geometries to disk arcpy.CopyFeatures_management(parallels, outParallel) add to map mxd = arcpy.mapping.MapDocument("CURRENT") dataFrame = arcpy.mapping.ListDataFrames(mxd, "*")[0] addLayer = arcpy.mapping.Layer(outParallel) arcpy.mapping.AddLayer(dataFrame, addLayer) del row
... View more
10-17-2018
12:18 PM
|
0
|
1
|
833
|
POST
|
I am having some issues with creating a script to count stairwells from a stair shapefile. I have two shapefiles one being stairs and another one being stairwell. I was instructed to use this code and make a simple script. i am not used to working with python so if you can help that would be much appreciated. code is pasted below. def createInternalParallelLines(): # import libraries import arcpy # set input/output parameters polyFC = arcpy.GetParameterAsText(0) # input polygons outParallel = arcpy.GetParameterAsText(1) # output parallel lines lineSpacing = arcpy.GetParameterAsText(2) # line spacing buffDist = arcpy.GetParameterAsText(3) # inner buffer distance # parse numbers from parameters lineSpaceNum = float(lineSpacing.split(' ')[0]) buffNum = float(buffDist.split(' ')[0]) # establish spatial reference desc = arcpy.Describe(polyFC) SR = desc.spatialReference # set overwrite environment arcpy.env.overwriteOutput = True arcpy.env.outputCoordinateSystem = SR parallels = [] # create hull rectangle to establish a rotated area of interest coordSplit = row[0].hullRectangle.split(' ') # collect corner coordinates coordList = arcpy.Array([arcpy.Point(coordSplit[0],coordSplit[1]),arcpy.Point(coordSplit[2],coordSplit[3]),arcpy.Point(coordSplit[4],coordSplit[5]),arcpy.Point(coordSplit[6],coordSplit[7]),arcpy.Point(coordSplit[0],coordSplit[1])]) # create lines from hull rectangle currentLines = [] for pointNum in range(0,4): arcpy.Array([coordList.getObject(pointNum),coordList.getObject(pointNum+1)]) hullRecLine = arcpy.Polyline(arcpy.A # loop through each input shape for row in arcpy.da.SearchCursor(polyFC, ["SHAPE@"], spatial_reference=SR): # create inner buffer polyBuff = row[0].buffer(buffNum * -1) rray([coordList.getObject(pointNum),coordList.getObject(pointNum+1)])) currentLines.append(hullRecLine) # compare first and second line to determine if first line is short or long firstLong = 0 if currentLines[0].length < currentLines[1].length: firstLong = 1 # calculate number of points needed along short axis numPoints = int(math.floor(currentLines[firstLong].length/lineSpaceNum)) # create and join points to create parallel lines for point in range(1,numPoints+1): shortPoint1 = currentLines[firstLong].positionAlongLine(lineSpaceNum*point) shortPoint2 = currentLines[firstLong + 2].positionAlongLine(currentLines[firstLong + 2].length - (lineSpaceNum*point)) parallel = arcpy.Polyline(arcpy.Array([shortPoint1.centroid,shortPoint2.centroid]), SR) # intersect parallel lines with buffer parallelBuff = parallel.intersect(polyBuff,2) parallels.append(parallelBuff) # write geometries to disk arcpy.CopyFeatures_management(parallels, outParallel) # add to map mxd = arcpy.mapping.MapDocument("CURRENT") dataFrame = arcpy.mapping.ListDataFrames(mxd, "*")[0] addLayer = arcpy.mapping.Layer(outParallel) arcpy.mapping.AddLayer(dataFrame, addLayer) del row
... View more
10-17-2018
12:09 PM
|
0
|
5
|
686
|
POST
|
here is the code below. again im not too familar with python so i am asking for some help def createInternalParallelLines(): # import libraries import arcpy # set input/output parameters polyFC = arcpy.GetParameterAsText(0) # input polygons outParallel = arcpy.GetParameterAsText(1) # output parallel lines lineSpacing = arcpy.GetParameterAsText(2) # line spacing buffDist = arcpy.GetParameterAsText(3) # inner buffer distance # parse numbers from parameters lineSpaceNum = float(lineSpacing.split(' ')[0]) buffNum = float(buffDist.split(' ')[0]) # establish spatial reference desc = arcpy.Describe(polyFC) SR = desc.spatialReference # set overwrite environment arcpy.env.overwriteOutput = True arcpy.env.outputCoordinateSystem = SR parallels = [] # create hull rectangle to establish a rotated area of interest coordSplit = row[0].hullRectangle.split(' ') # collect corner coordinates coordList = arcpy.Array([arcpy.Point(coordSplit[0],coordSplit[1]),arcpy.Point(coordSplit[2],coordSplit[3]),arcpy.Point(coordSplit[4],coordSplit[5]),arcpy.Point(coordSplit[6],coordSplit[7]),arcpy.Point(coordSplit[0],coordSplit[1])]) # create lines from hull rectangle currentLines = [] for pointNum in range(0,4): arcpy.Array([coordList.getObject(pointNum),coordList.getObject(pointNum+1)]) hullRecLine = arcpy.Polyline(arcpy.A # loop through each input shape for row in arcpy.da.SearchCursor(polyFC, ["SHAPE@"], spatial_reference=SR): # create inner buffer polyBuff = row[0].buffer(buffNum * -1) rray([coordList.getObject(pointNum),coordList.getObject(pointNum+1)])) currentLines.append(hullRecLine) # compare first and second line to determine if first line is short or long firstLong = 0 if currentLines[0].length < currentLines[1].length: firstLong = 1 # calculate number of points needed along short axis numPoints = int(math.floor(currentLines[firstLong].length/lineSpaceNum)) # create and join points to create parallel lines for point in range(1,numPoints+1): shortPoint1 = currentLines[firstLong].positionAlongLine(lineSpaceNum*point) shortPoint2 = currentLines[firstLong + 2].positionAlongLine(currentLines[firstLong + 2].length - (lineSpaceNum*point)) parallel = arcpy.Polyline(arcpy.Array([shortPoint1.centroid,shortPoint2.centroid]), SR) # intersect parallel lines with buffer parallelBuff = parallel.intersect(polyBuff,2) parallels.append(parallelBuff) # write geometries to disk arcpy.CopyFeatures_management(parallels, outParallel) # add to map mxd = arcpy.mapping.MapDocument("CURRENT") dataFrame = arcpy.mapping.ListDataFrames(mxd, "*")[0] addLayer = arcpy.mapping.Layer(outParallel) arcpy.mapping.AddLayer(dataFrame, addLayer) del row
... View more
10-17-2018
12:07 PM
|
0
|
0
|
833
|
POST
|
I am trying to find out why the python script that I wrote isnt working. I am trying to count the number of stairs in a stairwell. I have two shapefiles and i wrote the script to run auto and process how many stairs there are. if someone can help me with this I would appreciate it thanks.
... View more
10-17-2018
08:08 AM
|
0
|
4
|
996
|
POST
|
i am using workforce in our streets and signals department and we would like to know if there is a way that we can email notifications when a work order is given to someone, if there any changes, or when it is finished back to the dispatcher? Is there a way to configure this somewhere?
... View more
10-16-2018
02:19 PM
|
0
|
0
|
259
|
POST
|
hi there i have a question as to how to create and configure the map that the dispatchers see on workforce after they log in. Where do I go to add the aerial basemap instead of the topographic map> Also if we want to add layers from AGOL, where would we add this? Thanks
... View more
10-15-2018
01:08 PM
|
0
|
1
|
393
|
POST
|
where do we add the code in which widget json file do we add this to specifically? Robert Scheitlin, GISP
... View more
07-11-2018
10:13 AM
|
0
|
1
|
404
|
POST
|
Robert Scheitlin, GISP hi robert i recently updated the webapp builder to 2.8 and tried to update our maps. I have went to your esearch page and downloaded the latest one that was on the bottom. I am trying to see that when i go and make a custom search and try to test it it doesnt work. Does that version work with 2.8 or do i have to downgrade. we had 2.2 and then upgraded to 2.8. Can you please help me? It never did that when i went from 1.2 to 2.2 last year. Thanks
... View more
06-26-2018
02:28 PM
|
0
|
1
|
553
|
POST
|
hello there i have recently uploaded to webappbuilder 2.8. I went to your enhanced search tool and dowloaded the esearch tool and installed it in the correct folder. After i make a custom search, it does not want to show up it just sits and becomes idle. does the latest search tool that you have work with 2.8? It will allow me to build the search but after when i go to test it, its not letting me do anything. am i doing something wrong? Web AppBuilder Custom Widgets Roberts Custom WAB Widgets @robert
... View more
06-26-2018
02:23 PM
|
0
|
1
|
415
|
POST
|
I have read the thread but I am sorry maybe im not understanding where you made the orginal post or what but this is very confusing for me. Im still new to javascript programming if you can please help me out or show me where in the thread which lines to use I would appreciate it. Thank you
... View more
01-17-2018
01:55 PM
|
0
|
1
|
999
|
POST
|
I read the thread and I saw that any changes are made in the config folder. What I am not understanding is how to change it. That is what I need help with. I went to that folder and accessed the config file. The concern I have is where I put the code that you wrote out in the thread where its marked correct answer.
... View more
01-17-2018
01:44 PM
|
0
|
3
|
999
|
POST
|
Ok I have found the file that you are talking about. What code do I put in here to change the zoom file. I have attached a pic to show how the coding looks so far.
... View more
01-17-2018
12:31 PM
|
0
|
5
|
999
|
POST
|
On the json file, which one do we use. I opened the one that is under the widgets file called search, but I don’t see the lines where it needs to be place.. I have attached a pic. I am using the right one
... View more
01-17-2018
12:03 PM
|
0
|
0
|
999
|
POST
|
rscheitlin we are trying to see if there is a way we can set the length of zoom the address search does when we look for a address. Instead of going right to the address, is there a way we can change the zoom in length it goes?
... View more
01-17-2018
09:49 AM
|
0
|
10
|
1169
|
POST
|
hello there we are getting ready to upgrade our server to 10.5 and we are looking to see if the existing web applications built in version 2.2 will have to be remade or will they continue to function normally? rscheitlin
... View more
01-17-2018
09:47 AM
|
0
|
1
|
227
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:25 AM
|