Giter Site home page Giter Site logo

antweb's People

Contributors

bitdeli-chef avatar chrismuir avatar diana-ly avatar emhart avatar jeroen avatar karthik avatar maelle avatar sckott avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

antweb's Issues

New updates from the API

Subfamily
Genus
Species
Type (e.g. holotype)
Habitat This uses a wildcard so a query for ?habitat=sand will return any habitat containing the word sand (e.g. sandstone)
Bbox This is a bounded box of decimal coordinates in the format ?bbox=x1,y1,x2,y2
Date Query on a single date (?date=yyyy-mm-dd), or a date boundary (?date=yyyy-mm-dd,yyyy-mm-dd)
Elevation This is measured in meters. Query on a specific elevation (?elevation=1200), or a boundary (?elevation=1200,2000)
Georeferenced This is a boolean argument to filter for only geo referenced specimen (?georeferenced=true)
Limit Limit the number of specimen returned on large requests (?limit=100)
Offset Used to paginate large requests when paired with the limit argument (this would return records 300-400: ?limit=100&offset=300)

**aw_map** error and failure to plot

Hello, first before I start complaining, thanks for producing this package!

aw_data works fine, but I've encountered an error using the mapping function aw_map, here's the code (it's just your example from the front-page), the execution and error/warning messages and my system info:

Example

adf <- aw_data(genus = "acanthognathus", georeferenced = TRUE)
aw_map(adf)

Execution and Error

adf <- aw_data(genus = "acanthognathus", georeferenced = TRUE)
No encoding supplied: defaulting to UTF-8.
No encoding supplied: defaulting to UTF-8.
475 results available for query.
!> aw_map(adf)

File saved under /var/folders/7x/4c5fkmrx5r54d6sgzglyffth0000gn/T//RtmpbSQcKP/temp.geojson
Error in if (is.na(s$col)) single.style <- append(single.style, ""stroke": false") else single.style <- append(single.style, :
argument is of length zero
In addition: Warning message:
In is.na(s$col) : is.na() applied to non-(list or vector) of type 'NULL'

System Info

"platform" "x86_64-apple-darwin13.4.0"
"arch" "x86_64"
"os" "darwin13.4.0"
"system" "x86_64, darwin13.4.0"
"status" ""
"major" "3"
"minor" "3.3"
"year" "2017"
"month" "03"
"day" "06"
"svn rev" "72310"
"language" "R"
"version.string" "R version 3.3.3 (2017-03-06)"
"nickname" "Another Canoe"

AntWeb basic error, how to solve it???

I am new in this world, and i have a problem starting AntWeb searchs...any solutions?
was_df <- aw_data(genus = "wasmannia")
Error in function (type, msg, asError = TRUE) :
Failure when receiving data from the peer

Sometimes it looks for 'acd'

For example with this code (the original error is in spanish but its only 'acd' not found), it happens too with other genera (cataglyphis, polyergus...):

anochetus_df <- aw_data(genus="anochetus")
aw_map(anochetus_df)
Error en which(names(acd) == "decimal_latitude") :
objeto 'acd' no encontrado

At a first glance I see the call of acd, but I can't see where is created in the function.

Here is my sessionInfo, just in case:
R version 3.0.2 (2013-09-25)
Platform: x86_64-pc-linux-gnu (64-bit)

locale:
[1] LC_CTYPE=es_ES.UTF-8 LC_NUMERIC=C
[3] LC_TIME=es_ES.UTF-8 LC_COLLATE=C
[5] LC_MONETARY=es_ES.UTF-8 LC_MESSAGES=es_ES.UTF-8
[7] LC_PAPER=es_ES.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=es_ES.UTF-8 LC_IDENTIFICATION=C

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

other attached packages:
[1] AntWeb_0.5.3

loaded via a namespace (and not attached):
[1] RCurl_1.95-4.1 assertthat_0.1 digest_0.6.4 httr_0.2 leafletR_0.1-1
[6] plyr_1.8 rjson_0.2.13 stringr_0.6.2 tools_3.0.2

General todos

First draft of package is in place. Some obvious todos:

  • Streamline the image metadata โ†’ data.frame in the aw_data call. It's a bit clunky at the moment.
  • Coerce dates correctly into a R data.format.
  • Expand test coverage

Issues with v2

Plenty of issues with v2

  • Data structures have changed.
  • Need to update error handling
  • Need to coerce columns into right fomat
  • Maps are broken because the format (and column names) have now changed. Fun!

Bug from disqus on the antweb post

Thanks! really thanks, as I work primarily in this group of insects I was suffering the lack of information over gbif, I was hoping an interface like this a lot of time, thanks for posting this!. I've just installed this but I can't find the Author in the docs.

I found a problem in this example:
acd <- aw_data(genus = "acanthognathus")
aw_map(acd)

Error en eval(expr, envir, enclos) :
objeto 'meta.decimal_latitude' no encontrado

Thats using stable version from CRAN, the package from the master branch just works.

List of improvements for the AntWeb API

Hi @jaymollica here are a few suggestions

  1. Allow for bounding box rather than a coordinate and radius search (or perhaps add both). This would be consistent with the other APIs that serve spatial data.
  2. Allow filtering by georeferenced data from the API. Right now I filter on the client side and this is not ideal.
  3. Content type should be application/json rather than text/html (thanks @sckott)
  4. Provide consistent error messages. Right now I have to catch "No records found." and "No records were found."
  5. Allow some way to paginate large requests. Would be great to have a limit and offset.
  6. Field names are not standardized across requests. Some return meta.decimal_latitude and others decimal_latitude.
  7. I don't see the point of the images method. What is the use case for someone to request images by days elapsed? Can I pass taxonomic levels here too?
  8. It would be great to expose other fields as well. For e.g. I would love to search by elevation limits, habitat, tribes, and also throw date bounds around searches.
    That's it so far. I'll add more here as I think of them.

*aw_data* error

Greetings

I've been trying to retrieve AntWeb data using aw_data, but keep getting a fromJSON and an HTTP 404 error:

Example

data <- aw_data(genus = 'Strumigenys', species = 'cultrigera')

Execution and error

data <- aw_data(genus = 'Strumigenys', species = 'cultrigera')`
Error in fromJSON(content(results, "text")) : unexpected character '<'
In addition: Warning message:
In aw_data(genus = "Strumigenys", species = "cultrigera") :
Not Found (HTTP 404).

I believe that the function is trying to use the base_url of a deprecated API version to query data.

System Info

$ platform "x86_64-w64-mingw32"
$ arch "x86_64"
$ os "mingw32"
$ system "x86_64, mingw32"
$ status ""
$ major "3"
$ minor "6.0"
$ year "2019"
$ month "04"
$ day "26"
$ svn rev "76424"
$ language "R"
$ version.string"R version 3.6.0 (2019-04-26)"
$ nickname "Planting of a Tree"

Package Info

Package: AntWeb
Version: 0.7
Depends: R (>= 3.0.1)
Imports: rjson, plyr, assertthat, httr, leafletR (>= 0.1-1)
Built: R 3.6.0; ; 2019-06-02 00:44:19 UTC; windows

Retrieve all species with aw_data

Hi,

I have been using aw_distinct to retrieve the names of species in certain groups, but was noticing some discrepancies between taxa retrieved and what is listed on AntWeb. It seems as though taxa lacking specimens are not retrieved. Is it possible to also retrieve the names of species that lack specimens? For instance, a search for species in Dorylus:

require("AntWeb")
dorylus<-aw_data(genus="Dorylus")
sort(unique(dorylus$data$scientific_name))

This does not seem to retrieve Dorylus atratus or Dorylus bishyiganus, which seem to be included in Dorylus (as a valid taxon) in AntWeb and AntCat:
https://www.antweb.org/browse.do?subfamily=dorylinae&genus=dorylus&rank=genus&project=worldants
http://antcat.org/catalog/436753
http://antcat.org/catalog/436761

Thanks much for your help.

-Matt

get a 500 status code for some requests

E.g.,

~$ http http://www.antweb.org/api/?genus=crematogaster
HTTP/1.0 500 Internal Server Error
Connection: close
Content-Length: 0
Content-Type: text/html; charset=UTF-8
Date: Wed, 19 Feb 2014 20:33:06 GMT
Server: Apache/2.2.15 (CentOS)
X-Powered-By: PHP/5.3.3

http http://www.antweb.org/api/?genus=camponotus gives the same thing

Enhancements

Create a leaflet.js map similar to what we have in ecoengine. Once I can figure out how to format tooltips, we should be able to add thumbnail images in addition to a description.

One could also build a nice Shiny app to showcase nearly all of the functionality in the package.

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.