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
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 oforg.gbif.api.model.occurrence.predicate.WithinPredicate, problem: may not be nullat [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