Messages or warnings printed to console also get logged and clutter the log if not useful.
This is OK:
library(EJAM)
shapefile_from_any(testshapes_2)
Launch app like this, for example:
library(EJAM)
ejamapp(shp=testdata("portland_shp.zip",quiet=T), default_testing=T)
or like this:
library(EJAM)
ejamapp(shp= testshapes_2, default_testing=T)
As it starts to read the file or object, it immediately shows this error and warning in rstudio console/logs (not in app UI):
Error in UseMethod("st_geometry") :
no applicable method for 'st_geometry' applied to an object of class "c('SpatialPolygonsDataFrame', 'SpatialPolygons', 'Spatial')"
Warning: sf layer has inconsistent datum (+proj=longlat +datum=NAD83 +no_defs).
Need '+proj=longlat +datum=WGS84'
Seems like the error could happen only within server's reactive called orig_leaf_map reactive or within reactive called data_up_shp. BUT, the problem is not obvious in either one. Unclear where it happens.
The error happens when sf::st_geometry() is called, but that function is called indirectly many times through other sf functions, so it is hard to pin down where the problem happens... sf::st_is_empty and sf::st_geometry_type both use st_geometry. The server uses st_geometry_type() directly, and sf::st_geometry() also happens directly -- and indirectly via sf::st_is_empty() -- within shapefix() which is called by shapefile_from_any() which is called by server's reactive called data_up_shp.
Messages or warnings printed to console also get logged and clutter the log if not useful.
This is OK:
library(EJAM)
shapefile_from_any(testshapes_2)
Launch app like this, for example:
or like this:
As it starts to read the file or object, it immediately shows this error and warning in rstudio console/logs (not in app UI):
Seems like the error could happen only within server's reactive called
orig_leaf_mapreactive or within reactive calleddata_up_shp. BUT, the problem is not obvious in either one. Unclear where it happens.The error happens when
sf::st_geometry()is called, but that function is called indirectly many times through other sf functions, so it is hard to pin down where the problem happens...sf::st_is_emptyandsf::st_geometry_typeboth usest_geometry. The server usesst_geometry_type()directly, andsf::st_geometry()also happens directly -- and indirectly via sf::st_is_empty() -- withinshapefix()which is called byshapefile_from_any()which is called by server's reactive calleddata_up_shp.