rgzn / beastr Goto Github PK
View Code? Open in Web Editor NEWAnimal Telemetry Data Management
Home Page: https://rgzn.github.io/beastr/
License: GNU Affero General Public License v3.0
Animal Telemetry Data Management
Home Page: https://rgzn.github.io/beastr/
License: GNU Affero General Public License v3.0
On writing to geopackage sqlite, the timezone from the R datetime object is erased. When read back into R, the time
field no longer has a zone.
Currently have to handle this manually. Avoid confusion by always writing UTC times. In visualization we can convert back to local times.
Not yet handling collar events/mortalities.
Using append_layer()
or append_database()
uses sf::st_write()
to modify an existing database. This is convenient because it handles all the necessary spatial columns, and modifies a geopackage's metadata to include new spatial data.
However, using st_write
with geopackages in Shiny is difficult. A geopackage is an sqlite database, but the st_write
interface to them treats them as a normal file. File I/O in Shiny is designed to isolate the side effects on a local computer, so it reads the entire file into a temporary directory, then you are just modifying Shiny's copy.
There are two potential workarounds:
download
button for the user to write over their local copy of the geopackage.DBI::dbConnect()
. This will allow for the Shiny app to interface with the data through a database connection instead of copying the file.The latter is the proper approach. Besides being a cleaner interface, it starts down the road of extending these functions to other databases besides geopackage. But it will require some more work:
pool
library to avoid complications with repeatedly connecting/disconnecting.append_layer()
, perhaps a use_dbi = TRUE
parameter.build_database()
because it was necessary for creating the View that ties fixes to animals. This process should be separated into its own function for re-use in append_layer()
if using geopackages.Using sf::st_write()
to create tables in the geopackage doesn't support speciging UNIQUE
constraints on tables (I think?). And SQLite3 doesn't support adding them to existing tables.
Possible workarounds:
After creating tables but before creating View in build_database()
, create the constraints via copying the tables and creating new ones as in this example: https://stackoverflow.com/questions/42969127/add-constraint-to-existing-sqlite-table
Do everything in R. This is what I'm doing currently. This is not ideal, as the constraints only come from the R code within this package and any external modification could corrupt data
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.