This repository has been archived and it is replaced by mregions2. For further details please see: Why mregions and mregions2?
The former README is now in README-NOT.md.
MarineRegions R client
Home Page: https://docs.ropensci.org/mregions
License: Other
This repository has been archived and it is replaced by mregions2. For further details please see: Why mregions and mregions2?
The former README is now in README-NOT.md.
Hi @sckott,
I've recently been working on getting the distribution from WoRMS (worrms::wm_distribution) which returns a marineregions id from which you can call the getGazetteerWMSes.json end point e.g. http://www.marineregions.org/rest/getGazetteerWMSes.json/1906/
Based on this WMS I've then managed to get geojson from the WFS. I still have some bugs but would like to integrate this in mregions. Code dump: https://github.com/iobis/mregions/blob/master/R/mr_gazetteer.R
Some questions:
Samuel
Consider using crul
instead of httr
, see question in #42
Is crul
still preferred over httr
or any other package that is recommended?
Hi,
The current license file seems to have been created automatically
https://github.com/ropensci/mregions/blob/ffffd9b6bf28e6f7d160ff55fd9d11f323e828d6/LICENSE
Shall we add a license that allows reuse? Not sure what's the preferred license for ropensci. I saw some packages are released under GNU.
I'm. getting this error message with the CRAN version of mregions. Is their a way to fix this?
Consider using sf
instead of sp
, see question in #42
in readme/vignette/pkg level man file
robis::occurrence expects geometry using only longitude/latitude, but as_wkt does not do anything different with a projected Spatial object.
@mdsumner can contribute this
I hate having to manually handle pagination with API wrappers, particularly when it's not obvious how many total records are available. Can we get an option to do this automatically (like in gh
package with limit=Inf
), pretty please? (e.g. for the mr_records_by_type
fn, not sure if applies elsewhere).
Right now we are using Travis-CI to check the package. But the last check was from 2 years ago:
https://travis-ci.org/github/ropensci/mregions/jobs/718785749
We should consider to improve this system: e.g. use GitHub Actions to run the R-CMD-Check with each commit.
To check what's the current policy of rOpenSci regarding automatic testing.
The documentation of the package could be a bit improved:
for downstream uses, e.g., in spocc
apparently that type is just not available anymore
I think that the mr_geo_code() function does not parse the url correctly when using special characters (e.g. spaces,..).
mr_geo_code('Belgian') # works
mr_geo_code('Belgian Exclusive') # Error in mr_geo_code("Belgian Exclusive") : Bad Request (HTTP 400).
mr_geo_code(URLencode('Belgian Exclusive')) # works
I didn't check (yet) if this is also the case for other functions
The shape file for MRGID 8384 "South African Exclusive Economic Zone (Prince Edward Islands)" seems to be empty. A manual download from http://marineregions.org/gazetteer.php?p=details&id=8384 appears fine.
library(mregions)
library(sp)
# Look up names in the EEZ data
rnames <- mr_names("MarineRegions:eez")
# Verify that the entry is among the names
# Prince Edward Islands
# http://marineregions.org/gazetteer.php?p=details&id=8384
rnames[rnames$mrgid == "8384", ]
# Get shape files
pei_eez <- mr_shp(key = "MarineRegions:eez",
filter = "8384")
# Plot
plot(pei_eez)
# Contents
str(pei_eez)
Hi @pieterprovoost,
Just ran one of the examples of the documentation and this doesn't work
library(mregions)
mr_obis_eez_id("bulgarian exclusive economic zone")
#> Error in curl::curl_fetch_memory(url, handle = handle): Could not resolve host: api.iobis.org
Created on 2022-03-03 by the reprex package (v2.0.0)
I tested both on windows and ubuntu, using the latest version of curl. Can you confirm if this is a problem of the OBIS API?
Thanks!
or other pkg on CRAN, robis is not on cran so not good fit for this
wonder why we are using WFS v1 (http://geo.vliz.be/geoserver/ows?service=wfs&version=1.0.0&request=GetCapabilities) instead of v2 (http://geo.vliz.be/geoserver/ows?service=wfs&version=2.0.0&request=GetCapabilities)
i'm not familiar enough with these
thoughts? @tomjwebb @mdsumner @pieterprovoost
those on the page at http://marineregions.org/downloads.php
@pieterprovoost @wardappeltans
Do you know if http://www.marineregions.org/sources.php#meow from Marineregions is in the Geoserver? I don't see it anywhere.
Add remaining gazetteer REST services? http://marineregions.org/gazetteer.php?p=webservices, see the question in #42.
Note that we are in the process of updating our web services so there will be new web services added (foreseen summer 2021).
@ahjones1 @remsamp @samuelbosch @pieterprovoost @tomjwebb
just pinging you for any feedback, open issues as needed for bugs, features, etc.
in docs
mr_features_get
uses WFS 2.0.0 which will, despite the GeoJSON spec, return coordinates as [y, x]:
Perhaps add an option to use WFS 1.0.0?
Code example:
require(mregions)
require(wellknown)
require(jsonlite)
n <- mr_names("MarineRegions:eez")
id <- mr_names_search(n, "Belgian")$id[1]
jsonstr <- mr_features_get("MarineRegions:eez", id, format = "json")
json <- fromJSON(jsonstr, simplifyVector = FALSE, simplifyDataFrame = FALSE)
wkt <- geojson2wkt(json$features[[1]]$geometry)
WFS calls:
since we keep onboarded repos there ๐บ
If you transfer it, could you please add an active status badge to the README when updating all links? ๐
[![Project Status: Active โ The project has reached a stable, usable state and is being actively developed.](http://www.repostatus.org/badges/latest/active.svg)](http://www.repostatus.org/#active)
We shall consider to switch to as_tibble()
library(mregions)
rnames <- mr_names("MarineRegions:iho")
#> Warning: `as_data_frame()` was deprecated in tibble 2.0.0.
#> Please use `as_tibble()` instead.
#> The signature and semantics have changed, see `?as_tibble`.
Created on 2022-03-03 by the reprex package (v2.0.0)
When I tried to get place relations by mr_place_relations()
, I found out that type = c("partof", "partlypartof", "adjacentto", "similarto", "administrativepartof", "influencedby", "all")
didn't work.
I get exactly the same results by mr_place_relations(307, type = "adjacentto")
and mr_place_relations(307)
even if the default value for type
should be "partof".
Hi Scott, I've been playing with the new CRAN version, very impressed but have one issue regarding the maxFeatures argument in mr_shp - I would like to download (for example) a shape file of all 100 or so IHO Sea Areas, but the import is limited to 50:
res4 <- mr_shp(key = "MarineRegions:iho")
length(res4$name)
gives 50. It looks like I should be able to change this by changing the maxFeatures argument but this doesn't seem to work - I still get 50 regions returned whether I set this argument to 10 or 100, e.g.
res4 <- mr_shp(key = "MarineRegions:iho", maxFeatures = 10))
length(res4$name)
also gives 50. Am I missing something obvious here? Would be really useful to be able to get the full set of shapes for a given geometry to allow e.g. summarising a species distribution, as records per IHO area, EEZ, or whatever.
Thanks!
add what they return and make sure param def's are accurate, add @details
for more details about each fxn
and make sure all examples work with new output
The following is occurring with mregions and leaflet:
Warning messages:
1: In polygonData.SpatialPolygonsDataFrame(data) :
Empty SpatialPolygonsDataFrame object passed and will be skipped
2: In polygonData.SpatialPolygonsDataFrame(data) :
Empty SpatialPolygonsDataFrame object passed and will be skipped
It then fails to plot two polygons Kiribati and Fiji but plots other polygons without trouble. Have tried it with base-R plot function and ggplot. The same error occurs.
R version 3.4.3 (2017-11-30)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
Matrix products: default
locale:
[1] LC_COLLATE=English_Australia.1252 LC_CTYPE=English_Australia.1252 LC_MONETARY=English_Australia.1252 LC_NUMERIC=C
[5] LC_TIME=English_Australia.1252
attached base packages:
[1] grid stats graphics grDevices utils datasets methods base
other attached packages:
[1] maps_3.2.0 plotrix_3.7 Grid2Polygons_0.2.1 spdep_0.7-4 spData_0.2.7.4 Matrix_1.2-12 gridExtra_2.3
[8] data.table_1.10.4-3 forcats_0.2.0 stringr_1.2.0 dplyr_0.7.4 purrr_0.2.4 readr_1.1.1 tidyr_0.7.2
[15] tibble_1.4.1 tidyverse_1.2.1 ggplot2_2.2.1 igraph_1.1.2 raster_2.6-7 rgeos_0.3-26 rgdal_1.2-16
[22] leaflet_1.1.0 mregions_0.1.6 BESTMPA_0.1.0 sp_1.2-7 RPostgreSQL_0.6-2 DBI_0.7
loaded via a namespace (and not attached):
[1] httr_1.3.1 jsonlite_1.5 splines_3.4.3 gtools_3.5.0 modelr_0.1.1 shiny_1.0.5 assertthat_0.2.0 expm_0.999-2 cellranger_1.1.0
[10] yaml_2.1.16 LearnBayes_2.15 pillar_1.1.0 lattice_0.20-35 glue_1.2.0 digest_0.6.14 rvest_0.3.2 colorspace_1.3-2 htmltools_0.3.6
[19] httpuv_1.3.5 plyr_1.8.4 psych_1.7.8 pkgconfig_2.0.1 broom_0.4.3 haven_1.1.1 gmodels_2.16.2 xtable_1.8-2 scales_0.5.0
[28] gdata_2.18.0 lazyeval_0.2.1 cli_1.0.0 mnormt_1.5-5 magrittr_1.5 crayon_1.3.4 readxl_1.0.0 mime_0.5 deldir_0.1-14
[37] nlme_3.1-131 MASS_7.3-47 xml2_1.1.1 foreign_0.8-69 tools_3.4.3 hms_0.4.0 munsell_0.4.3 bindrcpp_0.2 compiler_3.4.3
[46] rlang_0.1.6 rstudioapi_0.7 rappdirs_0.3.1 htmlwidgets_1.0 crosstalk_1.0.0 tcltk_3.4.3 boot_1.3-20 gtable_0.2.0 curl_3.1
[55] reshape2_1.4.3 R6_2.2.2 lubridate_1.7.1 bindr_0.1 stringi_1.1.6 parallel_3.4.3 Rcpp_0.12.15 coda_0.19-1
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.