I am trying to run several tools in a stand-alone Python script. The steps that I want to implement are the follow:
- load a point (observer points) and a building (target) shapefiles.
- construct sight lines from each observer-point to each building, considering the height of the buildings
- extrude the buildings based on their max height
- use the same buildings, extruded, to check whether each sight lines ha actually visibility or whether is obstructed (intervisibility analysis).
I don't have issues in constructing the sight lines. However, even though the following intervisibility method, applied to those lines, is successful, each line results visible. Do you have any suggestion? It looks like at the end the buildings are not extruded at all. I know that I may implement these steps manually, but I do prefer to have everything running from a stand-alone scripts.
this is my code:
arcpy.env.workspace = "../Outputs/tmp"
observer_points = "nodes_copy.shp"
buildings = "buildingsBase.shp"
height_observer = "height"
heigth_buildings = "height"
join_field = None
sampling = 10
direction = "NOT_OUTPUT_THE_DIRECTION"
# transforming shapefile in layer, extrude it and save it as 3d feature class
buildings_layer = arcpy.MakeFeatureLayer_management(buildings, "as_layer").getOutput(0)
arcpy.ddd.ConstructSightLines(observer_points, buildings, sightlines_file,
height_observer, heigth_buildings, join_field, sampling, direction)
arcpy.ddd.Intervisibility(sightlines_file, obstructions= "buildings_extruded.shp", visible_field="Visibility")