arcpy.3d.RegularizeAdjacentBuildingFootprint(in_features, group, out_feature_class, method, tolerance, precision, angular_limit)
|
名前
|
説明
|
データ タイプ
|
|
in_features
|
処理対象の入力フィーチャ。
|
Feature Layer
|
|
group
|
完全に一致する、オーバーラップしない境界を共有するフィーチャを特定するために使われるフィールド。
|
Field
|
|
out_feature_class
|
生成されるフィーチャクラス。
|
Feature Class
|
|
method
|
入力フィーチャの正規化に使用する方法。
RIGHT_ANGLES—Identifies the best line segments that fit the input feature vertices along 90° and 180° angles.
RIGHT_ANGLES_AND_DIAGONALS—Identifies the best line segments that fit the input feature vertices along 90°, 135°, and 180° interior angles.
ANY_ANGLES—Identifies the best fit line that falls along any angle while reducing the overall vertex count of the input features.
|
String
|
|
tolerance
|
正規化されたフットプリントが、元のフィーチャの境界から外れることができる最大距離。
|
Linear Unit
|
|
precision
|
正規化プロセスで使用される空間グリッドの精度。 有効な値の範囲は 0.05 〜 0.25 です。
|
Double
|
|
angular_limit
|
直角と対角線 (RIGHT_ANGLES_AND_DIAGONALS) 方法の使用時に、最も適合するラインの内角で許容される最大偏位。 最適な結果を得るには、通常、この値を 5° 未満にしておく必要があります。 このパラメーターは、他の正規化方法では無効になっています。
|
Double
|
コードのサンプル
RegularizeAdjacentBuildingFootprint の例 1 (Python ウィンドウ)
次のサンプルは、Python ウィンドウでこのツールを使用する方法を示しています:
arcpy.env.workspace = 'c:/data'
arcpy.ddd.RegularizeAdjacentBuildingFootprint('rough_footprints.shp', 'Block_ID',
'regularized_footprints.shp',
'RIGHT_ANGLES_AND_DIAGONALS',
'2 Meters', 0.10)
RegularizeAdjacentBuildingFootprint の例 2 (スタンドアロン スクリプト)
次のサンプルは、スタンドアロン Python スクリプトでこのツールを使用する方法を示しています:
'''****************************************************************************
Name: Classify Lidar & Extract Building Footprints
Description: Extract footprint from lidar points classified as buildings,
regularize its geometry, and calculate the building height.
****************************************************************************'''
import arcpy
lasd = arcpy.GetParameterAsText(0)
dem = arcpy.GetParameterAsText(1)
footprint = arcpy.GetParameterAsText(2)
try:
desc = arcpy.Describe(lasd)
if desc.spatialReference.linearUnitName in ['Foot_US', 'Foot']:
unit = 'Feet'
else:
unit = 'Meters'
ptSpacing = desc.pointSpacing * 2.25
sampling = '{0} {1}'.format(ptSpacing, unit)
# Classify overlap points
arcpy.ddd.ClassifyLASOverlap(lasd, sampling)
# Classify ground points
arcpy.ddd.ClassifyLasGround(lasd)
# Filter for ground points
arcpy.management.MakeLasDatasetLayer(lasd, 'ground', class_code=[2])
# Generate DEM
arcpy.conversion.LasDatasetToRaster('ground', dem, 'ELEVATION',
'BINNING NEAREST NATURAL_NEIGHBOR',
sampling_type='CELLSIZE',
sampling_value=desc.pointSpacing)
# Classify noise points
arcpy.ddd.ClassifyLasNoise(lasd, method='ISOLATION', edit_las='CLASSIFY',
withheld='WITHHELD', ground=dem,
low_z='-2 feet', high_z='300 feet',
max_neighbors=ptSpacing, step_width=ptSpacing,
step_height='10 feet')
# Classify buildings
arcpy.ddd.ClassifyLasBuilding(lasd, '7.5 feet', '80 Square Feet')
#Classify vegetation
arcpy.ddd.ClassifyLasByHeight(lasd, 'GROUND', [8, 20, 55],
compute_stats='COMPUTE_STATS')
# Filter LAS dataset for building points
lasd_layer = 'building points'
arcpy.management.MakeLasDatasetLayer(lasd, lasd_layer, class_code=[6])
# Export raster from lidar using only building points
temp_raster = 'in_memory/bldg_raster'
arcpy.management.LasPointStatsAsRaster(lasd_layer, temp_raster,
'PREDOMINANT_CLASS', 'CELLSIZE', 2.5)
# Convert building raster to polygon
temp_footprint = 'in_memory/footprint'
arcpy.conversion.RasterToPolygon(temp_raster, temp_footprint)
# Regularize building footprints
arcpy.ddd.RegularizeBuildingFootprint(temp_footprint, footprint,
method='RIGHT_ANGLES')
except arcpy.ExecuteError:
print(arcpy.GetMessages())