Git Product home page Git Product logo

lwgeom's People

Contributors

ateucher avatar bennet-umich avatar cmarquardt avatar dbaston avatar edzer avatar etiennebr avatar jeffreyhanson avatar jeroen avatar kalibera avatar milesmcbain avatar olivroy avatar pat-s avatar robinlovelace avatar rsbivand avatar rundel avatar tim-salabim avatar uribo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lwgeom's Issues

Problem with st_transform_proj

I've tested the st_transform_proj() function and found out that it doesn't work properly with some of the projections, including Winkel Tripel, Boggs Eumorphic, or Natural Earth.
For these projections, the function creates a new object (without a warning or error) that can printed. However, it is impossible to plot the new object:

library(spData)
library(sf)
#> Linking to GEOS 3.5.0, GDAL 2.1.2, proj.4 4.9.2
library(lwgeom)
#> Linking to liblwgeom 2.5.0dev r16016
world_wintri = st_transform_proj(world, crs = "+proj=wintri")
head(world_wintri)
#> Simple feature collection with 6 features and 10 fields
#> geometry type:  MULTIPOLYGON
#> dimension:      XY
#> bbox:           xmin: -6013512 ymin: -6276076 xmax: 6211408 ymax: 4761920
#> epsg (SRID):    NA
#> proj4string:    +proj=wintri
#>   iso_a2            name_long     continent region_un       subregion
#> 1     AF          Afghanistan          Asia      Asia   Southern Asia
#> 2     AO               Angola        Africa    Africa   Middle Africa
#> 3     AL              Albania        Europe    Europe Southern Europe
#> 4     AE United Arab Emirates          Asia      Asia    Western Asia
#> 5     AR            Argentina South America  Americas   South America
#> 6     AM              Armenia          Asia      Asia    Western Asia
#>                type   area_km2      pop  lifeExp gdpPercap
#> 1 Sovereign country  652270.07 31627506 60.37446  1844.022
#> 2 Sovereign country 1245463.75 24227524 52.26688  6955.960
#> 3 Sovereign country   29694.80  2893654 77.83046 10698.525
#> 4 Sovereign country   79880.74  9086139 77.36817 63830.700
#> 5 Sovereign country 2784468.59 42980026 76.15861 18872.967
#> 6 Sovereign country   28656.60  3006154 74.67571  7706.133
#>                             geom
#> 1 MULTIPOLYGON (((5108567.494...
#> 2 MULTIPOLYGON (((1484047.791...
#> 3 MULTIPOLYGON (((1663361.831...
#> 4 MULTIPOLYGON (((4520545.763...
#> 5 MULTIPOLYGON (((-4723076.95...
#> 6 MULTIPOLYGON (((3531966.010...
plot(world_wintri)
#> Warning: plotting the first 9 out of 10 attributes; use max.plot = 10 to
#> plot all
#> OGR: Corrupt data
#> Error in CPL_gdal_dimension(st_geometry(x), NA_if_empty): OGR error
world_boggs = st_transform_proj(world, crs = "+proj=boggs")
plot(world_boggs$geom)
#> OGR: Corrupt data
#> Error in CPL_gdal_dimension(st_geometry(x), NA_if_empty): OGR error
world_natearth = st_transform_proj(world, crs = "+proj=natearth")
plot(world_natearth$geom)
#> OGR: Corrupt data
#> Error in CPL_gdal_dimension(st_geometry(x), NA_if_empty): OGR error

unexpected proj error in install?

I cannot seem to install lwgeom on a vanilla Ubuntu 18.04 (bionic) instance, which has: GEOS 3.6.2, GDAL 2.2.3, PROJ 4.9.3 (as reported by sf 😺 ). I get the error:

checking proj_api.h usability... no
checking proj_api.h presence... no
checking for proj_api.h... no
configure: error: proj_api.h not found in standard or given locations.
ERROR: configuration failed for package ‘lwgeom’

Any ideas? (DESCRIPTION says GEOS >= 3.5.0 and PROJ >= 4.8.0 should be enough?)

Add SQLITE in the SystemRequirements line of the DESCRIPTION file

Hi,

As far as I understand, lwgeom depends on SQLite only insofar as libproj depends on it (though maybe I'm wrong here, but it would only make my point more valid I guess?). Yet, as far as users and, more importantly perhaps, packagers are concerned, SQLite is a direct dependency of lwgeom, because it is needed to be installed on the system, including "-dev/-devel" subpackages in order to build lwgeom.

As such, I believe it would be relevant to add "SQLITE (>=3.XXX)" (I believe, correct version is 3.11, same as PROJ?) in the "SystemRequirements:" line of the DESCRIPTION file.

As a concrete example, on openSUSE, we are using an automatic build system for R packages to generate RPMs for our users, and it scans the DESCRIPTION file for this line in order to detect the needed system dependencies. Right now, it is failing for lwgeom because it lacks the (unspecified) SQLITE dependency at build time.

Thank you!

PS: Of note, I saw "sqlite3" is mentioned in "SystemRequirements" of the "sf" package.

Viable approach to ST_LineSubString?

I worked up a decent approach (in that it seems quite fast working with >70k river features) to the same geometric function as ST_LineSubString over here: https://gist.github.com/dblodgett-usgs/cf87392c02d73f1b7d16153d2b66a8f3 It is written to orchestrate over an sf LINESTRING dataframe though. Some work would be required to boil it down to the basic function.

@edzer you told me to raise this here, but since it doesn't use lwgeom, (it's dplyr / sf) is it really appropriate?

This function is pretty GIS - swiss army knife, but it would be good to have a ST_LineSubString function some place... fine to move on if this doesn't fit, but wanted to offer it up if it seems applicable.

liblwgeom.h:38:26: error: invalid token at start of a preprocessor expression when compliling for OS X

I'm working to get the conda-forge build working and have hit a snag when building for OS X. The relevant portion of the log is reproduced below, and the full log is at https://dev.azure.com/conda-forge/84710dde-1620-425b-80d0-4cf5baca359d/_apis/build/builds/275815/logs/35

Any thoughts?

2021-02-09T19:10:09.3315860Z config.status: creating src/postgis_config.h
2021-02-09T19:10:09.4638060Z ** libs
2021-02-09T19:10:09.4836740Z x86_64-apple-darwin13.4.0-clang++ -std=gnu++11 -I"$PREFIX/lib/R/include" -DNDEBUG -DUSE_PROJ_H -I$PREFIX/include -DPOSTGIS_GEOS_VERSION=35 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I'$PREFIX/lib/R/library/Rcpp/include' -I'$PREFIX/lib/R/library/sf/include' -D_FORTIFY_SOURCE=2 -isystem $PREFIX/include -mmacosx-version-min=10.9 -I$PREFIX/include   -fPIC  -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -stdlib=libc++ -fvisibility-inlines-hidden  -fmessage-length=0 -isystem $PREFIX/include -fdebug-prefix-map=/Users/runner/miniforge3/conda-bld/r-base-split_1611775855546/work=/usr/local/src/conda/r-base-4.0.3 -fdebug-prefix-map=$PREFIX=/usr/local/src/conda-prefix  -c geodetic.cpp -o geodetic.o
2021-02-09T19:10:16.0090620Z In file included from geodetic.cpp:6:
2021-02-09T19:10:16.0120480Z ./liblwgeom/liblwgeom.h:38:26: error: invalid token at start of a preprocessor expression
2021-02-09T19:10:16.0222050Z #if POSTGIS_PROJ_VERSION < 60
2021-02-09T19:10:16.0235420Z                          ^
2021-02-09T19:10:16.0336720Z ./liblwgeom/liblwgeom.h:69:26: error: invalid token at start of a preprocessor expression
2021-02-09T19:10:16.0341140Z #if POSTGIS_PROJ_VERSION < 49
2021-02-09T19:10:16.0442620Z                          ^
2021-02-09T19:10:16.0461370Z ./liblwgeom/liblwgeom.h:2382:26: error: invalid token at start of a preprocessor expression
2021-02-09T19:10:16.0462710Z #if POSTGIS_PROJ_VERSION < 60
2021-02-09T19:10:16.0463760Z                          ^
2021-02-09T19:10:16.0464920Z ./liblwgeom/liblwgeom.h:2399:26: error: invalid token at start of a preprocessor expression
2021-02-09T19:10:16.0466330Z #if POSTGIS_PROJ_VERSION >= 60
2021-02-09T19:10:16.0467630Z                          ^
2021-02-09T19:10:16.6005880Z 4 errors generated.
2021-02-09T19:10:16.6109090Z make: *** [/Users/runner/miniforge3/conda-bld/r-lwgeom_1612897421165/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/R/etc/Makeconf:181: geodetic.o] Error 1
2021-02-09T19:10:16.6221620Z ERROR: compilation failed for package ‘lwgeom’

st_split decomposes linestring into pieces when linstring has overlapping segments

My goal is to split a linestring using a polygon. When the linestring is entirely in the polygon, I'm expecting st_split to return the entire linestring as output. I got an unexpected result and after digging, I found that the linestring being completely in the polygon had overlapping segments. Because of this, it is decomposed in parts.

Example:

library(sf)
library(lwgeom)

# Define the border, a polygon
four_corners <- matrix(c(0, 0, 4, 0, 4, 3, 0, 3, 0, 0), 
                       ncol=2, byrow=TRUE)
pts <- list(four_corners)
my_polygon <- st_polygon(pts)

# Define a route in the middle of the polygon, not crossing it
x_coord = c(1, 2, 2, 2, 3)
y_coord = c(1, 1, 2, 1, 1)
coordinate_matrix <- cbind(x_coord, y_coord)
one_route = st_linestring(coordinate_matrix)

# Split the routes in different subroutes cut by the border (st_split)
splitted_routes <- st_split(one_route, my_polygon)
print(length(splitted_routes))
for (parts in 1:length(splitted_routes)) {
  print(splitted_routes[parts])
}

I'm expecting length(splitted_routes) to be 1.

Is this the expected behavior of st_split? And how could I get what I'm expecting in this case? I'm confused.

The full question and thinking about this problem is available here: https://gis.stackexchange.com/questions/395751/split-a-line-by-a-polygon-why-are-internal-lines-split-in-parts-using-sf-st

Support for PROJ 6.0.0

lwgeom still uses proj_api.h which is deprecated in PROJ 6.0.0 and will be removed in PROJ 7.0.0 (scheduled for March 2020).

When using proj_api.h with PROJ 6.0.0 -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H=1 needs to be added to CFLAGS to prevent a compiler error.

lwgeom should be updated to (also) support the proj.h API.

Github actions and R-CMD-Check with lwgeom failing

Sorry if this isn't the best spot for this issue.

I am trying to set up a Github Actions workflow for R-CMD-Check with a package that has lwgeom as an Imports. Builds and checks fine locally, and works fine on a Windows build via gh workflows, On Ubuntu the lwgeom package install fails with:

* installing *source* package ‘lwgeom’ ...
** package ‘lwgeom’ successfully unpacked and MD5 sums checked
** using staged installation
configure: CC: gcc
configure: CXX: g++ -std=gnu++11
configure: pkg-config proj exists, will use it
checking proj_api.h usability... no
checking proj_api.h presence... no
configure: error: proj_api.h not found in standard or given locations.
checking for proj_api.h... no
ERROR: configuration failed for package ‘lwgeom’
* removing ‘/home/runner/work/_temp/Library/lwgeom’

The downloaded source packages are in
	‘/tmp/RtmpdW5KbT/downloaded_packages’
Warning message:
In i.p(...) : installation of package ‘lwgeom’ had non-zero exit status

sf installs and works fine, but lwgeom isn't. I am not very familiar with the GitHub actions so I am very likely missing something obvious and I have searched for example workflows that use lwgeom but couldn't find any.

I have a small package example at https://github.com/jhollist/testpkg.

Any obvious insights appreciated!

check errors with liblwgeom 2.4.1 r16012

With a later liblwgeom version than travis and appveyor, I'm seeing:

> library(lwgeom)
Linking to lwgeom 2.4.1 r16012
> library(sf)
Linking to GEOS 3.6.2, GDAL 2.2.2, proj.4 4.9.3
> nc = st_read(system.file("gpkg/nc.gpkg", package="sf"))
Reading layer `nc.gpkg' from data source `/home/rsb/lib/r_libs/sf/gpkg/nc.gpkg' using driver `GPKG'
Simple feature collection with 100 features and 14 fields
geometry type:  MULTIPOLYGON
dimension:      XY
bbox:           xmin: -84.32385 ymin: 33.88199 xmax: -75.45698 ymax: 36.58965
epsg (SRID):    4267
proj4string:    +proj=longlat +datum=NAD27 +no_defs
> st_geod_area(nc[1:3,])
Error in CPL_geodetic_area(st_geometry(x), p$SemiMajor, p$InvFlattening) : 
  Expecting a single value: [extent=0].

and

> library(sf)
Linking to GEOS 3.6.2, GDAL 2.2.2, proj.4 4.9.3
> library(lwgeom)
Linking to lwgeom 2.4.1 r16012
> p = st_sfc(st_point(c(7,52)), st_point(c(8,53)), crs = 4326)
> st_geod_azimuth(p)
Error in CPL_geodetic_azimuth(st_geometry(x), p$SemiMajor, p$InvFlattening) : 
  Expecting a single value: [extent=0].
Calls: st_geod_azimuth -> CPL_geodetic_azimuth -> .Call
Execution halted

in tests/azimuth.R. Should I back-track to an older liblwgeom?

st_perimeter() fails with crs NA

st_perimeter has a check such as: Error in if (st_is_longlat(x))

unfortunately, this will fail if the st_is_longlat(x) is NA, with error message:
Error in if (st_is_longlat(x)) stop("for perimeter of longlat geometry, cast to LINESTRING and use st_length") : missing value where TRUE/FALSE needed

Could the function handle this case? Maybe if (isTRUE(st_is_longlat(x))) ? Or return stop in any case?

Thanks!

./liblwgeom/liblwgeom.h:49:10: fatal error: proj.h: No such file or directory [[email protected]]

See:

> install.packages("lwgeom")
Installing package into ‘/home/spack/spack/opt/spack/linux-centos8-aarch64/gcc-8.3.1/r-testthat-2.3.2-bfjih2xikzlqryku7amoi7qbjegvrm5t/rlib/R/library’
(as ‘lib’ is unspecified)
trying URL 'https://mirrors.bfsu.edu.cn/CRAN/src/contrib/lwgeom_0.2-5.tar.gz'
Content type 'application/octet-stream' length 501653 bytes (489 KB)
==================================================
downloaded 489 KB

* installing *source* package ‘lwgeom’ ...
** package ‘lwgeom’ successfully unpacked and MD5 sums checked
** using staged installation
configure: CC: /usr/bin/gcc
configure: CXX: /usr/bin/g++ -std=gnu++11
configure: pkg-config proj exists, will use it
configure: using proj.h.
configure: PROJ: 6.3.2
checking PROJ: checking whether PROJ and sqlite3 are available for linking:... yes
configure: POSTGIS_PROJ_VERSION: 63
checking for geos-config... /home/spack/spack/opt/spack/linux-centos8-aarch64/gcc-8.3.1/geos-3.8.1-cxocfswylusmwtaw3l7466zcuhjduyal/bin/geos-config
checking geos-config usability... yes
configure: GEOS: 3.8.1
checking GEOS version >= 3.5.0... yes
checking geos: linking with -L/home/spack/spack/opt/spack/linux-centos8-aarch64/gcc-8.3.1/geos-3.8.1-cxocfswylusmwtaw3l7466zcuhjduyal/lib -lgeos_c... yes
checking for GEOS_init_r in -lgeos_c... yes
configure: Package CPP flags:  -DUSE_PROJ_H -I/home/spack/spack/opt/spack/linux-centos8-aarch64/gcc-8.3.1/geos-3.8.1-cxocfswylusmwtaw3l7466zcuhjduyal/include -DPOSTGIS_GEOS_VERSION=35 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H
configure: Package LIBS: -L/home/spack/spack/opt/spack/linux-centos8-aarch64/gcc-8.3.1/proj-6.3.2-2dabkosmblt475wdejd72vbwkowq7d4k/lib -lproj      -L/home/spack/spack/opt/spack/linux-centos8-aarch64/gcc-8.3.1/geos-3.8.1-cxocfswylusmwtaw3l7466zcuhjduyal/lib -lgeos_c
configure: creating ./config.status
config.status: creating src/Makevars
config.status: creating src/postgis_config.h
** libs
/usr/bin/g++ -std=gnu++11 -I"/home/spack/spack/opt/spack/linux-centos8-aarch64/gcc-8.3.1/r-4.0.3-m6krre343vll5qheioulnieut6awar2h/rlib/R/include" -DNDEBUG -DUSE_PROJ_H -I/home/spack/spack/opt/spack/linux-centos8-aarch64/gcc-8.3.1/geos-3.8.1-cxocfswylusmwtaw3l7466zcuhjduyal/include -DPOSTGIS_GEOS_VERSION=35 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I'/home/spack/spack/opt/spack/linux-centos8-aarch64/gcc-8.3.1/r-rcpp-1.0.6-2b5vljrmzutkcd5pcuksov3qkhc4jg5h/rlib/R/library/Rcpp/include' -I'/home/spack/spack/opt/spack/linux-centos8-aarch64/gcc-8.3.1/r-testthat-2.3.2-bfjih2xikzlqryku7amoi7qbjegvrm5t/rlib/R/library/sf/include' -I   -fpic  -g -O2  -c geodetic.cpp -o geodetic.o
In file included from geodetic.cpp:6:
./liblwgeom/liblwgeom.h:49:10: fatal error: proj.h: No such file or directory
 #include "proj.h"
          ^~~~~~~~
compilation terminated.
make: *** [/home/spack/spack/opt/spack/linux-centos8-aarch64/gcc-8.3.1/r-4.0.3-m6krre343vll5qheioulnieut6awar2h/rlib/R/etc/Makeconf:181: geodetic.o] Error 1
ERROR: compilation failed for package ‘lwgeom’
* removing ‘/home/spack/spack/opt/spack/linux-centos8-aarch64/gcc-8.3.1/r-testthat-2.3.2-bfjih2xikzlqryku7amoi7qbjegvrm5t/rlib/R/library/lwgeom’

The downloaded source packages are in
        ‘/tmp/Rtmpim1q1u/downloaded_packages’
Warning message:
In install.packages("lwgeom") :
  installation of package ‘lwgeom’ had non-zero exit status

Information on your system

  • Python: 3.6.8
  • Platform: linux-centos8-aarch64
  • Concretizer: original
  • R: 4.0.3
  • GDAL: 3.2.1
  • GEOS: 3.8.1
  • PROJ: 6.3.2

st_split error - lwgeom Error MultiLineString is Unsupported

I'm getting a warning that a LINESTRING cannot split a polygon because it is in fact a MultiLineString - even though it does not appear to be to me. I get this warning message:

Splitting a Polygon by a MultiLineString is unsupported
Error in CPL_split(x, st_geometry(y)) : lwgeom error

I am using the latest GitHub development release of lwgeom on a Windows 10 installation of R 3.5.3 with rtools installed:

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods  
[7] base     

other attached packages:
[1] lwgeom_0.1-6 sf_0.7-3  

Below is a REPREX of my problem - forgive me for the length of the example - I didn't know how to succinctly represent the polygon I am working with:

library(sf)
library(lwgeom)

hex <-
  structure(
    list(structure(
      list(structure(
        c(
          -88.455060600427,
          -88.0925247037421,-87.7299888070571,
          -87.7299888070571,
          -88.0925247037421,
          -88.455060600427,-88.455060600427,
          43.8085223219415,
          44.0178325194835,
          43.8085223219415,
          43.3899019268576,
          43.1805917293156,
          43.3899019268576,
          43.8085223219415
        ),
        .Dim = c(7L, 2L),
        .Dimnames = list(NULL, c("x", "y"))
      )), class = c("XY",
                    "POLYGON", "sfg")
    )),
    class = c("sfc_POLYGON", "sfc"),
    precision = 0,
    bbox = structure(
      c(
        xmin = -88.455060600427,
        ymin = 43.1805917293156,
        xmax = -87.7299888070571,
        ymax = 44.0178325194835
      ),
      class = "bbox"
    ),
    crs = structure(
      list(epsg = 4326L, proj4string = "+proj=longlat +datum=WGS84 +no_defs"),
      class = "crs"
    ),
    n_empty = 0L
  )

hex_coords <- st_coordinates(hex)
hex_coords <- hex_coords[, 1:2]
hex_centr <- st_coordinates(st_centroid(hex))
# define lines that split 
blade_coords <- rbind(hex_coords[2, ], hex_centr,
                      hex_coords[4, ], hex_centr, 
                      hex_coords[6, ], hex_centr, 
                      hex_coords[2:7, ], 
                      hex_coords[1, ], 
                      hex_coords[2, ])
blade_string <- st_linestring(blade_coords)


plot(blade_string)
plot(hex)
lwgeom::st_split(hex, blade_string)


# Simpler string
blade_coords <- rbind(hex_coords[2, ], hex_centr,
                      hex_coords[4, ], hex_centr)
blade_string <- st_linestring(blade_coords)
plot(blade_string)
lwgeom::st_split(hex, blade_string)

Am I misunderstanding something about st_split?

Consider use of tree-based distance calculation

PostGIS uses in-memory trees to optimize its geodetic distance calculations (see related ticket). This could easily be exposed in the lwgeom package (see commit) except that it requires inclusion of a non-public header.

If the lwgeom package always uses its included copy of liblwgeom, there doesn't seem to be a problem with using this header, but a quick scan of the automake file leaves me with the impression that this package sometimes uses the system lwgeom instead of the bundled one.

The prototypes could most likely be added to the public liblwgeom.h header, though most users wouldn't see that until the next PostGIS release in ~ 1 year.

FWIW, the performance difference is roughly 50% on a quick point-line test, and obviously increases with the complexity of the input geometries, although this is subject to the caveat described in r-spatial/sf#885.

# master branch
> microbenchmark(st_geod_distance(coast, plants[1:4,]), times=10)
Unit: seconds
                                   expr     min       lq     mean   median       uq      max neval
 st_geod_distance(coast, plants[1:4, ]) 3.79407 3.799992 3.841222 3.805284 3.875724 3.967692    10

# distance-tree branch
> microbenchmark(st_geod_distance(coast, plants[1:4,]), times=10)
Unit: seconds
                                   expr     min       lq     mean   median       uq      max neval
 st_geod_distance(coast, plants[1:4, ]) 1.80738 1.817252 1.895973 1.838641 1.961336 2.118409    10

segmentized polygons no longer close

a test in sf/tests/plot.R no errs, we see

> (m = st_make_grid())[[73]]
POLYGON ((-180 -70, -170 -70, -170 -60, -180 -60, -180 -70))
> m1 = st_segmentize(m, 2e5)
> m1[[73]]
POLYGON ((180 -70, -175 -70.070103935437, -170 -70, -170 -68.75, -170 -67.5, -170 -66.25, -170 -65, -170 -63.75, -170 -62.5, -170 -61.25, -170 -60, -172.496420052341 -60.0708457607377, -175 -60.0944985937173, -177.503579947659 -60.0708457607377, 180 -60, 180 -61.25, 180 -62.5, 180 -63.75, 180 -65, 180 -66.25, 180 -67.5, 180 -68.75, -180 -70))

compare first with last point. This then breaks in st_is_empty, which assumes 2D/planar.

configure: error: neither proj.h nor proj_api.h were found.

I having problems installing lwgeom for a CentOS 7.3 based HPC cluster. I'm using R 3.6.2 and the following:

R CMD INSTALL lwgeom_0.1-7.tar.gz --configure-args='--with-proj-lib=/source/directory/proj/5.2.0/lib --with-proj-include=/source/directory/proj/5.2.0/include --with-proj-share=/source/directory/proj/5.2.0/share/proj --with-geos-config=/source/directory/geos/3.6.3/bin/geos-config'

Error:

liblwgeom/lwgeom_geos.c:1079:10: error: ‘POSTGIS_GEOS_VERSION’ undeclared (first use in this function)
POSTGIS_GEOS_VERSION);
^
liblwgeom/lwgeom_geos.c:1079:10: note: each undeclared identifier is reported only once for each function it appears in
make: *** [liblwgeom/lwgeom_geos.o] Error 1
ERROR: compilation failed for package ‘lwgeom’

  • removing ‘/share/apps/gcc/4.8.5/R/3.6.2/lib64/R/library/lwgeom’

When I try the newer version of lwgeom:
R CMD INSTALL lwgeom_0.2-1.tar.gz --configure-args='--with-proj-lib=/source/directory/proj/6.1.1/lib --with-proj-include=/source/directory/proj/6.1.1/include/ --with-proj-share=/source/directory/proj/6.1.1/share/proj --with-geos-config=/source/directory/geos/3.6.3/bin/geos-config'

I get this error:
checking proj.h usability... no
checking proj.h presence... no
checking for proj.h... no
checking proj_api.h usability... no
checking proj_api.h presence... no
checking for proj_api.h... no
configure: error: neither proj.h nor proj_api.h were found.
ERROR: configuration failed for package ‘lwgeom’

  • removing ‘/share/apps/gcc/4.8.5/R/3.6.2/lib64/R/library/lwgeom’

Do you have any suggestions for resolving these errors?

configure: error: proj_api.h not found in standard or given locations[[email protected]]

see:

[root@centos8 lwgeom]# make install
1 error found in build log:
     132    checking for inttypes.h... yes
     133    checking for stdint.h... yes
     134    checking for unistd.h... yes
     135    checking proj_api.h usability... no
     136    checking proj_api.h presence... no
     137    checking for proj_api.h... no
  >> 138    configure: error: proj_api.h not found in standard or given locations.
     139    ERROR: configuration failed for package 'lwgeom'

I don't know why.Here is my system:

* **Python:** 3.6.8
* **Platform:** linux-centos8-aarch64
* **Concretizer:** original

Result of st_split depends on the order of input points

Dear all, I was working on a project with Open Street Map data and I found a weird behaviour with st_split. In a few words, I think I found that the result of st_split depends on the order of points that are passed as input (i.e. the y argument). More precisely,

# packages
library(osmdata)
#> Data (c) OpenStreetMap contributors, ODbL 1.0. https://www.openstreetmap.org/copyright
library(sf)
#> Linking to GEOS 3.8.0, GDAL 3.0.4, PROJ 6.3.1
library(lwgeom)
#> Linking to liblwgeom 3.0.0beta1 r16016, GEOS 3.8.0, PROJ 6.3.1

# get data
osmdata_by_id <- opq_osm_id(c(133096444, 133097023), type = "way") %>% 
  osmdata_sf()
osm_lines <- osmdata_by_id$osm_lines

# plot
par(mar = rep(0, 4))
plot(st_geometry(osm_lines), reset = FALSE)

# calculate duplicated points
osm_points <- st_coordinates(osm_lines)[, 1:2]
unique_osm_points <- st_sfc(st_multipoint(osm_points[duplicated(osm_points), ]), crs = 4326)

# plot
plot(unique_osm_points, pch = 16, col = "red", add = TRUE)

Here I would like to get 4 different geometries, obtained by splitting the input data at the two red dots but this is the result:

# split
osm_lines_split <- lwgeom::st_split(osm_lines, unique_osm_points) %>% 
  st_collection_extract("LINESTRING")
osm_lines_split
#> Simple feature collection with 3 features and 1 field
#> geometry type:  LINESTRING
#> dimension:      XY
#> bbox:           xmin: -1.153723 ymin: 50.7263 xmax: -1.15313 ymax: 50.72732
#> geographic CRS: WGS 84
#>             highway                       geometry
#> 133096444   service LINESTRING (-1.153265 50.72...
#> 133096444.1 service LINESTRING (-1.153622 50.72...
#> 133097023   service LINESTRING (-1.153717 50.72...

plot(osm_lines_split, col = 1:3, lwd = 2)

Nevertheless, if I use the same input but in different order:

unique_osm_points <- osm_points[duplicated(osm_points), ]
unique_osm_points <- unique_osm_points[2:1, ]
unique_osm_points <- st_sfc(st_multipoint(unique_osm_points), crs = 4326)

osm_lines_split <- lwgeom::st_split(osm_lines, unique_osm_points) %>% 
  st_collection_extract("LINESTRING")

plot(osm_lines_split, col = 1:4, lwd = 2)

Created on 2020-11-10 by the reprex package (v0.3.0)

Session info
devtools::session_info()
#> - Session info ---------------------------------------------------------------
#>  setting  value                       
#>  version  R version 3.6.3 (2020-02-29)
#>  os       Windows 10 x64              
#>  system   x86_64, mingw32             
#>  ui       RTerm                       
#>  language (EN)                        
#>  collate  Italian_Italy.1252          
#>  ctype    Italian_Italy.1252          
#>  tz       Europe/Berlin               
#>  date     2020-11-10                  
#> 
#> - Packages -------------------------------------------------------------------
#>  package     * version   date       lib source                           
#>  assertthat    0.2.1     2019-03-21 [1] CRAN (R 3.6.0)                   
#>  backports     1.1.10    2020-09-15 [1] CRAN (R 3.6.3)                   
#>  callr         3.5.1     2020-10-13 [1] CRAN (R 3.6.3)                   
#>  class         7.3-17    2020-04-26 [1] CRAN (R 3.6.3)                   
#>  classInt      0.4-3     2020-04-07 [1] CRAN (R 3.6.3)                   
#>  cli           2.1.0     2020-10-12 [1] CRAN (R 3.6.3)                   
#>  crayon        1.3.4     2017-09-16 [1] CRAN (R 3.6.0)                   
#>  curl          4.3       2019-12-02 [1] CRAN (R 3.6.1)                   
#>  DBI           1.1.0     2019-12-15 [1] CRAN (R 3.6.3)                   
#>  desc          1.2.0     2018-05-01 [1] CRAN (R 3.6.0)                   
#>  devtools      2.3.2     2020-09-18 [1] CRAN (R 3.6.3)                   
#>  digest        0.6.27    2020-10-24 [1] CRAN (R 3.6.3)                   
#>  dplyr         1.0.2     2020-08-18 [1] CRAN (R 3.6.3)                   
#>  e1071         1.7-4     2020-10-14 [1] CRAN (R 3.6.3)                   
#>  ellipsis      0.3.1     2020-05-15 [1] CRAN (R 3.6.3)                   
#>  evaluate      0.14      2019-05-28 [1] CRAN (R 3.6.0)                   
#>  fansi         0.4.1     2020-01-08 [1] CRAN (R 3.6.2)                   
#>  fs            1.5.0     2020-07-31 [1] CRAN (R 3.6.3)                   
#>  generics      0.1.0     2020-10-31 [1] CRAN (R 3.6.3)                   
#>  glue          1.4.2     2020-08-27 [1] CRAN (R 3.6.3)                   
#>  highr         0.8       2019-03-20 [1] CRAN (R 3.6.0)                   
#>  htmltools     0.5.0     2020-06-16 [1] CRAN (R 3.6.3)                   
#>  httr          1.4.2     2020-07-20 [1] CRAN (R 3.6.3)                   
#>  jsonlite      1.7.1     2020-09-07 [1] CRAN (R 3.6.3)                   
#>  KernSmooth    2.23-17   2020-04-26 [1] CRAN (R 3.6.3)                   
#>  knitr         1.30      2020-09-22 [1] CRAN (R 3.6.3)                   
#>  lattice       0.20-41   2020-04-02 [1] CRAN (R 3.6.3)                   
#>  lifecycle     0.2.0     2020-03-06 [1] CRAN (R 3.6.2)                   
#>  lubridate     1.7.9     2020-06-08 [1] CRAN (R 3.6.3)                   
#>  lwgeom      * 0.2-5     2020-06-12 [1] CRAN (R 3.6.3)                   
#>  magrittr      1.5       2014-11-22 [1] CRAN (R 3.6.3)                   
#>  memoise       1.1.0     2017-04-21 [1] CRAN (R 3.6.0)                   
#>  mime          0.9       2020-02-04 [1] CRAN (R 3.6.2)                   
#>  osmdata     * 0.1.3.020 2020-10-28 [1] Github (ropensci/osmdata@fc2332e)
#>  pillar        1.4.6     2020-07-10 [1] CRAN (R 3.6.3)                   
#>  pkgbuild      1.1.0     2020-07-13 [1] CRAN (R 3.6.3)                   
#>  pkgconfig     2.0.3     2019-09-22 [1] CRAN (R 3.6.1)                   
#>  pkgload       1.1.0     2020-05-29 [1] CRAN (R 3.6.3)                   
#>  prettyunits   1.1.1     2020-01-24 [1] CRAN (R 3.6.2)                   
#>  processx      3.4.4     2020-09-03 [1] CRAN (R 3.6.3)                   
#>  ps            1.4.0     2020-10-07 [1] CRAN (R 3.6.3)                   
#>  purrr         0.3.4     2020-04-17 [1] CRAN (R 3.6.3)                   
#>  R6            2.5.0     2020-10-28 [1] CRAN (R 3.6.3)                   
#>  Rcpp          1.0.5     2020-07-06 [1] CRAN (R 3.6.3)                   
#>  remotes       2.2.0     2020-07-21 [1] CRAN (R 3.6.3)                   
#>  rlang         0.4.8     2020-10-08 [1] CRAN (R 3.6.3)                   
#>  rmarkdown     2.5       2020-10-21 [1] CRAN (R 3.6.3)                   
#>  rprojroot     1.3-2     2018-01-03 [1] CRAN (R 3.6.0)                   
#>  rvest         0.3.6     2020-07-25 [1] CRAN (R 3.6.3)                   
#>  sessioninfo   1.1.1     2018-11-05 [1] CRAN (R 3.6.0)                   
#>  sf          * 0.9-6     2020-09-13 [1] CRAN (R 3.6.3)                   
#>  sp            1.4-4     2020-10-07 [1] CRAN (R 3.6.3)                   
#>  stringi       1.4.6     2020-02-17 [1] CRAN (R 3.6.2)                   
#>  stringr       1.4.0     2019-02-10 [1] CRAN (R 3.6.0)                   
#>  testthat      2.3.2     2020-03-02 [1] CRAN (R 3.6.3)                   
#>  tibble        3.0.4     2020-10-12 [1] CRAN (R 3.6.3)                   
#>  tidyselect    1.1.0     2020-05-11 [1] CRAN (R 3.6.3)                   
#>  units         0.6-7     2020-06-13 [1] CRAN (R 3.6.3)                   
#>  usethis       1.6.3     2020-09-17 [1] CRAN (R 3.6.3)                   
#>  vctrs         0.3.4     2020-08-29 [1] CRAN (R 3.6.3)                   
#>  withr         2.3.0     2020-09-22 [1] CRAN (R 3.6.3)                   
#>  xfun          0.19      2020-10-30 [1] CRAN (R 3.6.3)                   
#>  xml2          1.3.2     2020-04-23 [1] CRAN (R 3.6.3)                   
#>  yaml          2.2.1     2020-02-01 [1] CRAN (R 3.6.2)                   
#> 
#> [1] C:/Users/Utente/Documents/R/win-library/3.6
#> [2] C:/Program Files/R/R-3.6.3/library

I really don't understand what's going on since I would expect obtaining the same results in both scenarios.

Wrong error message during installation

I was getting this output when installing lwgeom

> install.packages("lwgeom")
Installing package into ‘/home/javier/R/x86_64-suse-linux-gnu-library/4.0’
(as ‘lib’ is unspecified)
probando la URL 'https://cran.rstudio.com/src/contrib/lwgeom_0.2-3.tar.gz'
Content type 'application/x-gzip' length 500834 bytes (489 KB)
==================================================
downloaded 489 KB

* installing *source* package ‘lwgeom’ ...
** package ‘lwgeom’ successfully unpacked and MD5 sums checked
** using staged installation
configure: loading site script /usr/share/site/x86_64-unknown-linux-gnu
configure: CC: gcc
configure: CXX: g++ -std=gnu++11
configure: pkg-config proj exists, will use it
configure: using proj.h.
configure: PROJ: 5.2.0
checking PROJ: checking whether PROJ and sqlite3 are available for linking:... no
configure: error: libproj not found in standard or given locations.
ERROR: configuration failed for package ‘lwgeom’
* removing ‘/home/javier/R/x86_64-suse-linux-gnu-library/4.0/lwgeom’
Warning in install.packages :
  installation of package ‘lwgeom’ had non-zero exit status

Same with github version. After a long time messing with "libproj" versions and all, I went to the sources. ./configure created an errors.txt file that said:

/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: cannot find -lsqlite3
collect2: error: ld returned 1 exit status

So, I saw some sqlite3 there. I decided to instsall package sqlite3-devel and that fixed my problem.

Therefore, I suggest the configure outputs something like "libproj or sqlite3 not found", or even a suggestion to install the corresponding packages.

Thank you for the good work with al the r-spatial and lwgeom! Amazing work!

Need to confirm existence of GEOS 3.5.0

Install of lwgeom failed due to not having GEOSClipByRect defined.

Here is the prebuild check:

checking geos-config usability... yes
configure: GEOS: 3.4.2
checking GEOS version >= 3.3.0... yes
checking geos_c.h usability... yes

It is missing from the headers that it is expected to be in:

gcc -std=gnu99 -I"/opt/R/3.6.1/lib/R/include" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/opt/R/3.6.1/lib/R/library/Rcpp/include" -I"/opt/R/3.6.1/lib/R/library/sf/include" -I/usr/local/include -fpic -g -O2 -c liblwgeom/lwgeom_geos.c -o liblwgeom/lwgeom_geos.o
liblwgeom/lwgeom_geos.c: In function ‘lwgeom_clip_by_rect’:
liblwgeom/lwgeom_geos.c:954:2: warning: implicit declaration of function ‘GEOSClipByRect’ [-Wimplicit-function-declaration]
if (!(g3 = GEOSClipByRect(g1, x1, y1, x2, y2)))
^

So is GEOSVoronoiDiagram.

liblwgeom/lwgeom_geos.c: In function ‘lwgeom_voronoi_diagram’:
liblwgeom/lwgeom_geos.c:1926:2: warning: implicit declaration of function ‘GEOSVoronoiDiagram’ [-Wimplicit-function-declaration]
geos_result = GEOSVoronoiDiagram(geos_geom, geos_env, tolerance, output_edges);
^

And not only is the function not declared, it is not defined:
** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for ‘lwgeom’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/opt/R/3.6.1/lib/R/library/00LOCK-lwgeom/00new/lwgeom/libs/lwgeom.so':
/opt/R/3.6.1/lib/R/library/00LOCK-lwgeom/00new/lwgeom/libs/lwgeom.so: undefined symbol: GEOSClipByRect
Error: loading failed

From what I can find, the function first appears in GEOS 3.5.0, so the prebuild check needs to verify the existence of 3.5.0 or newer, not 3.3.0.

windows: warnings and PROJ data sources

Build with win-builder now gives the following warnings:

* checking compiled code ... WARNING
File 'lwgeom/libs/i386/lwgeom.dll':
  Found 'exit', possibly from 'exit' (C), 'stop' (Fortran)
    Objects: 'liblwgeom/lwin_wkt_lex.o', 'liblwgeom/lwutil.o'
  Found 'printf', possibly from 'printf' (C)
    Objects: 'liblwgeom/lwgeodetic_tree.o', 'liblwgeom/lwout_x3d.o'
  Found 'putchar', possibly from 'putchar' (C)
    Object: 'liblwgeom/lwgeodetic_tree.o'
  Found 'rand', possibly from 'rand' (C)
    Object: 'liblwgeom/lwgeom_geos.o'
  Found 'srand', possibly from 'srand' (C)
    Object: 'liblwgeom/lwgeom_geos.o'
File 'lwgeom/libs/x64/lwgeom.dll':
  Found 'exit', possibly from 'exit' (C), 'stop' (Fortran)
    Objects: 'liblwgeom/lwin_wkt_lex.o', 'liblwgeom/lwutil.o'
  Found 'printf', possibly from 'printf' (C)
    Objects: 'liblwgeom/lwgeodetic_tree.o', 'liblwgeom/lwout_x3d.o'
  Found 'putchar', possibly from 'putchar' (C)
    Object: 'liblwgeom/lwgeodetic_tree.o'
  Found 'rand', possibly from 'rand' (C)
    Object: 'liblwgeom/lwgeom_geos.o'
  Found 'srand', possibly from 'srand' (C)
    Object: 'liblwgeom/lwgeom_geos.o'

Compiled code should not call entry points which might terminate R nor
write to stdout/stderr instead of to the console, nor the system RNG.

add an automatic script that replaces all these instances with proper R api calls.

Also, proj is statically linked on windows and proj files are added to the PROJ subdir; this needs to be handled similarly as PROJ_LIB here

error: geos_c.h not found in given locations

git clone https://github.com/r-spatial/lwgeom.git
R CMD INSTALL --configure-args="--with-proj-include=/local/software/proj/5.2.0/include --with-proj-lib=/local/software/proj/5.2.0/lib" lwgeom

gives,

checking for geos-config... /local/software/geos/3.7.0/bin/geos-config
checking geos-config usability... yes
configure: GEOS: 3.7.0
checking GEOS version >= 3.3.0... yes
checking geos_c.h usability... no
checking geos_c.h presence... no
checking for geos_c.h... no
configure: error: geos_c.h not found in given locations.

Running /local/software/geos/3.7.0/bin/geos-config --includes

/local/software/geos/3.7.0/include

And /local/software/geos/3.7.0/bin/geos-config --clibs

-L/local/software/geos/3.7.0/lib -lgeos_c

With or without liblwgeom

In README.md, shouldn't the command for installation without liblwgeom preinstalled on Linux read as follows?

R CMD INSTALL --configure-args="--with-liblwgeom" lwgeom_VERSION.tar.gz

Feature Request: ST_GeomFromGeoHash

I'm wondering if it is possible to port/bring in ST_GeomFromGeoHash, since lwgeom already includes a nice way to geohash locations via st_geohash(). (The goal would be to be able to geohash and un-geohash.)

Thank you for your fantastic work on these projects.

Issue when using lwgeom and shiny apps

Hello! I am trying to build and run a shiny app. It works locally on my machine, but when I try to deploy it to the Shiny servers, it gives me the error: "Warning: Error in join: lwgeom required: install first?" (A similar issue to this person: rstudio/shinyapps-package-dependencies#241). I have tried multiple things such uninstalling and reinstalling lwgeom, using an older version of lwgeom, downloading from the github version, and turning off the dependency cache when building the shiny app. None of these approaches worked. After a quick google search, it seems like other people have been experiencing similar issues since about 26 days ago which seems like the last push. Do you have any ideas on how to fix this issue? Thank you!

st_make_valid broke my shape

I've encountered a problem with the function st_make_valid and I wanted to share it here to make people aware of this behavior. It may be a bug, but it may also be data specific so I'm not sure something could be change in the package to fix it.

Anyway, I've notice that using st_make_valid on a shape made the st_write function fail for a specific dataset.

Here is a reproducible example:

Preparing the session:

library(sf)
library(dplyr)
library(lwgeom)

First, copy paste the dput of the shape. Sorry the dput is enormous, I couldn't make it smaller and still reproduce the behavior.

Click to see the dput of the shape

fsa.raw <- structure(list(FSA = c("S4R", "S4S", "S4T", "S4V", "S4W", "S4X"
), FSA_NAME = c("REGINA", "REGINA", "REGINA", "REGINA", "REGINA",
"REGINA"), PR = c("47", "47", "47", "47", "47", "47"), geometry = structure(list(
structure(list(list(structure(c(5302796.69950482, 5302882.76781702,
5302897.75194831, 5302963.92581344, 5302983.71723835, 5302966.90444534,
5303004.80258904, 5303025.82401457, 5303048.90488679, 5303008.76564428,
5303024.97156681, 5303170.31662308, 5303383.54436708, 5303455.00266521,
5303610.19156592, 5303683.97391793, 5303714.73317942, 5303769.09722665,
5303806.06535403, 5303793.4050644, 5303926.96035945, 5303941.71399835,
5304177.84575214, 5304580.28235237, 5304603.31619287, 5304649.15294485,
5305385.42042901, 5305438.70104347, 5305659.0726907, 5306134.75324817,
5306161.53403289, 5306170.6904644, 5306261.0409186, 5306336.97638294,
5306415.202418, 5306442.48981033, 5306448.71291325, 5306491.85980936,
5307900.12159158, 5307814.8253358, 5307795.39290828, 5307783.92337024,
5307775.92031494, 5307766.80654505, 5307601.72868778, 5307560.82227562,
5307660.06973123, 5307606.8151466, 5307578.45514534, 5307572.53020014,
5307564.92985865, 5307530.61659238, 5307517.76579659, 5307499.23485141,
5307487.75047581, 5307481.18246677, 5307477.86270126, 5307479.2917742,
5307418.40962723, 5307402.29000447, 5307412.01428315, 5307391.81270566,
5307337.58421414, 5307301.8398401, 5307263.13577138, 5307260.70781339,
5307246.06811244, 5307231.22400297, 5307200.57191991, 5307218.56883934,
5307208.87522744, 5307195.90421984, 5307188.36622379, 5307157.50795511,
5307140.00410709, 5307137.52282835, 5307150.68132808, 5307158.44867881,
5307154.64023672, 5307134.02617258, 5307112.97145875, 5307091.82717975,
5307107.13714621, 5307084.59164035, 5307057.28028867, 5307082.62694767,
5307058.37127431, 5307023.52495338, 5307048.84877023, 5307022.28103474,
5306989.37357892, 5307010.48294056, 5306981.25994254, 5306959.49432941,
5306926.93629089, 5306883.76115598, 5306853.53923801, 5306841.68776176,
5306835.7966516, 5306737.09296662, 5306651.08479513, 5306640.73145373,
5306546.78843747, 5306444.49621354, 5306148.72049882, 5306135.10573859,
5306085.18095938, 5306036.49273787, 5305999.43705546, 5305936.66252955,
5305836.60292955, 5305736.07507448, 5305634.57857665, 5305565.9621904,
5305536.9368422, 5305530.63779651, 5305435.4412331, 5305418.85047533,
5305338.08988664, 5305332.62153456, 5305326.39176804, 5305316.84088997,
5305336.67126969, 5305395.38764299, 5305567.91600103, 5305601.59755381,
5305518.01595488, 5305473.15682798, 5305427.89238874, 5305448.76704368,
5305392.07175117, 5305343.93512983, 5305245.27438053, 5305044.05625524,
5304944.75450767, 5304745.68382405, 5304655.02318057, 5304547.94034564,
5304438.92681572, 5304297.79633179, 5304110.63026871, 5304025.67288907,
5303882.36701777, 5303741.09086798, 5303696.7794375, 5303299.95792929,
5303198.88191322, 5303094.44701761, 5303050.90098993, 5302993.86090102,
5302889.84203459, 5302784.67724703, 5302683.08363118, 5302579.30638664,
5302479.83906707, 5302164.90948177, 5302173.30005962, 5302183.73438136,
5302236.27647685, 5302234.4596447, 5302334.32782954, 5302394.59613077,
5302473.04148911, 5302489.22956471, 5302508.78663473, 5302517.90398791,
5302547.6485361, 5302576.73879313, 5302604.54978913, 5302598.24231826,
5302606.5874547, 5302662.79969881, 5302693.72433851, 5302740.54973267,
5302790.50921451, 5302796.69950482, 1684171.10974753, 1684598.40054166,
1684595.23154874, 1684750.52635756, 1684874.40913766, 1684931.46695196,
1684956.25362074, 1685054.03013613, 1685172.49896622, 1685212.63663509,
1685217.23448856, 1685162.19066118, 1685098.50605808, 1685102.11557984,
1685083.69232614, 1685073.62263036, 1685065.88643034, 1685058.42070243,
1685051.11342006, 1685008.42115535, 1684982.78943057, 1685022.68448468,
1684921.52155991, 1684888.34362864, 1684885.46066061, 1684877.14555265,
1684718.97531731, 1684706.89694596, 1684663.77666833, 1684579.72715782,
1684572.25300448, 1684569.82790735, 1685008.42494656, 1685098.65375769,
1685085.35567786, 1685080.03738242, 1685078.77304069, 1685070.0071802,
1684865.75078532, 1684454.80131648, 1684355.79941568, 1684300.67149882,
1684251.27437257, 1684209.8909787, 1683412.7001403, 1683213.86176301,
1683193.28110419, 1683098.31269759, 1683040.51263609, 1683029.41029019,
1683015.37419304, 1682959.1201576, 1682940.50490462, 1682911.64070306,
1682865.31800969, 1682827.25438878, 1682822.96092643, 1682684.05169841,
1682504.2737247, 1682424.79979867, 1682360.51577594, 1682252.74537519,
1682094.4179687, 1681926.35774038, 1681757.20362263, 1681581.4810164,
1681508.59064795, 1681435.40290618, 1681421.7518473, 1681388.63811813,
1681347.59426377, 1681292.87840815, 1681247.89770573, 1681236.43324532,
1681154.75328691, 1681139.67802939, 1681138.47665389, 1681123.1289131,
1681107.19394759, 1681023.322278, 1680927.68645339, 1680896.97959839,
1680887.55254934, 1680755.07815189, 1680726.29928297, 1680714.83651763,
1680590.27187383, 1680559.52151371, 1680543.32197454, 1680417.30644464,
1680390.79114239, 1680384.3646823, 1680256.62923344, 1680223.22538082,
1680114.22836046, 1680106.39072154, 1680133.63184344, 1680142.35786229,
1680146.71386206, 1680158.60906903, 1680143.20704298, 1680137.2922797,
1680130.38850394, 1680146.63087223, 1680205.31168071, 1680208.18855192,
1680217.53404114, 1680227.64511506, 1680235.05609469, 1680246.7866563,
1680268.34797566, 1680288.31331209, 1680308.47779756, 1680321.9650163,
1680327.74869549, 1680329.02838997, 1680347.91777154, 1680351.40161585,
1680368.26325062, 1680369.37444064, 1680370.64036159, 1680392.45158445,
1680504.93454401, 1680793.87913727, 1681658.4971893, 1681734.17940907,
1681752.63219265, 1681761.29739696, 1681867.58767102, 1681972.06349829,
1681983.81310597, 1681996.19450569, 1682017.71877538, 1682056.48623745,
1682075.21253153, 1682113.55740842, 1682131.54882121, 1682155.59309352,
1682179.35557509, 1682208.52833588, 1682247.30277927, 1682274.19506473,
1682323.46991296, 1682359.35250152, 1682369.28034821, 1682451.02228613,
1682470.94155117, 1682490.64454083, 1682500.08446544, 1682512.61410481,
1682532.23733502, 1682554.01620624, 1682572.81130583, 1682593.97362172,
1682611.88831616, 1682671.16376756, 1682683.67883251, 1682702.32584447,
1682764.88610883, 1682786.710066, 1682907.47529073, 1682976.13781621,
1683034.65698505, 1683053.25954768, 1683076.36880098, 1683087.15502088,
1683122.41301495, 1683161.53052134, 1683180.24663625, 1683210.43777696,
1683337.90335245, 1683639.64524998, 1683819.52186966, 1684016.25161306,
1684140.75872377, 1684171.10974753), .Dim = c(176L, 2L)))), class = c("XY",
"MULTIPOLYGON", "sfg")), structure(list(list(structure(c(5302773.50801425,
5302785.80521032, 5302814.29222157, 5302866.2793255, 5302887.42169134,
5302921.93340975, 5302961.68572788, 5303034.81350168, 5303088.10705888,
5303162.94852044, 5303143.11926225, 5303150.52772608, 5303154.25994506,
5303156.26303815, 5303175.55083092, 5303214.60227797, 5303247.91797578,
5303250.9682467, 5303250.1603686, 5303311.46771557, 5303345.01481991,
5303431.46951769, 5303425.14906257, 5303594.8656147, 5303808.72895223,
5303879.16458117, 5303976.51470533, 5304079.58707737, 5304188.12127577,
5304248.67016629, 5304288.96446782, 5304296.69345858, 5304260.97641085,
5304253.68188377, 5304251.14643443, 5304245.1035999, 5304291.62245791,
5304383.46130176, 5304499.04759509, 5304603.57967112, 5304760.29471085,
5304894.52697623, 5304905.27371804, 5304912.31226548, 5304925.60856076,
5304930.02509241, 5304914.01063712, 5304918.53433793, 5304929.930003,
5304954.93101554, 5305003.96939214, 5305034.52269639, 5305063.94607496,
5305079.32977697, 5305123.34409287, 5305138.90787531, 5305161.876211,
5305174.06374809, 5305189.98099663, 5305201.48209739, 5305282.04069981,
5305287.95399627, 5305294.93931616, 5305294.61268778, 5305290.62946334,
5305279.68610424, 5305268.10053696, 5305256.21708982, 5305216.00524824,
5305206.47707876, 5305197.41823242, 5305190.94255168, 5305146.47503595,
5305106.93556512, 5305105.14482627, 5305104.68458233, 5305108.69789842,
5305107.62332552, 5305114.68443061, 5305132.67560418, 5305147.05081939,
5305157.2624253, 5305183.28253309, 5305225.80956811, 5305245.81930608,
5305263.12530905, 5305273.10746092, 5305288.13189938, 5305296.72791285,
5305327.79754063, 5305356.51186976, 5305376.23862324, 5305418.71927288,
5305443.6515944, 5305499.65570616, 5305514.1516569, 5305546.91423603,
5305563.88939699, 5305576.84229224, 5305585.57105548, 5305580.00069132,
5305584.03376735, 5305624.07869779, 5305641.96534174, 5305657.45362117,
5305673.91879947, 5305693.84589801, 5305710.82095357, 5305756.75103102,
5305777.84708091, 5305786.18817783, 5305793.78916082, 5305794.82085558,
5305795.01286597, 5305803.35439924, 5305804.6639738, 5305805.83825636,
5305807.45662462, 5305810.84998515, 5305815.10302522, 5305822.96369563,
5305834.41852478, 5305844.42226862, 5305852.81393213, 5305925.45000947,
5305986.28173424, 5306049.81991346, 5306061.33779807, 5306079.43288155,
5306099.95632173, 5306125.46355576, 5306153.51240986, 5306213.97392079,
5306217.95959245, 5306238.03484249, 5306257.03366845, 5306296.2175104,
5306319.35737841, 5306328.71805476, 5306349.72801017, 5306405.27147136,
5306436.70193196, 5306447.32339633, 5306463.36391176, 5306473.4372479,
5306474.98304353, 5306485.39084254, 5306493.95056736, 5306499.92755418,
5306513.53392882, 5306517.51184842, 5306528.63465432, 5306540.62612404,
5306548.60430069, 5306570.09559276, 5306597.1403908, 5306625.60017327,
5306665.2143854, 5306676.29732892, 5306696.10253809, 5306717.68787934,
5306783.50747976, 5306810.51046333, 5306812.43548713, 5306811.02195444,
5306799.46837269, 5306795.11948512, 5306793.51604016, 5306795.97532781,
5306800.23138138, 5306803.77067455, 5306809.60575797, 5306830.61673374,
5306845.89023322, 5306864.75251482, 5306869.12484043, 5306867.00093892,
5306851.83793673, 5306805.60737329, 5306791.12732281, 5306756.16740208,
5306736.69212936, 5306707.19644138, 5306684.78168057, 5306660.32784889,
5306648.26820258, 5306643.92725342, 5306633.82822682, 5306619.25582578,
5306599.25475756, 5306579.13291398, 5306549.6956244, 5306534.63074441,
5306498.54378532, 5306506.59255569, 5306502.08461239, 5306492.65078637,
5306487.60400512, 5306476.95611169, 5306469.69771321, 5306461.27465756,
5306447.52898894, 5306444.44901972, 5306447.65632905, 5306432.69660221,
5306407.40599628, 5306371.58529134, 5306326.08945381, 5306300.30297513,
5306284.12148644, 5306275.95412696, 5306275.87698605, 5306279.33416498,
5306297.00161289, 5306321.45377573, 5306366.5984649, 5306370.62440442,
5306368.90826814, 5306364.77931409, 5306344.36042682, 5306332.21679096,
5306330.12653085, 5306335.22404082, 5306345.6458029, 5306355.12370643,
5306367.75893537, 5306406.60112528, 5306427.29243213, 5306483.23980323,
5306500.89452315, 5306518.51188113, 5306566.926172, 5306583.58203726,
5306597.65308989, 5306631.36289418, 5306643.4477844, 5306664.13946392,
5306684.31829062, 5306723.61446949, 5306739.73792429, 5306755.86856789,
5306769.52881037, 5306807.31260568, 5306838.65015798, 5306948.98296816,
5306956.26485227, 5306980.03697473, 5306987.71438248, 5307051.61049455,
5307075.05228307, 5307135.58770111, 5307142.60410211, 5307198.60888844,
5307236.57956016, 5307250.38894203, 5307271.06758036, 5307289.55451006,
5307295.25096578, 5307309.57237048, 5307323.09618197, 5307334.57375992,
5307346.0817435, 5307364.03487524, 5307386.56734249, 5307425.05836888,
5307448.1001733, 5307455.5859231, 5307461.04249866, 5307477.25321422,
5307488.2169752, 5307494.54392021, 5307493.05877739, 5307479.05844968,
5307474.0475682, 5307480.60261243, 5307491.04918927, 5307490.63508792,
5307489.54492856, 5307490.44383624, 5307515.62634224, 5307516.89822662,
5307512.66675016, 5307503.57348316, 5307491.53853693, 5307486.90172046,
5307481.5754568, 5307477.14132096, 5307473.12450929, 5307474.00986475,
5307477.30155813, 5307481.58016512, 5307484.16044633, 5307485.20293363,
5307485.55598062, 5307484.58219165, 5307475.62222628, 5307466.31050152,
5307465.06332572, 5307468.07939731, 5307478.07115224, 5307487.06785296,
5307492.54559313, 5307503.53355306, 5307509.04421185, 5307530.99232492,
5307532.58923375, 5307539.12721776, 5307566.47690959, 5307568.65684364,
5307578.00353966, 5307583.94517323, 5307588.02113078, 5307596.79504161,
5307604.38775267, 5307615.59033274, 5307615.56896478, 5307587.2841979,
5307579.68654062, 5307571.38652086, 5307561.37474498, 5307564.2852688,
5307573.25765048, 5307582.56632209, 5307594.52461554, 5307592.35916304,
5307584.6034876, 5307572.03453503, 5307567.56093143, 5307565.36453804,
5307560.99030137, 5307558.53285557, 5307545.58271341, 5307510.4003606,
5307515.84729279, 5307511.54811638, 5307516.38329595, 5307515.6528318,
5307521.17228782, 5307530.19479208, 5307535.67714129, 5307538.5658575,
5307554.00554743, 5307572.09796816, 5307576.16175808, 5307572.36133992,
5307573.41887156, 5307576.59246401, 5307580.28664477, 5307583.81535515,
5307602.19723755, 5307600.64450629, 5307584.9880791, 5307524.65136779,
5307514.6302721, 5307502.92797197, 5307493.64817266, 5307489.94145972,
5307485.13535294, 5307483.19765279, 5307450.91612748, 5307448.36287564,
5307446.29125229, 5307447.00640825, 5307450.48454042, 5307454.35120462,
5307457.53827044, 5307469.36004777, 5307480.02980112, 5307484.29515393,
5307488.09589132, 5307492.01851018, 5307493.40957601, 5307492.92486878,
5307493.60493097, 5307507.61661487, 5307507.43862435, 5307503.353426,
5307487.09138407, 5307469.01980935, 5307463.7968742, 5307459.25546366,
5307452.98363502, 5307446.07829288, 5307445.22174239, 5307445.74762445,
5307449.98155603, 5307456.42790496, 5307474.81826101, 5307499.01376722,
5307517.78014311, 5307525.32725204, 5307546.8115559, 5307578.90399779,
5307600.83493711, 5307635.32936333, 5307643.44289107, 5307673.96864121,
5307680.2993406, 5307675.21672541, 5307647.62650424, 5307640.60506819,
5307627.02274869, 5307620.4633354, 5307611.61772551, 5307592.15286832,
5307583.47564936, 5307574.37534613, 5307567.73976148, 5307567.55182513,
5307576.92345036, 5307589.82132068, 5307599.68844735, 5307598.58472302,
5307599.37141335, 5307602.8044404, 5307605.23855663, 5307610.11112089,
5307614.93436749, 5307619.02218723, 5307620.93793854, 5307623.05472993,
5307634.68818442, 5307651.31275219, 5307726.47822449, 5307740.99089938,
5307743.63303693, 5307747.68914363, 5307770.59118641, 5307767.43728162,
5307756.82288988, 5307725.23491641, 5307685.18340724, 5307645.41363619,
5307611.51540448, 5307557.36366576, 5307554.52793865, 5307554.80221208,
5307558.30944933, 5307562.29979018, 5307567.27341815, 5307571.35842879,
5307573.9243338, 5307575.74166911, 5307574.75694534, 5307569.54678628,
5307556.83500199, 5307517.48465885, 5307511.79700452, 5307519.77345212,
5307548.32370382, 5307556.03850084, 5307562.37760915, 5307575.53712773,
5307579.99606546, 5307581.91840549, 5307578.851378, 5307546.64221473,
5307545.48720724, 5307554.01274711, 5307580.26925906, 5307600.28242125,
5307611.21545668, 5307612.21503696, 5307572.92420418, 5307565.1027162,
5307541.75361529, 5307544.99528151, 5307552.31753355, 5307557.49704999,
5307579.98091936, 5307581.36216405, 5307589.94882951, 5307566.0876046,
5307515.80764688, 5307512.50380007, 5307234.80051249, 5307220.40948028,
5306790.7119555, 5305701.70291223, 5305105.34664339, 5305107.12289337,
5305112.14349957, 5305114.42598609, 5305078.77325794, 5305049.34299073,
5304950.19304741, 5304859.39783907, 5304744.06316905, 5304675.72141317,
5304630.94327809, 5304591.57225415, 5304499.15222122, 5304253.61370642,
5304201.3558057, 5304193.84403801, 5304156.19389704, 5304063.97124926,
5304058.03504965, 5304044.68491583, 5304034.14841431, 5303594.60680303,
5303508.91148922, 5303394.63581547, 5303083.1871835, 5302480.96496433,
5302319.60226166, 5302299.09829368, 5302270.13140222, 5302253.02002214,
5302253.52755704, 5302254.6665389, 5302266.65018454, 5302269.76048139,
5302279.65446193, 5302287.92759943, 5302302.64665237, 5302315.19858825,
5302329.62706202, 5302378.6645155, 5302411.69563025, 5302442.00309258,
5302459.08520026, 5302462.04384806, 5302479.92818307, 5302563.51953459,
5302607.8694746, 5302631.2651774, 5302653.958583, 5302676.54984584,
5302721.82136656, 5302697.21714599, 5302760.47852838, 5302771.59499131,
5302785.95142789, 5302773.50801425, 1676679.78587711, 1676740.18020582,
1676902.40896617, 1677160.91690741, 1677260.49972891, 1677444.87362547,
1677633.37367323, 1677756.58476513, 1678061.90639503, 1678408.23040791,
1678533.99231768, 1678579.23136422, 1678584.45600419, 1678587.20980719,
1678630.93329216, 1678828.03745317, 1678983.51341148, 1679023.99343456,
1679034.54611556, 1679065.42265321, 1679116.85630453, 1679107.2720689,
1679071.97467145, 1679082.81860109, 1678933.94746544, 1678871.85382728,
1678811.96402822, 1678832.66028779, 1678847.95713341, 1678845.01379218,
1678822.25358014, 1678813.4555282, 1678745.97304318, 1678717.19666897,
1678707.21167321, 1678440.27829446, 1678344.55464237, 1678312.1053974,
1678305.65474845, 1678323.58426748, 1678329.32924015, 1678302.16287358,
1678293.65624548, 1678292.45179286, 1678299.68578988, 1678290.54611986,
1678191.50615285, 1678183.24795366, 1678171.89979709, 1678159.36791487,
1678151.21069106, 1678156.06796293, 1678156.07417631, 1678156.90053422,
1678148.86207076, 1678140.28081748, 1678123.42108391, 1678098.92860774,
1678047.71011251, 1678030.13156444, 1677953.47698041, 1677942.11442706,
1677917.21124645, 1677885.77679008, 1677868.29498215, 1677824.00018738,
1677803.88484191, 1677773.78130796, 1677702.91378035, 1677691.8647267,
1677652.94518835, 1677626.03364779, 1677588.54775117, 1677536.62502027,
1677531.00463953, 1677508.8552399, 1677488.84566585, 1677470.77281836,
1677450.14417575, 1677414.08523279, 1677392.535621, 1677382.44508828,
1677369.93420616, 1677359.15193109, 1677348.65246729, 1677334.07297291,
1677323.91646317, 1677267.91172572, 1677245.95567093, 1677208.93568459,
1677191.927225, 1677184.64739273, 1677178.95759248, 1677181.68604133,
1677200.68764669, 1677212.76125827, 1677366.32374906, 1677369.65187992,
1677367.02228561, 1677360.28241303, 1677323.25109544, 1677323.22269194,
1677306.96428101, 1677304.12372109, 1677311.14122668, 1677326.87999275,
1677334.80305095, 1677338.13174836, 1677330.61564162, 1677334.35010226,
1677341.68954193, 1677361.3728922, 1677376.40560459, 1677399.73785362,
1677416.67406078, 1677417.08569378, 1677417.18607314, 1677416.63179937,
1677418.42697684, 1677419.48315514, 1677421.61360837, 1677416.57908414,
1677399.41964059, 1677394.21652277, 1677377.21763993, 1677365.66370342,
1677357.85180624, 1677353.48255692, 1677338.52081063, 1677339.43738095,
1677349.27833684, 1677356.00700664, 1677358.98284824, 1677359.07751143,
1677353.87597991, 1677347.98968861, 1677313.62221269, 1677289.39648374,
1677279.3688695, 1677268.10745192, 1677257.85801561, 1677255.6608262,
1677265.36130702, 1677258.04375352, 1677238.72700812, 1677231.41366074,
1677218.01287595, 1677219.32531764, 1677223.19375286, 1677210.27340843,
1677170.85464857, 1677150.30915888, 1677144.7162692, 1677144.22745694,
1677149.91766783, 1677162.72361376, 1677172.19446596, 1677181.54893476,
1677186.41452241, 1677194.81798698, 1677200.26391494, 1677223.27346438,
1677235.52438629, 1677238.97270405, 1677251.5652539, 1677276.03568103,
1677284.82025959, 1677293.27405526, 1677298.64622897, 1677299.36398366,
1677297.96907149, 1677295.09265196, 1677276.72085148, 1677248.89977522,
1677240.56016204, 1677229.40005718, 1677208.60562953, 1677173.29372759,
1677112.44213323, 1677101.49092083, 1677089.83689068, 1677075.94698945,
1677066.34666746, 1677056.10117822, 1677056.43022286, 1677052.44001553,
1677050.949249, 1677042.04553007, 1677045.22599359, 1677056.84578522,
1677064.31284582, 1677084.1687317, 1677090.6105941, 1677097.5897741,
1677187.06867532, 1677200.40194666, 1677203.66988098, 1677203.67723837,
1677189.57885838, 1677149.16453572, 1677072.06760485, 1677042.33956019,
1677022.52898407, 1676974.68565666, 1676906.25255045, 1676874.01082936,
1676843.90469826, 1676789.56751762, 1676765.55557293, 1676737.33752805,
1676714.49403732, 1676703.44515796, 1676696.30848036, 1676609.51544295,
1676590.66920712, 1676581.73964867, 1676577.76192309, 1676550.44867809,
1676531.86665173, 1676467.81384833, 1676450.9700206, 1676436.03902463,
1676416.71487774, 1676378.47224074, 1676359.05015216, 1676342.03623733,
1676315.53077102, 1676316.19001203, 1676334.20077659, 1676336.60504539,
1676338.11372993, 1676332.13672194, 1676323.56646033, 1676308.29453549,
1676260.02552665, 1676238.15649186, 1676215.33312384, 1676197.80734501,
1676186.34201759, 1676185.106124, 1676187.82039582, 1676193.29346867,
1676232.37661204, 1676249.62162119, 1676268.3574193, 1676270.83327957,
1676279.22533763, 1676283.65329462, 1676320.26889132, 1676322.40588311,
1676318.94663179, 1676322.60552415, 1676318.14576499, 1676310.11459992,
1676307.42994421, 1676306.96652986, 1676311.35023181, 1676310.98657528,
1676310.11765558, 1676292.13689974, 1676264.40983676, 1676256.77256417,
1676249.9749024, 1676255.45886223, 1676273.85503381, 1676306.78311363,
1676314.18588644, 1676310.14540248, 1676304.71715573, 1676300.80321414,
1676295.00594194, 1676289.09736519, 1676290.12646005, 1676256.48176474,
1676253.23492542, 1676254.95773695, 1676257.18665534, 1676262.48782757,
1676264.78952045, 1676293.33289289, 1676306.73587657, 1676310.4152748,
1676318.57912475, 1676318.9843677, 1676317.10102011, 1676315.01861761,
1676315.9166649, 1676318.87524699, 1676322.53444732, 1676325.25469805,
1676326.08160914, 1676328.49435618, 1676332.57332094, 1676336.45322542,
1676350.87551017, 1676371.09245453, 1676408.08947022, 1676412.97085886,
1676422.52074259, 1676421.28732582, 1676411.22369217, 1676372.7453094,
1676347.94049514, 1676343.0988377, 1676323.97723237, 1676323.31513687,
1676321.76528389, 1676322.54881886, 1676321.20418367, 1676315.36000076,
1676311.22145878, 1676309.26708476, 1676303.08735454, 1676297.48553012,
1676285.84658206, 1676276.4804802, 1676253.98394381, 1676227.86272734,
1676218.93119029, 1676208.31415145, 1676198.46718029, 1676184.00574587,
1676170.49231337, 1676159.37769301, 1676145.47825093, 1676132.82370597,
1676126.6758191, 1676133.79108418, 1676152.86392057, 1676166.16842692,
1676172.19804145, 1676183.400741, 1676136.10899368, 1676128.45784727,
1676099.74928886, 1676093.35101281, 1676071.93546648, 1676068.5597643,
1676067.52291459, 1676063.25156593, 1676053.29607551, 1676044.41171112,
1676042.21568455, 1676048.39242807, 1676068.80616562, 1676073.67240389,
1676074.38452848, 1676073.74936606, 1676071.22845789, 1676040.18509176,
1676036.43519826, 1676027.86415875, 1676022.69609584, 1676019.87083588,
1676012.3056472, 1675990.70211831, 1675974.17935736, 1675945.46042067,
1675908.82217923, 1675875.50646218, 1675870.37860653, 1675865.49190838,
1675860.83112987, 1675858.77196692, 1675859.34369125, 1675863.32710707,
1675884.30303713, 1675896.02879534, 1675898.21327324, 1675898.4596725,
1675895.74603585, 1675892.64187521, 1675888.1111997, 1675854.78135364,
1675811.41339754, 1675796.99843579, 1675781.4554038, 1675768.82979464,
1675771.13460552, 1675781.67579171, 1675786.32113275, 1675788.8331365,
1675787.86068197, 1675783.63108923, 1675779.46023126, 1675773.29655869,
1675764.87847205, 1675749.18700505, 1675756.81910369, 1675772.55039244,
1675778.47343164, 1675769.15548924, 1675761.64112914, 1675749.18479471,
1675738.92657454, 1675741.23527348, 1675735.95811472, 1675723.04794792,
1675715.04514685, 1675719.50212911, 1675714.03695523, 1675710.01305646,
1675713.59910093, 1675729.05075497, 1675736.94335196, 1675726.50730146,
1675721.46314261, 1675709.71052341, 1675696.31367053, 1675676.69105292,
1675666.28954127, 1675645.55058224, 1675631.54886358, 1675624.38988179,
1675619.96914718, 1675616.31515713, 1675615.4415116, 1675617.17451806,
1675620.97569884, 1675627.58751538, 1675634.836016, 1675642.41568421,
1675646.50110747, 1675630.83213418, 1675629.47473746, 1675637.18138595,
1675637.26345271, 1675624.6115473, 1675615.08923197, 1675609.33512077,
1675614.71367073, 1675618.19317018, 1675612.01964826, 1675588.17447883,
1675556.57594354, 1675554.32764639, 1675549.98195734, 1675547.35254052,
1675547.10908327, 1675549.94060186, 1675549.45218634, 1675546.44888565,
1675542.2423676, 1675537.02260902, 1675518.77183755, 1675508.36228238,
1675487.87937255, 1675475.82182564, 1675468.9004643, 1675463.1196391,
1675468.44442741, 1675473.03167283, 1675471.04464129, 1675467.77096745,
1675462.30130569, 1675457.84183158, 1675446.97683395, 1675438.06586592,
1675433.85588521, 1675445.24877552, 1675442.55159327, 1675432.77385689,
1675427.37813862, 1675375.8353215, 1675358.22605267, 1675248.24768246,
1675223.9953337, 1675197.44911942, 1675168.51424695, 1675119.93136486,
1675117.84533351, 1675105.38148551, 1674973.26460791, 1674749.85258452,
1674734.60241397, 1673456.64593619, 1673377.36409231, 1673468.67045309,
1673692.444232, 1673812.19297639, 1673821.65624229, 1673848.52772782,
1673860.48532324, 1673858.01048668, 1673855.96670422, 1673861.41289907,
1673878.15073644, 1673899.87292244, 1673915.21751729, 1673923.97146528,
1673931.62782827, 1673949.60667309, 1674000.15960956, 1674012.24439902,
1674013.99639998, 1674022.66223598, 1674039.4812477, 1674040.46164594,
1674042.60982748, 1674044.75091025, 1674135.89866015, 1674152.87065853,
1674175.54342641, 1674237.42256948, 1674358.847396, 1674391.69976167,
1674397.00398674, 1674402.22465551, 1674417.45386878, 1674445.47048442,
1674452.12737758, 1674511.68650042, 1674527.31525687, 1674570.58595256,
1674568.67544213, 1674565.45239855, 1674618.23265806, 1674705.75211856,
1674926.3701749, 1675088.58666177, 1675256.21282267, 1675335.84980276,
1675350.37973533, 1675438.20978446, 1675846.24651, 1676062.27748975,
1676139.61045642, 1676218.10256202, 1676282.27382152, 1676405.74211184,
1676411.76827014, 1676582.84037579, 1676612.98597655, 1676651.95741564,
1676679.78587711), .Dim = c(535L, 2L))), list(structure(c(5306690.80205764,
5306542.3587818, 5306530.4400682, 5306519.34272898, 5306516.71822499,
5306516.7325398, 5306517.94971413, 5306526.47533482, 5306536.42369124,
5306688.47294478, 5306703.34993085, 5306749.86629886, 5306773.45483192,
5306716.09998784, 5306690.80205764, 1677258.66490905, 1677198.78306137,
1677218.24800261, 1677224.3370408, 1677228.82079037, 1677232.09200827,
1677234.89349542, 1677242.08373695, 1677249.88867847, 1677317.95783807,
1677321.26383546, 1677331.59012514, 1677294.63155331, 1677268.55139553,
1677258.66490905), .Dim = c(15L, 2L))), list(structure(c(5305208.54305137,
5305228.83949894, 5305256.66408344, 5305273.80286141, 5305286.53600539,
5305288.30282679, 5305324.93746404, 5305385.33410038, 5305393.78915197,
5305386.00886947, 5305354.83469653, 5305325.08891529, 5305296.62530284,
5305250.21113575, 5305218.47708348, 5305208.54305137, 1677494.30897638,
1677543.81781023, 1677564.6999651, 1677545.75098432, 1677515.05121726,
1677510.96647384, 1677484.67132574, 1677416.63094223, 1677407.12353895,
1677376.97656481, 1677371.56440563, 1677407.63801226, 1677422.67659233,
1677430.29596494, 1677442.72497947, 1677494.30897638), .Dim = c(16L,
2L))), list(structure(c(5305493.17063851, 5305513.33544916,
5305551.95351237, 5305577.99230515, 5305593.50318753, 5305598.98232376,
5305589.1909275, 5305590.93444167, 5305591.47054178, 5305575.21933213,
5305556.6614357, 5305537.06877008, 5305500.78785206, 5305493.17063851,
1678217.58830845, 1678239.12273596, 1678231.50673641, 1678209.171021,
1678179.37630843, 1678167.65085703, 1678121.20319706, 1678068.3488609,
1678062.82061939, 1678036.76521248, 1678042.67846253, 1678121.62515715,
1678176.97664229, 1678217.58830845), .Dim = c(14L, 2L)))), class = c("XY",
"MULTIPOLYGON", "sfg")), structure(list(list(structure(c(5299315.50993929,
5299534.09145914, 5299842.63767012, 5300883.94869751, 5300892.2087294,
5300908.44935218, 5301004.63743598, 5301032.84088985, 5301193.21015462,
5301546.0986696, 5301556.8743251, 5301638.38580281, 5301699.70565144,
5301715.27827829, 5301717.06428489, 5301710.89296605, 5301756.36979445,
5301772.50701529, 5301863.35482229, 5301880.58756753, 5301989.81013455,
5302130.8079535, 5302584.39817418, 5302596.366411, 5302684.62739195,
5302796.69950482, 5302790.50921451, 5302740.54973267, 5302693.72433851,
5302662.79969881, 5302606.5874547, 5302598.24231826, 5302604.54978913,
5302576.73879313, 5302547.6485361, 5302517.90398791, 5302508.78663473,
5302489.22956471, 5302473.04148911, 5302394.59613077, 5302334.32782954,
5302234.4596447, 5302236.27647685, 5302183.73438136, 5302173.30005962,
5302164.90948177, 5302479.83906707, 5302579.30638664, 5302683.08363118,
5302784.67724703, 5302889.84203459, 5302993.86090102, 5303050.90098993,
5303094.44701761, 5303198.88191322, 5303299.95792929, 5303696.7794375,
5303741.09086798, 5303882.36701777, 5304025.67288907, 5304110.63026871,
5304297.79633179, 5304438.92681572, 5304547.94034564, 5304655.02318057,
5304745.68382405, 5304944.75450767, 5305044.05625524, 5305245.27438053,
5305343.93512983, 5305392.07175117, 5305448.76704368, 5305427.89238874,
5305473.15682798, 5305518.01595488, 5305601.59755381, 5305567.91600103,
5305395.38764299, 5305336.67126969, 5305316.84088997, 5305326.39176804,
5305297.40020251, 5305272.78325541, 5305268.15637788, 5305258.2445979,
5305242.07891914, 5305233.69705362, 5305218.52277973, 5305215.24925591,
5305204.16654656, 5305201.76495279, 5305187.32057255, 5305172.39447026,
5305149.07581308, 5305157.85877831, 5305154.13524466, 5305152.07043576,
5305135.99541389, 5305107.20772552, 5305070.47456415, 5305082.69520486,
5305081.10569001, 5305072.84969607, 5305052.20974791, 5304996.37347755,
5305003.1562278, 5305012.91960825, 5305009.74993934, 5305000.73513169,
5304997.98728024, 5304994.13145569, 5304973.93659553, 5304965.77804024,
5304941.51258272, 5304918.8869081, 5304936.86667244, 5304947.50911442,
5304938.98207156, 5304919.86967302, 5304912.31226548, 5304905.27371804,
5304894.52697623, 5304760.29471085, 5304603.57967112, 5304499.04759509,
5304383.46130176, 5304291.62245791, 5304245.1035999, 5304251.14643443,
5304253.68188377, 5304260.97641085, 5304296.69345858, 5304288.96446782,
5304248.67016629, 5304188.12127577, 5304079.58707737, 5303976.51470533,
5303879.16458117, 5303808.72895223, 5303594.8656147, 5303425.14906257,
5303431.46951769, 5303345.01481991, 5303311.46771557, 5303250.1603686,
5303250.9682467, 5303247.91797578, 5303214.60227797, 5303175.55083092,
5303156.26303815, 5303154.25994506, 5303150.52772608, 5303143.11926225,
5303162.94852044, 5303088.10705888, 5303043.29591935, 5303015.94401408,
5303015.88803821, 5303021.5716802, 5303036.93348162, 5303014.26426146,
5302996.53676321, 5302980.9559662, 5302970.29178271, 5302922.52277359,
5302893.01423331, 5302897.23910225, 5302920.51445691, 5302931.95291472,
5302934.49304422, 5302930.89524397, 5302923.99740084, 5302906.93914177,
5302848.88877619, 5302772.96477943, 5302737.04246372, 5302730.81344238,
5302714.54698656, 5302691.95267996, 5302676.17392058, 5302664.95183344,
5302625.84837015, 5302617.65103562, 5302607.82306379, 5302603.40991907,
5302603.19335085, 5302605.25107425, 5302615.63105519, 5302725.00478854,
5301961.27786775, 5301702.17096874, 5301149.80212398, 5300314.10008672,
5300311.84354903, 5300293.22757915, 5299761.45080995, 5299520.57810386,
5299539.86074612, 5299121.88576906, 5299127.12007139, 5299030.64816599,
5299044.17794731, 5298962.29255758, 5298970.68107799, 5298777.17436723,
5298946.63795903, 5298995.70394209, 5299166.76845212, 5299315.50993929,
1683255.29638417, 1683185.1487802, 1683104.5119755, 1682895.33685387,
1682893.08447494, 1682888.97562203, 1682868.75837246, 1682862.88348492,
1682834.75323901, 1682771.83351357, 1682771.6658849, 1682775.5748091,
1682765.65354205, 1682948.89694399, 1682969.64736441, 1683059.43217206,
1683262.4263516, 1683349.23688796, 1683790.35727207, 1683875.47482941,
1684320.85311382, 1684310.70119184, 1684220.51229248, 1684212.0866537,
1684195.21104453, 1684171.10974753, 1684140.75872377, 1684016.25161306,
1683819.52186966, 1683639.64524998, 1683337.90335245, 1683210.43777696,
1683180.24663625, 1683161.53052134, 1683122.41301495, 1683087.15502088,
1683076.36880098, 1683053.25954768, 1683034.65698505, 1682976.13781621,
1682907.47529073, 1682786.710066, 1682764.88610883, 1682702.32584447,
1682683.67883251, 1682671.16376756, 1682611.88831616, 1682593.97362172,
1682572.81130583, 1682554.01620624, 1682532.23733502, 1682512.61410481,
1682500.08446544, 1682490.64454083, 1682470.94155117, 1682451.02228613,
1682369.28034821, 1682359.35250152, 1682323.46991296, 1682274.19506473,
1682247.30277927, 1682208.52833588, 1682179.35557509, 1682155.59309352,
1682131.54882121, 1682113.55740842, 1682075.21253153, 1682056.48623745,
1682017.71877538, 1681996.19450569, 1681983.81310597, 1681972.06349829,
1681867.58767102, 1681761.29739696, 1681752.63219265, 1681734.17940907,
1681658.4971893, 1680793.87913727, 1680504.93454401, 1680392.45158445,
1680370.64036159, 1680317.71066804, 1680194.79672819, 1680172.02778187,
1680120.41399897, 1680042.63597454, 1680002.45283628, 1679929.5536286,
1679912.38036472, 1679855.35899459, 1679843.54070427, 1679768.9121676,
1679689.07492222, 1679540.26567658, 1679534.52931312, 1679516.2053439,
1679505.33461648, 1679500.02053864, 1679364.74115313, 1679164.46224564,
1679163.22087387, 1679155.75347441, 1679119.38235826, 1679109.35058752,
1678832.45038522, 1678831.41078527, 1678829.42679649, 1678810.98985975,
1678759.53026111, 1678747.78191405, 1678728.8069249, 1678687.97409906,
1678675.85744912, 1678567.09177193, 1678452.91167767, 1678449.48386194,
1678447.20836326, 1678427.60170373, 1678334.61120315, 1678292.45179286,
1678293.65624548, 1678302.16287358, 1678329.32924015, 1678323.58426748,
1678305.65474845, 1678312.1053974, 1678344.55464237, 1678440.27829446,
1678707.21167321, 1678717.19666897, 1678745.97304318, 1678813.4555282,
1678822.25358014, 1678845.01379218, 1678847.95713341, 1678832.66028779,
1678811.96402822, 1678871.85382728, 1678933.94746544, 1679082.81860109,
1679071.97467145, 1679107.2720689, 1679116.85630453, 1679065.42265321,
1679034.54611556, 1679023.99343456, 1678983.51341148, 1678828.03745317,
1678630.93329216, 1678587.20980719, 1678584.45600419, 1678579.23136422,
1678533.99231768, 1678408.23040791, 1678061.90639503, 1678200.66076846,
1678288.7735902, 1678339.14644916, 1678430.8075471, 1678556.1794551,
1678561.02175652, 1678564.63195234, 1678567.80503492, 1678569.97686544,
1678578.35064994, 1678585.37699143, 1678607.89053235, 1678729.95663563,
1678778.3268713, 1678806.37761312, 1678827.66136479, 1678860.0056667,
1678913.27670359, 1679082.50812266, 1679302.01689884, 1679413.44539103,
1679430.29711531, 1679480.69789899, 1679538.25984915, 1679575.12433948,
1679599.31700317, 1679661.48573184, 1679674.33504401, 1679702.53466885,
1679727.93705294, 1679750.22585139, 1679775.89032442, 1679835.31461498,
1679975.39923174, 1680022.35743636, 1680017.96009989, 1680031.99041161,
1680068.73823615, 1680057.341729, 1680071.76095037, 1680109.19482158,
1680120.84303988, 1680221.47601726, 1680262.48146436, 1680288.06329788,
1680316.72548408, 1680438.52518267, 1680455.28267162, 1680551.59441307,
1680600.12354131, 1681423.74328794, 1681662.37909344, 1682522.34508347,
1683255.29638417), .Dim = c(209L, 2L)))), class = c("XY",
"MULTIPOLYGON", "sfg")), structure(list(list(structure(c(5310569.7817719,
5310610.28303821, 5310613.96680774, 5310643.44956973, 5310758.86538242,
5310794.4422881, 5310824.89111014, 5310833.8646511, 5310923.66538971,
5310996.66740143, 5311018.79508831, 5311054.39769598, 5311069.71332427,
5311137.4851719, 5311150.2202343, 5311194.4467232, 5311262.45951696,
5311266.35949209, 5311304.08725034, 5311323.60903743, 5311423.23386932,
5311440.7947835, 5311445.78093491, 5311455.35598758, 5311501.97735598,
5311499.37431314, 5311497.03364449, 5311496.56308036, 5311492.06761901,
5311436.75915715, 5311385.04173941, 5311364.97968706, 5311362.3211712,
5311420.85036721, 5311547.88350496, 5311553.84036598, 5312954.79870202,
5312849.96325097, 5312819.00078416, 5312638.43105284, 5312434.59099342,
5312373.17348802, 5312285.29002927, 5312182.62085638, 5311933.55544794,
5311801.40685915, 5311734.29312101, 5311697.1010909, 5311678.35991069,
5311671.68068191, 5311652.20548157, 5311626.78445634, 5311571.84722116,
5311361.5984969, 5311093.46072297, 5311009.0556843, 5310950.47773828,
5310880.87763716, 5310596.46811211, 5310745.08241505, 5310679.18007077,
5310559.20626522, 5310520.31384828, 5310471.76991353, 5310465.57926858,
5310199.27006198, 5310149.74926052, 5310016.53437949, 5310016.37386187,
5310008.65507358, 5310021.37429313, 5310033.8950999, 5310039.06524458,
5310039.47872777, 5310035.60592518, 5310033.1189666, 5310020.21286212,
5310011.23165125, 5310002.16686124, 5309996.33107554, 5309986.44268238,
5309956.78950759, 5309923.34533601, 5309904.62310634, 5309888.86562578,
5309886.54345063, 5309889.29194773, 5309897.53111722, 5309903.91342425,
5309922.90006675, 5309944.67088184, 5309947.48346932, 5309956.38130259,
5309961.20769899, 5309970.65596462, 5309977.10140077, 5309973.77498522,
5309975.6741656, 5309975.09626966, 5309967.30333533, 5309944.93026213,
5309919.57724194, 5309899.35285424, 5309863.17515244, 5309836.29974828,
5309809.76670982, 5309786.69752346, 5309765.190157, 5309745.89597466,
5309728.58421352, 5309710.1857967, 5309702.14818733, 5309700.57846284,
5309702.99248326, 5309707.08826066, 5309708.67481474, 5309712.07325316,
5309708.82290741, 5309704.87394938, 5309694.11017489, 5309678.89561561,
5309654.12583635, 5309648.8070169, 5309639.8399616, 5309634.04278497,
5309631.9412455, 5309600.10522664, 5309589.78983315, 5309580.78730405,
5309576.00960534, 5309577.00257414, 5309576.34821946, 5309572.46994322,
5309578.87823451, 5309577.62996049, 5309567.39507063, 5309557.8105255,
5309547.42724583, 5309534.29803207, 5309515.69463588, 5309499.90125726,
5309488.40025795, 5309471.56704334, 5309466.25687477, 5309453.35108119,
5309427.56275537, 5309398.85724613, 5309385.47592476, 5309367.8802551,
5309360.7232928, 5309363.10397069, 5309376.63850603, 5309379.91445036,
5309368.54696288, 5309345.05282442, 5309275.57755488, 5309266.56274636,
5309263.0492451, 5309262.58038505, 5309268.05974085, 5309290.572245,
5309303.60607397, 5309333.53948886, 5309375.5841066, 5309403.5454889,
5309423.54252489, 5309443.03203954, 5309457.54327721, 5309479.62900933,
5309484.45678577, 5309497.43892513, 5309506.41515683, 5309508.48236307,
5309509.68744051, 5309512.07973226, 5309507.07321924, 5309492.0916057,
5309471.52904565, 5309374.57277613, 5309326.04765915, 5309296.12672254,
5309247.59739068, 5309245.70788903, 5309239.05079622, 5309226.04927865,
5309208.55895275, 5309196.5756015, 5309186.56428288, 5309182.57156897,
5309186.09017214, 5309198.8300127, 5309206.0450945, 5309220.12410172,
5309220.62467738, 5309215.52319596, 5309212.51788996, 5309213.9159542,
5309206.89165991, 5309190.69111145, 5309125.45798923, 5309102.28932844,
5309073.67271748, 5309048.62627079, 5309016.50658032, 5308994.5022552,
5308967.94569111, 5308960.88804139, 5308953.42889947, 5308945.83191134,
5308945.85409139, 5308963.896387, 5308960.28793578, 5308954.79198557,
5308944.1831107, 5308923.14434567, 5308918.66090173, 5308914.5896505,
5308914.06494049, 5308908.98600723, 5308903.43727319, 5308896.42224924,
5308887.89158355, 5308891.89376597, 5308895.96058589, 5308898.99336744,
5308900.47022051, 5308896.41909499, 5308889.34288179, 5308865.04248776,
5308838.71408133, 5308834.07853699, 5308834.63016261, 5308838.12937414,
5308836.1035116, 5308834.54123937, 5308812.23280775, 5308786.99977009,
5308774.76059678, 5308763.14834544, 5308754.49071614, 5308731.19846481,
5308661.90137073, 5308638.15279419, 5308635.13585989, 5308618.85718191,
5308623.88830363, 5308620.79947252, 5308611.04360391, 5308591.11199319,
5308582.01859041, 5308567.84939963, 5308551.07614004, 5308536.26034839,
5308518.02486547, 5308497.35312099, 5308486.19468461, 5308431.86427788,
5308417.26461389, 5308405.68773686, 5308394.69562356, 5308382.14739382,
5308368.53017933, 5308267.27724675, 5308230.41885309, 5308219.92682456,
5308179.91836452, 5308169.41251442, 5308159.38111656, 5308128.54227477,
5308131.0820386, 5308090.68993972, 5308059.62839754, 5308045.21572263,
5308013.28713395, 5308019.89999245, 5308030.86260455, 5308034.33942537,
5308031.40710331, 5308021.51394809, 5307999.06634609, 5307992.0683489,
5307974.56677276, 5307871.69396912, 5307844.21876335, 5307715.43555972,
5307697.97493666, 5307681.05567421, 5307670.03169097, 5307659.21377936,
5307656.99641533, 5307653.00444268, 5307651.90410459, 5307657.6634621,
5307664.90339079, 5307685.1873229, 5307738.9983303, 5307759.75251011,
5307796.98887262, 5307805.51516418, 5307805.18781526, 5307789.92959299,
5307762.40754311, 5307725.83051697, 5307699.19935585, 5307666.93917095,
5307592.92575999, 5307590.58129955, 5307553.88127847, 5307545.4317397,
5307539.61833427, 5307541.32005665, 5307546.49407145, 5307558.13728649,
5307566.31756159, 5307591.70443179, 5307613.04255019, 5307636.23024313,
5307639.23799701, 5307635.94569328, 5307659.97386093, 5307696.41725004,
5307738.39021829, 5307757.81250866, 5307780.80962641, 5307787.12183267,
5307787.83606042, 5307786.47325545, 5307783.40612018, 5307775.59397357,
5307733.98692269, 5307724.75315809, 5307670.68105772, 5307645.09436734,
5307624.53917608, 5307621.73908172, 5307616.41602931, 5307607.28553305,
5307604.03079224, 5307600.32323187, 5307597.90669194, 5307595.24857694,
5307593.24251503, 5307617.87763931, 5307643.87952728, 5307685.86994677,
5307745.75343325, 5307771.56441614, 5307799.12744798, 5307838.99814301,
5307852.12683063, 5307886.55855087, 5307928.56045835, 5308051.92160708,
5308196.61277479, 5308212.06964088, 5308233.57232038, 5308259.88749128,
5308304.98986126, 5308340.78738015, 5308469.56161831, 5308546.34078794,
5308686.06936899, 5308733.49974509, 5308726.30505197, 5308753.67722407,
5308849.80203404, 5308878.48852914, 5308896.43506856, 5308904.32127585,
5308909.37654947, 5308918.36578297, 5308919.54252029, 5308918.28303391,
5308897.79449107, 5308898.34411574, 5308898.93377789, 5308930.53431956,
5308942.43769325, 5309038.31204107, 5309088.49204956, 5309120.8114501,
5309149.48840446, 5309172.2876508, 5309205.98870431, 5309291.23123129,
5309400.66669081, 5309530.14865272, 5309555.79214929, 5309676.08691318,
5309718.39393165, 5309923.60661516, 5310179.7909326, 5310311.81874085,
5310473.76369922, 5310532.79089843, 5310563.89552017, 5310569.7817719,
1678430.13111715, 1678425.11354334, 1678434.07695241, 1678429.81712641,
1678411.03013287, 1678405.54104357, 1678401.42605496, 1678400.17897211,
1678385.89000956, 1678374.42895347, 1678370.86603683, 1678365.14816017,
1678363.18601725, 1678351.87987041, 1678349.98726714, 1678343.43331341,
1678333.32210247, 1678332.64809963, 1678326.39063891, 1678323.12929992,
1678307.88459191, 1678304.90647526, 1678303.90065908, 1678302.42065816,
1678293.80658349, 1678285.18916933, 1678275.72873943, 1678270.1801535,
1678251.1089186, 1677975.1222549, 1677716.58118064, 1677498.83370077,
1677469.57154341, 1677457.76648621, 1677432.14729764, 1677430.94605155,
1677178.79978622, 1676657.36233224, 1676503.21258694, 1675605.24178898,
1674598.49214193, 1674694.27129785, 1674711.96717674, 1674637.26342663,
1674574.10139284, 1674523.17686669, 1674417.38688145, 1674336.60969061,
1674317.69719888, 1674304.59453088, 1674262.35120777, 1674217.80664035,
1674184.28916206, 1674015.79927568, 1673866.54789517, 1673788.17820987,
1673799.98873804, 1673814.02261389, 1673684.78139129, 1674409.77880711,
1674423.86214879, 1674458.1114026, 1674490.22817522, 1674500.24829098,
1674501.38448627, 1674556.48062224, 1674567.37891727, 1674596.41454113,
1674596.33405863, 1674600.26293425, 1674628.96494542, 1674641.67704928,
1674654.06687538, 1674669.33601744, 1674684.45446715, 1674695.00345216,
1674696.81870496, 1674695.92255193, 1674698.54278551, 1674707.51014386,
1674718.19878136, 1674723.16953005, 1674720.43934326, 1674709.88274237,
1674691.50277451, 1674673.57095248, 1674655.74418844, 1674641.8887751,
1674627.05363691, 1674617.12429051, 1674614.1963979, 1674614.19299451,
1674618.60540832, 1674620.00164267, 1674620.35189422, 1674614.76092846,
1674580.7760583, 1674564.81417687, 1674547.65906072, 1674539.07244998,
1674542.2346326, 1674550.28830448, 1674553.01691664, 1674551.40320673,
1674548.70171284, 1674541.98014198, 1674521.68996302, 1674506.27735179,
1674510.39922453, 1674525.40975567, 1674542.8975954, 1674561.67987368,
1674579.26888907, 1674597.29517207, 1674615.4333745, 1674637.57784934,
1674651.90574836, 1674675.8172262, 1674687.33914452, 1674695.83468024,
1674702.29400686, 1674701.08762664, 1674700.46849962, 1674698.21552725,
1674694.87080116, 1674693.03746192, 1674671.13221358, 1674656.84670294,
1674640.48979582, 1674606.12034674, 1674547.1042682, 1674539.2212574,
1674515.73325554, 1674485.31337757, 1674459.48791973, 1674448.45982205,
1674443.50933739, 1674439.96198367, 1674443.17823017, 1674456.07986909,
1674473.60697171, 1674540.9548817, 1674574.04526255, 1674581.32687851,
1674604.93147131, 1674621.54282951, 1674626.21284004, 1674624.96494832,
1674636.42201941, 1674654.91441091, 1674680.62408526, 1674730.83539977,
1674778.82932034, 1674792.18914907, 1674801.22561644, 1674813.6823324,
1674824.76086966, 1674836.64699085, 1674857.1749649, 1674899.64362946,
1674933.59048064, 1674948.11627173, 1674960.24353531, 1674960.55414691,
1674949.71204854, 1674933.36709615, 1674930.21998213, 1674931.35245046,
1674939.98595944, 1674947.81605413, 1674962.80423691, 1674975.10209714,
1674986.76363764, 1674992.7291005, 1675006.35696665, 1675030.84924739,
1675076.66066902, 1675105.19873728, 1675171.1847991, 1675182.34414965,
1675184.55180786, 1675180.69852685, 1675180.62879185, 1675180.16780358,
1675175.79596333, 1675164.20316915, 1675161.65766518, 1675166.72888567,
1675171.59983434, 1675179.01686976, 1675186.37663525, 1675210.65754497,
1675220.00451074, 1675222.83849603, 1675227.93347926, 1675253.03797705,
1675280.30062699, 1675295.15408708, 1675301.36325649, 1675290.16273364,
1675281.52431219, 1675266.98789201, 1675250.48817872, 1675222.54866973,
1675186.12977936, 1675150.74396086, 1675142.23611536, 1675143.5181321,
1675146.97297258, 1675158.14478497, 1675181.0272309, 1675188.86882843,
1675192.01184929, 1675188.06022662, 1675160.7034411, 1675159.57771454,
1675178.68922947, 1675200.35766729, 1675216.62480901, 1675224.85871336,
1675223.34166524, 1675216.82510325, 1675208.79093179, 1675207.85589707,
1675202.16265582, 1675170.93167664, 1675134.83490046, 1675125.87930907,
1675108.43914826, 1675082.03897159, 1675064.4617181, 1675046.85182404,
1675029.54917281, 1675015.96001982, 1675013.22774705, 1675008.14184628,
1674996.08347788, 1674984.78495377, 1674981.9395889, 1674978.72267087,
1674977.33570661, 1674972.83250425, 1674970.9737952, 1674970.68068521,
1674993.27726595, 1675003.88800891, 1675023.93038005, 1675055.59427823,
1675099.36352023, 1675109.3307905, 1675115.24431742, 1675138.95732909,
1675167.35479313, 1675183.12242153, 1675191.48027233, 1675191.59206306,
1675166.56734242, 1675156.0858313, 1675143.07372493, 1675124.75017713,
1675109.78955341, 1675102.38335924, 1675073.64270923, 1675073.30929222,
1675064.59383994, 1675067.94628826, 1675053.81468921, 1675047.37696958,
1675055.76136862, 1675064.39214453, 1675073.69364047, 1675081.33334574,
1675095.31357881, 1675131.46629505, 1675163.43281033, 1675191.5837801,
1675212.33064918, 1675233.13255948, 1675271.93888448, 1675312.15684911,
1675315.71805529, 1675316.21163437, 1675299.4365838, 1675299.12682562,
1675325.42042033, 1675333.24517752, 1675349.0891181, 1675365.54605539,
1675418.65334969, 1675441.90775214, 1675490.24617726, 1675503.33936032,
1675519.67259938, 1675535.48028858, 1675551.58256372, 1675571.171336,
1675581.7595515, 1675619.60656979, 1675663.15239969, 1675681.84668553,
1675720.49798628, 1675745.60065016, 1675772.6495976, 1675787.18584016,
1675799.9266063, 1675815.92839698, 1675838.19241235, 1675900.60506048,
1675918.00887677, 1675939.16902434, 1675962.53299367, 1675970.62998579,
1675977.19118408, 1675986.5986879, 1675999.4087473, 1676006.82936813,
1676004.50509397, 1676007.96038454, 1676030.52907552, 1676056.93636053,
1676068.07262533, 1676074.81560936, 1676087.02759217, 1676121.885411,
1676147.36386797, 1676167.99214371, 1676175.15470619, 1676191.35531171,
1676207.27472685, 1676258.26047493, 1676264.3072031, 1676298.96389967,
1676315.43457909, 1676319.70980356, 1676320.84130003, 1676323.04817893,
1676330.31615118, 1676333.12028099, 1676335.11293803, 1676337.06995449,
1676337.83402897, 1676342.5303426, 1676381.90999647, 1676420.56129994,
1676480.47347826, 1676569.27654378, 1676608.41815757, 1676645.17293218,
1676697.83764988, 1676719.22605619, 1676760.34789456, 1676807.16241382,
1676942.04593984, 1677095.4175025, 1677111.93211243, 1677134.44812474,
1677161.86049824, 1677209.06482932, 1677246.63761706, 1677388.78385253,
1677465.70379733, 1677598.9756217, 1677649.88754162, 1677659.58384943,
1677689.04126433, 1677820.29906884, 1677917.56097495, 1677972.06672414,
1678016.75447476, 1678070.25543687, 1678106.14066091, 1678153.6529643,
1678186.98301246, 1678374.33959766, 1678390.59665777, 1678516.79491712,
1678724.65530764, 1678722.92443322, 1678706.57712306, 1678694.16903397,
1678687.18023886, 1678678.21923475, 1678671.91469016, 1678664.98575631,
1678647.74661906, 1678625.39154679, 1678600.22814665, 1678595.15676277,
1678571.96802305, 1678563.75512588, 1678523.86169522, 1678480.11475505,
1678458.63728343, 1678433.26669073, 1678423.26555746, 1678418.11333781,
1678430.13111715), .Dim = c(397L, 2L)))), class = c("XY",
"MULTIPOLYGON", "sfg")), structure(list(list(structure(c(5303088.10705888,
5303034.81350168, 5302961.68572788, 5302921.93340975, 5302887.42169134,
5302866.2793255, 5302814.29222157, 5302785.80521032, 5302773.50801425,
5302785.95142789, 5302771.59499131, 5302760.47852838, 5302697.21714599,
5302721.82136656, 5302676.54984584, 5302653.958583, 5302631.2651774,
5302607.8694746, 5302563.51953459, 5302479.92818307, 5302462.04384806,
5302459.08520026, 5302442.00309258, 5302411.69563025, 5302378.6645155,
5302329.62706202, 5302315.19858825, 5302302.64665237, 5302287.92759943,
5302279.65446193, 5302269.76048139, 5302266.65018454, 5302254.6665389,
5302253.52755704, 5302253.02002214, 5302247.43080447, 5302232.38984568,
5302209.79377055, 5302197.59467231, 5301531.79993015, 5301282.06523104,
5300878.92328042, 5301194.41528127, 5301290.05325063, 5301330.34007182,
5301359.85480979, 5301395.29401876, 5301455.78742497, 5301463.91470039,
5301515.0354034, 5301517.71720763, 5301514.30800519, 5301508.41844467,
5301487.30943357, 5300712.13180491, 5299961.6336073, 5300033.20110238,
5300099.73973863, 5300123.03424235, 5300283.84024555, 5300309.76143754,
5300311.84354903, 5300314.10008672, 5301149.80212398, 5301702.17096874,
5301961.27786775, 5302725.00478854, 5302615.63105519, 5302605.25107425,
5302603.19335085, 5302603.40991907, 5302607.82306379, 5302617.65103562,
5302625.84837015, 5302664.95183344, 5302676.17392058, 5302691.95267996,
5302714.54698656, 5302730.81344238, 5302737.04246372, 5302772.96477943,
5302848.88877619, 5302906.93914177, 5302923.99740084, 5302930.89524397,
5302934.49304422, 5302931.95291472, 5302920.51445691, 5302897.23910225,
5302893.01423331, 5302922.52277359, 5302970.29178271, 5302980.9559662,
5302996.53676321, 5303014.26426146, 5303036.93348162, 5303021.5716802,
5303015.88803821, 5303015.94401408, 5303043.29591935, 5303088.10705888,
1678061.90639503, 1677756.58476513, 1677633.37367323, 1677444.87362547,
1677260.49972891, 1677160.91690741, 1676902.40896617, 1676740.18020582,
1676679.78587711, 1676651.95741564, 1676612.98597655, 1676582.84037579,
1676411.76827014, 1676405.74211184, 1676282.27382152, 1676218.10256202,
1676139.61045642, 1676062.27748975, 1675846.24651, 1675438.20978446,
1675350.37973533, 1675335.84980276, 1675256.21282267, 1675088.58666177,
1674926.3701749, 1674705.75211856, 1674618.23265806, 1674565.45239855,
1674568.67544213, 1674570.58595256, 1674527.31525687, 1674511.68650042,
1674452.12737758, 1674445.47048442, 1674417.45386878, 1674418.36613405,
1674421.42895066, 1674426.03032921, 1674428.51455718, 1674564.9410619,
1674616.86055625, 1674698.16000042, 1676251.05866328, 1676722.80930704,
1676920.69231607, 1677066.112763, 1677238.10496076, 1677524.8040168,
1677568.54379196, 1677819.5464252, 1677837.29376047, 1677847.81379514,
1677854.661392, 1677862.58045742, 1678020.53219433, 1678173.92218196,
1678532.66313677, 1679004.1184036, 1679113.53381458, 1679918.174903,
1680047.15180104, 1680057.341729, 1680068.73823615, 1680031.99041161,
1680017.96009989, 1680022.35743636, 1679975.39923174, 1679835.31461498,
1679775.89032442, 1679750.22585139, 1679727.93705294, 1679702.53466885,
1679674.33504401, 1679661.48573184, 1679599.31700317, 1679575.12433948,
1679538.25984915, 1679480.69789899, 1679430.29711531, 1679413.44539103,
1679302.01689884, 1679082.50812266, 1678913.27670359, 1678860.0056667,
1678827.66136479, 1678806.37761312, 1678778.3268713, 1678729.95663563,
1678607.89053235, 1678585.37699143, 1678578.35064994, 1678569.97686544,
1678567.80503492, 1678564.63195234, 1678561.02175652, 1678556.1794551,
1678430.8075471, 1678339.14644916, 1678288.7735902, 1678200.66076846,
1678061.90639503), .Dim = c(101L, 2L)))), class = c("XY",
"MULTIPOLYGON", "sfg")), structure(list(list(structure(c(5301539.53698508,
5301550.90267488, 5301684.28095332, 5301686.36532665, 5301703.72793772,
5301767.22439886, 5301784.85316248, 5301862.20185307, 5302099.41056916,
5302731.191327, 5303376.30693484, 5303452.77274554, 5303468.41959378,
5303500.97056074, 5304480.6488637, 5304535.08772015, 5304639.93590518,
5304757.18241663, 5304922.13102054, 5304924.66918589, 5304926.31034594,
5304929.19574798, 5304936.062457, 5304943.65577966, 5304952.45958214,
5304962.86946635, 5304980.39332773, 5304995.09343405, 5305006.95063586,
5305020.5654143, 5305040.95744735, 5305073.18304718, 5305096.95317523,
5305116.83163829, 5305134.95838912, 5305152.7512448, 5305170.43965367,
5305188.02657144, 5305205.39288526, 5305222.19593159, 5305238.57102866,
5305254.45201079, 5305269.76682005, 5305284.51546655, 5305298.55971041,
5305311.83043482, 5305324.18939646, 5305336.88380968, 5305357.05455564,
5305370.03320593, 5305386.4346625, 5305389.79549922, 5305419.05471203,
5305460.68700451, 5305510.00004645, 5305535.08736983, 5305585.42046486,
5305612.43145672, 5305758.11784909, 5305871.34339188, 5306050.84209085,
5306114.23118181, 5306154.08494141, 5306161.48918899, 5306165.74561469,
5306168.80839731, 5306181.12803914, 5306187.50753021, 5306193.92128779,
5306199.37085799, 5306206.08567276, 5306253.84894156, 5306275.82094991,
5306282.01384352, 5306289.37915646, 5306292.96116398, 5306336.97638294,
5306415.202418, 5306442.48981033, 5306448.71291325, 5306491.85980936,
5306479.08947873, 5306432.93260688, 5306433.28502676, 5306419.86190979,
5306409.31372306, 5306408.19405405, 5306409.46002341, 5306416.27462667,
5306455.06536761, 5306438.18178532, 5306476.17892812, 5306489.12269292,
5306630.32360827, 5306857.14144846, 5306888.61948008, 5307156.6917417,
5308043.29131907, 5307900.12159158, 5306491.85980936, 5306448.71291325,
5306442.48981033, 5306415.202418, 5306336.97638294, 5306261.0409186,
5306170.6904644, 5306161.53403289, 5306134.75324817, 5305659.0726907,
5305438.70104347, 5305385.42042901, 5304649.15294485, 5304603.31619287,
5304580.28235237, 5304177.84575214, 5303941.71399835, 5303926.96035945,
5303793.4050644, 5303806.06535403, 5303769.09722665, 5303714.73317942,
5303683.97391793, 5303610.19156592, 5303455.00266521, 5303383.54436708,
5303170.31662308, 5303024.97156681, 5303008.76564428, 5303048.90488679,
5303025.82401457, 5303004.80258904, 5302966.90444534, 5302983.71723835,
5302963.92581344, 5302897.75194831, 5302882.76781702, 5302796.69950482,
5302684.62739195, 5302596.366411, 5302584.39817418, 5302130.8079535,
5301989.81013455, 5301880.58756753, 5301863.35482229, 5301772.50701529,
5301756.36979445, 5301710.89296605, 5301717.06428489, 5301715.27827829,
5301699.70565144, 5301638.38580281, 5301556.8743251, 5301546.0986696,
5301193.21015462, 5301032.84088985, 5301004.63743598, 5300908.44935218,
5300919.24949151, 5300920.18480082, 5300907.02868966, 5300940.20227688,
5300981.3346972, 5300978.6531365, 5300992.77600219, 5301035.21747747,
5301039.9083406, 5301050.62757952, 5301083.17783538, 5301149.93895365,
5301152.18284679, 5301168.67531902, 5301203.08375986, 5301224.35189541,
5301226.28692316, 5301228.47255909, 5301245.96612574, 5301262.75784538,
5301303.73990086, 5301306.48514329, 5301308.56918719, 5301323.88719662,
5301364.95692907, 5301369.48356225, 5301388.13765709, 5301412.32812015,
5301422.9940449, 5301427.04953259, 5301427.63723751, 5301430.20351909,
5301460.70285439, 5301464.65070311, 5301467.94608441, 5301530.75453785,
5301539.53698508, 1686088.2739433, 1686140.37332152, 1686814.27189892,
1686824.12041647, 1686888.65475842, 1687178.26574846, 1687258.55154715,
1687643.44130981, 1687604.68858758, 1687475.00178877, 1687342.57676738,
1687331.72215357, 1687325.14411531, 1687318.50546825, 1687119.61147425,
1687143.743355, 1687089.53672245, 1687019.14872413, 1686443.02409167,
1686436.75008252, 1686433.14222388, 1686429.2810678, 1686425.17386026,
1686422.16051531, 1686420.14253488, 1686418.58784132, 1686416.26234427,
1686415.97926332, 1686417.29091404, 1686420.16391929, 1686426.62449108,
1686437.11105065, 1686443.90022803, 1686448.5465358, 1686450.9530479,
1686452.07294193, 1686451.97240642, 1686450.31218211, 1686447.56805898,
1686443.47111343, 1686438.3324629, 1686431.82691088, 1686424.30777673,
1686415.77505398, 1686406.25686879, 1686395.76727963, 1686384.33441026,
1686371.36581058, 1686347.73224666, 1686331.20647792, 1686309.92044422,
1686306.97891152, 1686283.07694445, 1686230.4684924, 1686170.31513326,
1686139.69955851, 1686078.88830405, 1686046.7531825, 1685870.71138807,
1685730.06176006, 1685510.58375256, 1685432.11319311, 1685374.56968629,
1685362.11508021, 1685354.36407975, 1685348.8875908, 1685324.48430336,
1685310.88343057, 1685296.03388817, 1685283.52510329, 1685265.90519675,
1685214.31871002, 1685186.03525927, 1685177.89090706, 1685169.84697086,
1685165.50681164, 1685098.65375769, 1685085.35567786, 1685080.03738242,
1685078.77304069, 1685070.0071802, 1685115.94844103, 1685279.63633425,
1685281.37084495, 1685323.38121608, 1685385.91644907, 1685408.04308466,
1685504.97721532, 1685545.24588407, 1685736.14781916, 1685743.75515143,
1685892.48695546, 1685890.64697044, 1685861.05474629, 1685813.51239415,
1685807.23190731, 1685751.21415093, 1685569.48753224, 1684865.75078532,
1685070.0071802, 1685078.77304069, 1685080.03738242, 1685085.35567786,
1685098.65375769, 1685008.42494656, 1684569.82790735, 1684572.25300448,
1684579.72715782, 1684663.77666833, 1684706.89694596, 1684718.97531731,
1684877.14555265, 1684885.46066061, 1684888.34362864, 1684921.52155991,
1685022.68448468, 1684982.78943057, 1685008.42115535, 1685051.11342006,
1685058.42070243, 1685065.88643034, 1685073.62263036, 1685083.69232614,
1685102.11557984, 1685098.50605808, 1685162.19066118, 1685217.23448856,
1685212.63663509, 1685172.49896622, 1685054.03013613, 1684956.25362074,
1684931.46695196, 1684874.40913766, 1684750.52635756, 1684595.23154874,
1684598.40054166, 1684171.10974753, 1684195.21104453, 1684212.0866537,
1684220.51229248, 1684310.70119184, 1684320.85311382, 1683875.47482941,
1683790.35727207, 1683349.23688796, 1683262.4263516, 1683059.43217206,
1682969.64736441, 1682948.89694399, 1682765.65354205, 1682775.5748091,
1682771.6658849, 1682771.83351357, 1682834.75323901, 1682862.88348492,
1682868.75837246, 1682888.97562203, 1682945.71272627, 1682975.33226816,
1683102.45720309, 1683316.99890078, 1683492.19840913, 1683510.81315848,
1683560.88557459, 1683825.35903007, 1683854.6620894, 1683921.57644473,
1684153.85477889, 1684508.76632303, 1684527.50319893, 1684623.72313529,
1684779.06152949, 1684867.98167155, 1684876.39346301, 1684893.78706981,
1684959.65364843, 1685015.3884816, 1685113.71608803, 1685121.51060572,
1685128.53693575, 1685190.10528626, 1685277.23629367, 1685286.69917796,
1685339.56887579, 1685448.43999886, 1685498.87687508, 1685518.37206656,
1685525.47823587, 1685538.39018056, 1685692.9419497, 1685699.9260477,
1685707.94674047, 1686038.24353409, 1686088.2739433), .Dim = c(194L,
2L)))), class = c("XY", "MULTIPOLYGON", "sfg"))), n_empty = 0L, crs = structure(list(
epsg = NA_integer_, proj4string = "+proj=lcc +lat_1=49 +lat_2=77 +lat_0=63.390675 +lon_0=-91.86666666666666 +x_0=6200000 +y_0=3000000 +ellps=GRS80 +units=m +no_defs"), class = "crs"), class = c("sfc_MULTIPOLYGON",
"sfc"), precision = 0, bbox = structure(c(xmin = 5298777.17436723,
ymin = 1673377.36409231, xmax = 5312954.79870202, ymax = 1687643.44130981
), class = "bbox"))), row.names = c(NA, -6L), class = c("sf",
"data.frame"), sf_column = "geometry", agr = structure(c(FSA = NA_integer_,
FSA_NAME = NA_integer_, PR = NA_integer_), class = "factor", .Label = c("constant",
"aggregate", "identity")))

Then, "fix" the shape with st_make_valid:

fsa.clean <- fsa.raw %>% 
  st_make_valid()

Now, if I write the shape for the raw data, it works:

st_write(fsa.raw, "data/crap.shp", delete_layer = T)
Deleting layer `crap' using driver `ESRI Shapefile'
Writing layer `crap' to data source `data/crap.shp' using driver `ESRI Shapefile'
Writing 6 features with 3 fields and geometry type Multi Polygon.

But it fails with the clean dataset:

st_write(fsa.clean, "data/crap.shp", delete_layer = T)
Deleting layer `crap' using driver `ESRI Shapefile'
Writing layer `crap' to data source `data/crap.shp' using driver `ESRI Shapefile'
Writing 6 features with 3 fields and geometry type Unknown (any).
Failed to create feature 5 in crap
Error in CPL_write_ogr(obj, dsn, layer, driver, as.character(dataset_options),  : 
  Feature creation failed.
In addition: Warning message:
In CPL_write_ogr(obj, dsn, layer, driver, as.character(dataset_options),  :
  GDAL Error 1: Attempt to write non-polygon (MULTIPOLYGON) geometry to POLYGON type shapefile.

lwgeom fails to install on Centos 7 with R 3.6.2 and proj 6.0.0

Hello,
I am trying to install from github lwgeom using R 3.6.2 with centos 7 Linux.
Here is my setup
OS : centos 7
R version : 3.6.2
GDAL version : 3.1.0
GEOS version : 3.8.1
PROJ version : 6.0.0

Command executed is as follows ;
devtools::install_github("r-spatial/lwgeom",configure.args=c('--with-proj-lib=/gpfs/software/ada/proj/6.0.0/lib','--with-proj-include=/gpfs/software/ada/proj/6.0.0/include','--with-proj-share=/gpfs/software/ada/proj/6.0.0/share/proj'))

The error generated is as follows:
checking for file ‘/tmp/RtmpDI3tVi/remotes161ee3f4c1ab1/r-spatial-lwgeom-0ac3✔ checking for file ‘/tmp/RtmpDI3tVi/remotes161ee3f4c1ab1/r-spatial-lwgeom-0ac3113/DESCRIPTION’
─ preparing ‘lwgeom’:
✔ checking DESCRIPTION meta-information ...
─ cleaning src
─ running ‘cleanup’
─ checking for LF line-endings in source and make files and shell scripts
─ checking for empty or unneeded directories
─ building ‘lwgeom_0.2-5.tar.gz’

  • installing source package ‘lwgeom’ ...
    ** using staged installation
    configure: CC: gcc -std=gnu99
    configure: CXX: g++ -std=gnu++11
    configure: pkg-config proj exists, will use it
    configure: using proj_api.h even with PROJ 5/6
    checking for pj_init_plus in -lproj... yes
    configure: PROJ_LIB: /gpfs/software/ada/proj/6.0.0/share/proj
    checking PROJ: proj.db found and readable... yes
    checking PROJ: conus found and readable... no
    Note: proj/conus not found
    No support available in PROJ4 for NAD grid datum transformations
    If required, consider re-installing from source with the contents
    of proj-datumgrid-1..zip from http://download.osgeo.org/proj/ in nad/.
    configure: POSTGIS_PROJ_VERSION: 60
    checking for geos-config... /gpfs/software/ada/geos/3.8.1/bin/geos-config
    checking geos-config usability... yes
    configure: GEOS: 3.8.1
    checking GEOS version >= 3.6.0... yes
    checking geos: linking with -L/gpfs/software/ada/geos/3.8.1/lib -lgeos_c... yes
    checking for GEOS_init_r in -lgeos_c... yes
    configure: Package CPP flags: -DUSE_PROJ_H -I/gpfs/software/ada/geos/3.8.1/include -DPOSTGIS_GEOS_VERSION=35 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H
    configure: Package LIBS: -lproj -L/gpfs/software/ada/proj/6.0.0/lib -lproj -L/gpfs/software/ada/geos/3.8.1/lib -lgeos_c
    configure: creating ./config.status
    config.status: creating src/Makevars
    config.status: creating src/postgis_config.h
    ** libs
    g++ -std=gnu++11 -I"/gpfs/software/ada/R/3.6.2/lib64/R/include" -DNDEBUG -DUSE_PROJ_H -I/gpfs/software/ada/geos/3.8.1/include -DPOSTGIS_GEOS_VERSION=35 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/gpfs/software/ada/R/3.6.2/lib64/R/library/Rcpp/include" -I"/gpfs/software/ada/R/3.6.2/lib64/R/library/sf/include" -I/usr/local/include -fpic -g -O2 -c geodetic.cpp -o geodetic.o
    In file included from geodetic.cpp:6:0:
    ./liblwgeom/liblwgeom.h:49:18: fatal error: proj.h: No such file or directory
    #include "proj.h"
    ^
    compilation terminated.
    make: *** [geodetic.o] Error 1
    ERROR: compilation failed for package ‘lwgeom’
  • removing ‘/gpfs/software/ada/R/3.6.2/lib64/R/library/lwgeom’
    Error: Failed to install 'lwgeom' from GitHub:
    (converted from warning) installation of package ‘/tmp/RtmpDI3tVi/file161ee7795d7e9/lwgeom_0.2-5.tar.gz’ had non-zero exit status

Is there something i am missing

The proj.h is here
/gpfs/software/ada/proj/6.0.0/include/proj.h

Thanks

Support of splitting a polygon by a MultiLineString

Is it possible or planed to integrate a function that can split a polygon by a MultiLineString?

My idea is to split a polygon into n-parts of equal areas. To get the corresponding lines, at the moment, I use the optim-function, which minimize the squared sum of the area deviation between the original polygon and its splitted parts (the function).
So far, the splitting is conducted by (1) creation of lines, (2) buffer lines and (3) calculate the difference between the polygon and the buffered lines (example code below). However, the method has the drawback that (1) the resulted splitted polygons do not intersect anymore, and (2) if I buffer the splitted polygon, they are larger than the orignal polygon and are of course overlapping.

# create polygon
pol <- rbind(c(-3,3), c(-3,4), c(-2,4), c(-2,3), c(-3,3))
pol <- sf::st_polygon(list(pol)) %>% st_sfc(.)

# create multilinestring
mls <- st_multilinestring(list(rbind(c(-2.5, 3), c(-2.6, 4)), rbind(c(-2.8, 3), c(-2.9, 4))))

# buffer line to get thin polygons
mls.buf <- sf::st_buffer(x = mls, dist = 0.000001)  # create a very thin polygon


## splitting
# calculate the differences of polygons and casting
pol.dif <- sf::st_difference(x = pol, y = mls.buf) %>%  sf::st_cast(x = ., to = "POLYGON")

# plot result
plot(pol.dif)


## check intersection
sf::st_intersects(pol.dif)
# Sparse geometry binary predicate list of length 3, where the predicate was `intersects'
#  1: 1
#  2: 2
#  3: 3

# -> polygons do not intersect each other



## check intersection using same buffer size
sf::st_buffer(x = pol.dif, dist = 0.000001000001) %>% sf::st_intersects(.)
# Sparse geometry binary predicate list of length 3, where the predicate was `intersects'
# 1: 1, 2
# 2: 1, 2, 3
# 3: 2, 3

# -> now, polygons do intersect each other but have a different overall area

pol.dif.comb <- sf::st_buffer(x = pol.dif, dist = 0.000001000001) %>% 
  sf::st_combine(.)

identical(sf::st_area(x = pol.dif.comb), sf::st_area(x = pol))
# FALSE

libgeos_c not found when in non-standard location

When libgeos is installed in a location not in the default system search path (as it is on our HPC system, where it is loaded via a module), the configure script fails to add the correct linker flag to the Makeovers file.

Relevant section of configure output:

checking for geos-config... /apps/libraries/geos/3.7.0/el7/AVX512/intel-2018/bin/geos-config
checking geos-config usability... yes
configure: GEOS: 3.7.0
checking GEOS version >= 3.3.0... yes
checking geos_c.h usability... yes
checking geos_c.h presence... yes
checking for geos_c.h... yes
checking geos: linking with -L/apps/libraries/geos/3.7.0/el7/AVX512/intel-2018/lib -lgeos_c... yes
checking for GEOS_init_r in -lgeos_c... yes
configure: Package CPP flags:  -I/apps/libraries/proj/4.9.3/el7/AVX512/intel-2018/include   -I/apps/libraries/geos/3.7.0/el7/AVX512/intel-2018/include -DPOSTGIS_GEOS_VERSION=35 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H
configure: Package LIBS:  -L/apps/libraries/proj/4.9.3/el7/AVX512/intel-2018/lib -lproj    -lgeos_c

But the final compilation step gives:

ld: cannot find -lgeos_c

Manually editing the second line of src/Makevars to include the -L/apps/libraries/geos/3.7.0/el7/AVX512/intel-2018/lib that configure already detected that it needs allows the library to link and install correctly.

I'm not good at autoconf, so I can't tell whether this is configure using some C++/linker flags that are not then used by R CMD INSTALL, or whether it's a logic bug in configure.ac where a variable is forgotten to be set.

Package can be installed but not loaded

Hello, and thank you for your packages.
I'm tried unsuccessfully to install lwgeom on centos 7
It fails just at final check.

** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for ‘lwgeom’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/usr/lib64/R/library/00LOCK-lwgeom/00new/lwgeom/libs/lwgeom.so':
/usr/lib64/R/library/00LOCK-lwgeom/00new/lwgeom/libs/lwgeom.so: undefined symbol: GEOSClipByRect
Errore: loading failed
Esecuzione interrotta
ERROR: loading failed

Here the overall output:

Installing package into ‘/usr/lib64/R/library’
(as ‘lib’ is unspecified)

  • installing source package ‘lwgeom’ ...
    ** using staged installation
    configure: CC: gcc -m64 -std=gnu99
    configure: CXX: g++ -m64 -std=gnu++11
    checking for gcc... gcc -m64 -std=gnu99
    checking whether the C compiler works... yes
    checking for C compiler default output file name... a.out
    checking for suffix of executables...
    checking whether we are cross compiling... no
    checking for suffix of object files... o
    checking whether we are using the GNU C compiler... yes
    checking whether gcc -m64 -std=gnu99 accepts -g... yes
    checking for gcc -m64 -std=gnu99 option to accept ISO C89... none needed
    checking how to run the C preprocessor... gcc -m64 -std=gnu99 -E
    checking for grep that handles long lines and -e... /usr/bin/grep
    checking for egrep... /usr/bin/grep -E
    checking for ANSI C header files... yes
    checking for sys/types.h... yes
    checking for sys/stat.h... yes
    checking for stdlib.h... yes
    checking for string.h... yes
    checking for memory.h... yes
    checking for strings.h... yes
    checking for inttypes.h... yes
    checking for stdint.h... yes
    checking for unistd.h... yes
    checking proj.h usability... no
    checking proj.h presence... no
    checking for proj.h... no
    checking for pj_init_plus in -lproj... yes
    checking PROJ: epsg found and readable... yes
    configure: POSTGIS_PROJ_VERSION: 48
    checking for geos-config... /usr/bin/geos-config
    checking geos-config usability... yes
    configure: GEOS: 3.4.2
    checking GEOS version >= 3.3.0... yes
    checking geos: linking with -L/usr/lib64 -lgeos_c... yes
    checking for GEOS_init_r in -lgeos_c... no
    configure: Package CPP flags: -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H
    configure: Package LIBS: -lproj -lproj -L/usr/lib64 -lgeos_c
    configure: creating ./config.status
    config.status: creating src/Makevars
    config.status: creating src/postgis_config.h
    ** libs
    g++ -m64 -std=gnu++11 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c geodetic.cpp -o geodetic.o
    g++ -m64 -std=gnu++11 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c lwgeom.cpp -o lwgeom.o
    g++ -m64 -std=gnu++11 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c RcppExports.cpp -o RcppExports.o
    g++ -m64 -std=gnu++11 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c proj.cpp -o proj.o
    g++ -m64 -std=gnu++11 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c geos.cpp -o geos.o
    g++ -m64 -std=gnu++11 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c io.cpp -o io.o
    g++ -m64 -std=gnu++11 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c sub.cpp -o sub.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/varint.c -o liblwgeom/varint.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/lwout_twkb.c -o liblwgeom/lwout_twkb.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/lwpsurface.c -o liblwgeom/lwpsurface.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/lwtriangle.c -o liblwgeom/lwtriangle.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/lwmpoly.c -o liblwgeom/lwmpoly.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/lookup3.c -o liblwgeom/lookup3.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/lwin_wkt.c -o liblwgeom/lwin_wkt.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/gserialized1.c -o liblwgeom/gserialized1.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/lwgeom.c -o liblwgeom/lwgeom.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/gserialized2.c -o liblwgeom/gserialized2.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/lwstroke.c -o liblwgeom/lwstroke.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/lwtin.c -o liblwgeom/lwtin.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/lwin_twkb.c -o liblwgeom/lwin_twkb.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/lwgeom_geos_cluster.c -o liblwgeom/lwgeom_geos_cluster.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/lwmsurface.c -o liblwgeom/lwmsurface.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/lwgeom_wrapx.c -o liblwgeom/lwgeom_wrapx.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/lwiterator.c -o liblwgeom/lwiterator.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/lwgeom_geos_node.c -o liblwgeom/lwgeom_geos_node.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/lwout_geojson.c -o liblwgeom/lwout_geojson.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/lwgeom_debug.c -o liblwgeom/lwgeom_debug.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/lwgeom_median.c -o liblwgeom/lwgeom_median.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/lwmval.c -o liblwgeom/lwmval.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/lwkmeans.c -o liblwgeom/lwkmeans.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/lwgeom_geos.c -o liblwgeom/lwgeom_geos.o
    liblwgeom/lwgeom_geos.c: In function ‘lwgeom_clip_by_rect’:
    liblwgeom/lwgeom_geos.c:954:2: warning: implicit declaration of function ‘GEOSClipByRect’ [-Wimplicit-function-declaration]
    if (!(g3 = GEOSClipByRect(g1, x1, y1, x2, y2)))
    ^
    liblwgeom/lwgeom_geos.c:954:11: warning: assignment makes pointer from integer without a cast [enabled by default]
    if (!(g3 = GEOSClipByRect(g1, x1, y1, x2, y2)))
    ^
    liblwgeom/lwgeom_geos.c: In function ‘lwgeom_voronoi_diagram’:
    liblwgeom/lwgeom_geos.c:1926:2: warning: implicit declaration of function ‘GEOSVoronoiDiagram’ [-Wimplicit-function-declaration]
    geos_result = GEOSVoronoiDiagram(geos_geom, geos_env, tolerance, output_edges);
    ^
    liblwgeom/lwgeom_geos.c:1926:14: warning: assignment makes pointer from integer without a cast [enabled by default]
    geos_result = GEOSVoronoiDiagram(geos_geom, geos_env, tolerance, output_edges);
    ^
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/lwout_kml.c -o liblwgeom/lwout_kml.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/lwutil.c -o liblwgeom/lwutil.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/lwprint.c -o liblwgeom/lwprint.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/lwrandom.c -o liblwgeom/lwrandom.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/lwmline.c -o liblwgeom/lwmline.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/lwgeodetic_tree.c -o liblwgeom/lwgeodetic_tree.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/lwline.c -o liblwgeom/lwline.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/bytebuffer.c -o liblwgeom/bytebuffer.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/lwgeodetic.c -o liblwgeom/lwgeodetic.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/measures.c -o liblwgeom/measures.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/lwgeom_api.c -o liblwgeom/lwgeom_api.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/lwmcurve.c -o liblwgeom/lwmcurve.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/lwcollection.c -o liblwgeom/lwcollection.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/gbox.c -o liblwgeom/gbox.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/lwspheroid.c -o liblwgeom/lwspheroid.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/lwout_svg.c -o liblwgeom/lwout_svg.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/lwin_encoded_polyline.c -o liblwgeom/lwin_encoded_polyline.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/lwout_encoded_polyline.c -o liblwgeom/lwout_encoded_polyline.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/lwgeom_geos_split.c -o liblwgeom/lwgeom_geos_split.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/effectivearea.c -o liblwgeom/effectivearea.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/lwboundingcircle.c -o liblwgeom/lwboundingcircle.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/lwcurvepoly.c -o liblwgeom/lwcurvepoly.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/lwlinearreferencing.c -o liblwgeom/lwlinearreferencing.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/lwunionfind.c -o liblwgeom/lwunionfind.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/lwchaikins.c -o liblwgeom/lwchaikins.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/lwalgorithm.c -o liblwgeom/lwalgorithm.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/lwhomogenize.c -o liblwgeom/lwhomogenize.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/lwgeom_geos_clean.c -o liblwgeom/lwgeom_geos_clean.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/measures3d.c -o liblwgeom/measures3d.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/lwout_x3d.c -o liblwgeom/lwout_x3d.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/lwgeom_transform.c -o liblwgeom/lwgeom_transform.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/lwin_wkt_lex.c -o liblwgeom/lwin_wkt_lex.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/lwmpoint.c -o liblwgeom/lwmpoint.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/stringbuffer.c -o liblwgeom/stringbuffer.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/lwcompound.c -o liblwgeom/lwcompound.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/gserialized.c -o liblwgeom/gserialized.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/lwout_wkt.c -o liblwgeom/lwout_wkt.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/lwin_wkb.c -o liblwgeom/lwin_wkb.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/ptarray.c -o liblwgeom/ptarray.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/lwout_wkb.c -o liblwgeom/lwout_wkb.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/lwpoly.c -o liblwgeom/lwpoly.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/lwpoint.c -o liblwgeom/lwpoint.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/lwout_gml.c -o liblwgeom/lwout_gml.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/lwgeom_topo.c -o liblwgeom/lwgeom_topo.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/lwcircstring.c -o liblwgeom/lwcircstring.o
    gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/include -DPOSTGIS_GEOS_VERSION=34 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/sf/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c liblwgeom/lwin_wkt_parse.c -o liblwgeom/lwin_wkt_parse.o
    g++ -m64 -std=gnu++11 -shared -L/usr/lib64/R/lib -Wl,-z,relro -o lwgeom.so geodetic.o lwgeom.o RcppExports.o proj.o geos.o io.o sub.o liblwgeom/varint.o liblwgeom/lwout_twkb.o liblwgeom/lwpsurface.o liblwgeom/lwtriangle.o liblwgeom/lwmpoly.o liblwgeom/lookup3.o liblwgeom/lwin_wkt.o liblwgeom/gserialized1.o liblwgeom/lwgeom.o liblwgeom/gserialized2.o liblwgeom/lwstroke.o liblwgeom/lwtin.o liblwgeom/lwin_twkb.o liblwgeom/lwgeom_geos_cluster.o liblwgeom/lwmsurface.o liblwgeom/lwgeom_wrapx.o liblwgeom/lwiterator.o liblwgeom/lwgeom_geos_node.o liblwgeom/lwout_geojson.o liblwgeom/lwgeom_debug.o liblwgeom/lwgeom_median.o liblwgeom/lwmval.o liblwgeom/lwkmeans.o liblwgeom/lwgeom_geos.o liblwgeom/lwout_kml.o liblwgeom/lwutil.o liblwgeom/lwprint.o liblwgeom/lwrandom.o liblwgeom/lwmline.o liblwgeom/lwgeodetic_tree.o liblwgeom/lwline.o liblwgeom/bytebuffer.o liblwgeom/lwgeodetic.o liblwgeom/measures.o liblwgeom/lwgeom_api.o liblwgeom/lwmcurve.o liblwgeom/lwcollection.o liblwgeom/gbox.o liblwgeom/lwspheroid.o liblwgeom/lwout_svg.o liblwgeom/lwin_encoded_polyline.o liblwgeom/lwout_encoded_polyline.o liblwgeom/lwgeom_geos_split.o liblwgeom/effectivearea.o liblwgeom/lwboundingcircle.o liblwgeom/lwcurvepoly.o liblwgeom/lwlinearreferencing.o liblwgeom/lwunionfind.o liblwgeom/lwchaikins.o liblwgeom/lwalgorithm.o liblwgeom/lwhomogenize.o liblwgeom/lwgeom_geos_clean.o liblwgeom/measures3d.o liblwgeom/lwout_x3d.o liblwgeom/lwgeom_transform.o liblwgeom/lwin_wkt_lex.o liblwgeom/lwmpoint.o liblwgeom/stringbuffer.o liblwgeom/lwcompound.o liblwgeom/gserialized.o liblwgeom/lwout_wkt.o liblwgeom/lwin_wkb.o liblwgeom/ptarray.o liblwgeom/lwout_wkb.o liblwgeom/lwpoly.o liblwgeom/lwpoint.o liblwgeom/lwout_gml.o liblwgeom/lwgeom_topo.o liblwgeom/lwcircstring.o liblwgeom/lwin_wkt_parse.o -lproj -lproj -L/usr/lib64 -lgeos_c -lproj -L/usr/lib64 -lgeos_c -L/usr/lib64/R/lib -lR
    installing to /usr/lib64/R/library/00LOCK-lwgeom/00new/lwgeom/libs
    ** R
    ** inst
    ** byte-compile and prepare package for lazy loading
    ** help
    *** installing help indices
    converting help for package ‘lwgeom’
    finding HTML links ... fatto
    bounding_circle html
    geod html
    Rd warning: /tmp/RtmpZrDOIs/R.INSTALL3cf65815a17/lwgeom/man/geod.Rd:45: file link ‘st_distance’ in package ‘sf’ does not exist and so has been treated as a topic
    lwgeom_extSoftVersion html
    lwgeom_make_valid html
    perimeter html
    st_as_sfc.TWKB html
    st_astext html
    st_force_polygon_cw html
    st_geod_azimuth html
    st_geohash html
    st_is_polygon_cw html
    st_linesubstring html
    st_snap_to_grid html
    st_split html
    Rd warning: /tmp/RtmpZrDOIs/R.INSTALL3cf65815a17/lwgeom/man/st_split.Rd:12: file link ‘st_combine’ in package ‘sf’ does not exist and so has been treated as a topic
    st_startpoint html
    st_subdivide html
    st_transform_proj html
    ** building package indices
    ** testing if installed package can be loaded from temporary location
    Error: package or namespace load failed for ‘lwgeom’ in dyn.load(file, DLLpath = DLLpath, ...):
    unable to load shared object '/usr/lib64/R/library/00LOCK-lwgeom/00new/lwgeom/libs/lwgeom.so':
    /usr/lib64/R/library/00LOCK-lwgeom/00new/lwgeom/libs/lwgeom.so: undefined symbol: GEOSClipByRect
    Errore: loading failed
    Esecuzione interrotta
    ERROR: loading failed
  • removing ‘/usr/lib64/R/library/lwgeom’
    Errore: Failed to install 'lwgeom' from GitHub:
    (contertito da avviso) installation of package ‘/tmp/RtmpPzlEnB/file2197405a122d/lwgeom_0.2-4.tar.gz’ had non-zero exit status

PROJ-related installation problem

Installing lwgeom gives me:

> install.packages('lwgeom')
trying URL 'https://cloud.r-project.org/src/contrib/lwgeom_0.2-3.tar.gz'
Content type 'application/x-gzip' length 500834 bytes (489 KB)
==================================================
downloaded 489 KB

* installing *source* package ‘lwgeom’ ...
** package ‘lwgeom’ successfully unpacked and MD5 sums checked
** using staged installation
configure: CC: gcc -std=gnu99
configure: CXX: g++ -std=gnu++11
configure: pkg-config proj exists, will use it
checking proj_api.h usability... no
checking proj_api.h presence... no
checking for proj_api.h... no
configure: error: proj_api.h not found in standard or given locations.
ERROR: configuration failed for package ‘lwgeom’
* removing ‘/home/mbojan/R/library/3.6/lwgeom’
* restoring previous ‘/home/mbojan/R/library/3.6/lwgeom’

The downloaded source packages are in
	‘/tmp/RtmpCymSOj/downloaded_packages’
Warning message:
In install.packages("lwgeom") :
  installation of package ‘lwgeom’ had non-zero exit status

$ apt-cache policy libproj-dev
libproj-dev:
  Installed: 4.9.3-2
  Candidate: 4.9.3-2
  Version table:
 *** 4.9.3-2 500
        500 http://pl.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
        100 /var/lib/dpkg/status

And proj_api.h is there:

$ locate proj_api.h
/usr/include/proj_api.h
/usr/local/include/proj_api.h

I'm not sure where the problem is coming from?

Not compatible with sf package from conda defaults channel

I am using the following to build my env:

conda create --yes --channel defaults --channel conda-forge --prefix ./my_env r-base r-sf r-lwgeom

Since sf and r-base are available in the defaults channel, they will download from the main channel and lwgeom comes from conda-forge. When I open R and use library('lwgeom') I will get the following error:

Error: package or namespace load failed for ‘lwgeom’ in dyn.load(file, DLLpath = DLLpath, ...): unable to load shared object '/home/my_env/lib/R/library/lwgeom/libs/lwgeom.so': libproj.so.15: cannot open shared object file: No such file or directory

File libproj.so.13 is available in the above directory. I am using conda 4.5.12 on CentOS.

can't link {lwgeom} to PROJ 7.2.0 when installing from source

Hello,

I'm trying to do some spatial transformations directly using PROJ in the {stars} package which, as far as I understand, uses {lwgeom} under the hood for the st_transform_proj() function. I'm getting an error, and I suspect it has to do with the incorrect version of PROJ being used. Sure enough, when I load {lwgeom} directly, I get a warning that both the GEOS and PROJ versions differ between {sf} and {lwgeom}:

> library(lwgeom)
Linking to liblwgeom 3.0.0beta1 r16016, GEOS 3.7.2, PROJ 5.2.0
Warning messages:
1: In fun(libname, pkgname) :
  GEOS versions differ: lwgeom has 3.7.2 sf has 3.8.1
2: In fun(libname, pkgname) :
  PROJ versions differ: lwgeom has 5.2.0 sf has 7.2.0

I was trying to install {lwgeom} from source in order to link to the latest installed versions of PROJ and GEOS (which I installed using Homebrew). I get an error that "libproj is not found in the standard location":

> install.packages("lwgeom", type = "source")
trying URL 'https://cran.rstudio.com/src/contrib/lwgeom_0.2-5.tar.gz'
Content type 'application/x-gzip' length 501653 bytes (489 KB)
==================================================
downloaded 489 KB

* installing *source* package ‘lwgeom’ ...
** package ‘lwgeom’ successfully unpacked and MD5 sums checked
** using staged installation
configure: CC: clang
configure: CXX: clang++ -std=gnu++11
configure: pkg-config proj exists, will use it
configure: using proj.h.
configure: PROJ: 7.2.0
checking PROJ: checking whether PROJ and sqlite3 are available for linking:... no
configure: error: libproj not found in standard or given locations.

However, when I install {sf} from source in order to link to the latest versions of GDAL, PROJ, and GEOS, I am able to do so successfully and make it past the same check in the install process that caused a problem when installing {lwgeom}.

Here's the output when (successfully) installing {sf} from source:

> install.packages("sf", type = "source")
trying URL 'https://cran.rstudio.com/src/contrib/sf_0.9-6.tar.gz'
Content type 'application/x-gzip' length 4160758 bytes (4.0 MB)
==================================================
downloaded 4.0 MB

* installing *source* package ‘sf’ ...
** package ‘sf’ successfully unpacked and MD5 sums checked
** using staged installation
configure: CC: clang
configure: CXX: clang++ -std=gnu++11
checking for gdal-config... /usr/local/bin/gdal-config
checking gdal-config usability... yes
configure: GDAL: 3.2.0
checking GDAL version >= 2.0.1... yes
checking for gcc... clang
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether clang accepts -g... yes
checking for clang option to accept ISO C89... none needed
checking how to run the C preprocessor... clang -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking gdal.h usability... yes
checking gdal.h presence... yes
checking for gdal.h... yes
checking GDAL: linking with --libs only... yes
checking GDAL: /usr/local/Cellar/gdal/3.2.0/share/gdal/pcs.csv readable... no
checking GDAL: checking whether PROJ is available for linking:... yes
checking GDAL: checking whether PROJ is available fur running:... yes
configure: GDAL: 3.2.0
configure: pkg-config proj exists, will use it
configure: using proj.h.
configure: PROJ: 7.2.0
checking PROJ: checking whether PROJ and sqlite3 are available for linking:... yes
checking for geos-config... /usr/local/bin/geos-config

Here is my sessionInfo():

> sessionInfo()
R version 3.6.3 (2020-02-29)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Catalina 10.15.7

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] compiler_3.6.3 tools_3.6.3   

Any thoughts as to why {sf} would install properly from source, but not {lwgeom}?

proj_api.h not found in standard or given locations error DESPITE SPECIFYING PROJ INCLUDE

cd ${install_directory}
mkdir lwgeom
cd lwgeom
wget https://cran.r-project.org/src/contrib/lwgeom_0.1-4.tar.gz
R CMD INSTALL --configure-args="--with-proj-include=${install_directory}/proj/include --with-proj-lib=${install_directory}/proj/lib" lwgeom_0.1-4.tar.gz

ends up with the error:

checking for proj_api.h... no
configure: error: proj_api.h not found in standard or given locations.
ERROR: configuration failed for package ‘lwgeom’

DESPITE:

ls ${install_directory}/proj/include
geodesic.h  org_proj4_PJ.h  proj_api.h  projects.h  proj.h

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.