Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
rhijmans committed Dec 22, 2024
1 parent 02ecc49 commit 43b5fc2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions R/divide.R
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ strip_polygon <- function(x, vertical, horizontal) {


divide_polygon <- function(x, n, w, alpha, ...) {
xcrs <- crs(x)
crs(x) <- "+proj=utm +zone=1"
s <- terra::spatSample(x, max(n*4, 1000, log(n) * 100), "regular")
xy <- terra::crds(s)
if (!is.null(w)) {
Expand Down Expand Up @@ -231,11 +233,9 @@ setMethod("divide", signature(x="SpatVector"),
n <- round(n)
stopifnot(n > 0)
if (n == 1) return(deepcopy(x))
xcrs <- crs(x)
crs(x) <- "+proj=utm +zone=1"
out <- lapply(1:nrow(x), function(i) divide_polygon(x[i], n, w, alpha, ...))
}
return(do.call(rbind, out))
return()
}
)

2 changes: 1 addition & 1 deletion src/write_ogr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ GDALDataset* SpatVector::write_ogr(std::string filename, std::string lyrname, st
otype = OFTReal;
} else if (tps[i] == "long") {
std::vector<long> rge = vrange(df.getI(i), true);
if ((rge[0] >= -32768) && (rge[1] <= 32767)) {
if ((rge[0] >= -2147483648) && (rge[1] <= 2147483648)) {
otype = OFTInteger;
} else {
otype = OFTInteger64;
Expand Down

0 comments on commit 43b5fc2

Please sign in to comment.