(1)简介
(2)文档参考
Viewshed_sa <in_raster> <in_observer_features> <out_raster> {z_factor} {FLAT_EARTH | CURVED_EARTH} {refractivity_coefficient}
Parameter | Explanation | Data Type |
<in_raster> | Input raster. | Composite Geodataset |
<in_observer_features> | Observer point or polyline features. | Composite Geodataset |
<out_raster> | The raster to be created. The output will only record the number of times each in_raster location can be seen by the in_observer_features observation points (or vertices for polylines). The observation frequency will be recorded in the VALUE item in the output raster's attribute table. | Raster Dataset |
{z_factor} | The number of ground x,y units in one surface z unit. The z-factor adjusts the units of measure for the z units when they are different from the x,y units of the input surface. The z-values of the input surface are multiplied by the z-factor when calculating the final output surface. If the x,y units and z units are in the same units of measure, the z-factor is 1. This is the default. If the x,y units and z units are in different units of measure, the z-factor must be set to the appropriate factor, or the results will be incorrect. For example, if your z units are feet and your x,y units are meters, you would use a z-factor of 0.3048 to convert your z units from feet to meters (1 foot = 0.3048 meter). | Double |
{FLAT_EARTH | CURVED_EARTH} | Allows correction for the earth's curvature.
| Boolean |
{refractivity_coefficient} | Coefficient of the refraction of visible light in air. The default value is 0.13. | Double |
Data types for geoprocessing tool parameters
Command line example
Viewshed_sa C:/data/dem C:/data/observers.shp C:/data/viewshed
Scripting syntax
About getting started with writing geoprocessing scripts
Viewshed_sa (in_raster, in_observer_features, out_raster, z_factor, curvature_correction, refractivity_coefficient)
Parameter | Explanation | Data Type |
in_raster (Required) | Input raster. | Composite Geodataset |
in_observer_features (Required) | Observer point or polyline features. | Composite Geodataset |
out_raster (Required) | The raster to be created. The output will only record the number of times each in_raster location can be seen by the in_observer_features observation points (or vertices for polylines). The observation frequency will be recorded in the VALUE item in the output raster's attribute table. | Raster Dataset |
z_factor (Optional) | The number of ground x,y units in one surface z unit. The z-factor adjusts the units of measure for the z units when they are different from the x,y units of the input surface. The z-values of the input surface are multiplied by the z-factor when calculating the final output surface. If the x,y units and z units are in the same units of measure, the z-factor is 1. This is the default. If the x,y units and z units are in different units of measure, the z-factor must be set to the appropriate factor, or the results will be incorrect. For example, if your z units are feet and your x,y units are meters, you would use a z-factor of 0.3048 to convert your z units from feet to meters (1 foot = 0.3048 meter). | Double |
curvature_correction (Optional) | Allows correction for the earth's curvature.
| Boolean |
refractivity_coefficient (Optional) | Coefficient of the refraction of visible light in air. The default value is 0.13. | Double |
Data types for geoprocessing tool parameters
(3)代码参考
/// <summary>
/// GP视域
/// </summary>
/// <param name="in_before_surface">输入填/挖之前的栅格表面</param>
/// <param name="in_observer_point_features">输入观察点或观察折线要素</param>
/// <param name="out_raster">输出栅格</param>Viewshed
/// <param name="z_factor">Z 因子 (可选)</param>
/// <param name="curvature_correction">输出地平面以上的栅格 (可选)</param>
/// <param name="refractivity_coefficient">折射系数 (可选)</param>
private void GPViewshed(string in_before_surface, string in_observer_features, string out_raster, double z_factor, string curvature_correction, double refractivity_coefficient)
{
Geoprocessor gp = new Geoprocessor();
Viewshed op = new Viewshed();
op.in_raster = in_before_surface;
op.in_observer_features = in_observer_features;
op.out_raster = out_raster;
op.z_factor = z_factor;
op.curvature_correction = curvature_correction;
op.refractivity_coefficient = refractivity_coefficient;
try
{
gp.Execute(op, null);
}
catch { }
}