validate_polygon_data {Tivy} | R Documentation |
Validate data for polygon creation
Description
Validates that a data frame contains the necessary columns for creating fishing zone polygons. Checks for either coordinate-based or distance-based polygon definition data.
Usage
validate_polygon_data(data)
Arguments
data |
Data frame to validate. Must contain polygon definition columns. |
Details
The function requires either:
Coordinate-based: StartLatitude, EndLatitude, StartLongitude, EndLongitude
Distance-based: StartLatitude, EndLatitude, StartNauticalMiles, EndNauticalMiles
Value
Returns TRUE invisibly if validation passes, otherwise throws an error.
Examples
# Coordinate-based polygon data
coord_data <- data.frame(
StartLatitude = "15 30 S",
EndLatitude = "15 45 S",
StartLongitude = "75 30 W",
EndLongitude = "75 45 W"
)
validate_polygon_data(coord_data)
# Distance-based polygon data
distance_data <- data.frame(
StartLatitude = "15 30 S",
EndLatitude = "15 45 S",
StartNauticalMiles = 5,
EndNauticalMiles = 15
)
validate_polygon_data(distance_data)
[Package Tivy version 0.1.0 Index]