Bring a terrain-derived horizon into orientation and visibility calculations, optionally retaining foreground ridge lines for visual interpretation.
importPeakFinder(
file,
svg = NULL,
elevation = NULL,
alt.unc = 0.5,
width = 4096,
image.dir = getwd()
)
file |
Path to a PeakFinder Stellarium ZIP export. |
svg |
Optional path to the matching full-circle Vector SVG export. |
elevation |
Optional verified absolute observer elevation in metres. |
alt.unc |
Assumed horizon altitude uncertainty in degrees, a nonnegative scalar. |
width |
PNG width in pixels, an integer from 512 to 8192. Default 4096. |
image.dir |
Directory for generated PNGs; defaults to the working directory. |
The numerical horizon describes angular obstruction at the observer's location. A separate vector drawing supplies foreground detail but does not explicitly record its vertical angular calibration. Both exports are therefore needed to create a calibrated panorama PNG. Calculations always use the numerical horizon, never the PNG. Terrain data do not include every tree or building.
In PeakFinder choose Export, Horizon for Stellarium and save the ZIP. For an image also choose Export, SVG for printing, Silhouettes (Vector SVG), from 0 to 360 degrees, preferably picture format 16:2. Use exactly the same viewpoint and observer height for both. Contours (Bitmap SVG) is not supported. The PNG is a white terrain silhouette with dark foreground ridge lines and transparent sky, without labels or shading. Only PeakFinder's untransformed M/L vector path format is supported; edited or future formats may require adaptation.
Azimuth ruler positions calibrate horizontal coordinates. The upper envelope of the vector paths is fitted to y = intercept + slope * tan(altitude) using the ZIP horizon. Values at 0.01 degrees are excluded as potentially clipped. Calibration needs at least 20 matches spanning 180 degrees and 0.5 degrees of altitude relief. RMS and maximum angular residuals must not exceed 0.05 and 0.2 degrees. These are compatibility checks, not estimates of terrain accuracy. For low-relief, clipped profiles the importer can instead measure the alpha edge of the eight calibrated, north-first Stellarium textures. It checks coverage, concurrence with unclipped heights, and agreement with the SVG before using the texture-derived numerical horizon. Cropped or ambiguous tiles cannot supply this calibration. Calibration failure, unsupported SVGs or mismatched sites produce a warning and a horizon-only object.
Vector vertices are transformed to linear azimuth and altitude coordinates and rendered to a PNG. Its lower extent is -90 degrees (solid terrain below the drawing), preventing transparent holes when exported to Stellarium. The default width is 4096 pixels, about 0.088 degrees per pixel horizontally; the numerical horizon retains its own sampling. No image array is stored in the returned object. PNGs are read on demand as compact native rasters.
The default image directory is the working directory. A supplied directory
is useful for project files. The object records an absolute PNG path and MD5
checksum. Saving it with saveRDS does not bundle the PNG. When moving a project,
copy the PNG too and reconnect it with relinkHor. Missing or
modified images trigger a warning and ordinary horizon plotting/export.
Repeating an import with the same files and rendering settings reuses the PNG filename.
PeakFinder exports can report an elevation of 0 m plus eye height even at a mountain site. A warning flags this; use elevation to supply a verified absolute observer elevation. This override does not recalculate the downloaded horizon. The default altitude uncertainty of 0.5 degrees is an explicit working assumption, not a measured PeakFinder error estimate. Supply an appropriate value for research.
A skyscapeR.horizon containing a periodically extended numerical horizon, site and source metadata, and, on successful calibration, metadata$image with the external PNG path, checksum, angular bounds and calibration diagnostics.
On matched 1 m terrain at two English sites, the mean absolute skyline difference from Horizon was 0.004 degrees. Agreement with surveyed bearings varied by site. H02 study.
PeakFinder, exported drawings attributed to PeakFinder under CC BY 4.0. Geometry conventions follow the Stellarium User Guide.
createHor, downloadHWT,
plot.skyscapeR.horizon, exportStellarium
## Not run:
hor <- importPeakFinder("landscape.zip") # warns that no PNG was created
hor <- importPeakFinder("landscape.zip", svg="panorama.svg",
image.dir="project-data/horizons", elevation=850)
plot(hor)
exportStellarium(hor, name="PeakFinder example")
## End(Not run)