Skip to content

Commit

Permalink
check lengths match
Browse files Browse the repository at this point in the history
  • Loading branch information
robitalec committed Dec 5, 2024
1 parent 3e09b51 commit 3a55e12
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/geodetic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ Rcpp::NumericVector CPL_geodetic_azimuth(Rcpp::List sfc, double semi_major, doub
Rcpp::List sfc2(sfc2_);
if (sfc2.size() < 1)
stop("bearing needs at least 2 points"); // #nocov
if (sfc.size() != sfc2.size())
stop("length of x and y must match");
std::vector<LWGEOM *> lw2 = lwgeom_from_sfc(sfc2);
for (int i = 0; i < ret.size(); i++) {
ret[i] = lwgeom_azumith_spheroid((LWPOINT*) lw[i], (LWPOINT*) lw2[i], &s);
Expand Down

0 comments on commit 3a55e12

Please sign in to comment.