Skip to content

Download with geometry parameter #81

@nmtarr

Description

@nmtarr

Hello,

I can't seem to figure out how to run occurrences.download() with a geometry parameter successfully. I've tried enough tweaks to get to the point of wondering if there's a bug. Anyone got any advice?

I'm using Python 3.7.10 and pygbif 0.5.0. Here is my code; it works without the geometry parameter:

------------------------------------------------

from pygbif import occurrences

username = 'xxxxxx'
password = 'xxxxxx'
email = 'xxxxxx'

download_filters = ["taxonKey = 2496287",
"geometry within 'POLYGON ((-82.7 36.9, -85.0 35.6, -81.0 33.5, -79.4 36.3, -79.4 36.3, -82.7 36.9))'"]

download = occurrences.download(download_filters,
pred_type='and',
user = username,
pwd = password,
email = email)
#-------------------------------------------------

And here is the error message:

Exception: error: JSON parse error: Cannot construct instance of org.gbif.api.model.occurrence.predicate.WithinPredicate, problem: may not be null; nested exception is com.fasterxml.jackson.databind.exc.ValueInstantiationException: Cannot construct instance of org.gbif.api.model.occurrence.predicate.WithinPredicate, problem: may not be null
at [Source: UNKNOWN; line: -1, column: -1] (through reference chain: org.gbif.api.model.occurrence.predicate.ConjunctionPredicate["predicates"]->java.util.ArrayList[1]), with error status code 400check your number of active downloads.

Regards,

Nathan

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions