Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

capabilities response look like it has wrong counts #84

Open
MortenHofft opened this issue Jan 12, 2024 · 5 comments
Open

capabilities response look like it has wrong counts #84

MortenHofft opened this issue Jan 12, 2024 · 5 comments
Assignees
Labels

Comments

@MortenHofft
Copy link
Member

This dataset https://www.gbif.org/dataset/3ad913f9-2f86-48c7-b570-3ec9f71acf88
has 1786 records all of which has coordinates without geospatial issues
https://api.gbif.org/v1/occurrence/search?dataset_key=3ad913f9-2f86-48c7-b570-3ec9f71acf88&has_coordinate=true&has_geospatial_issue=false

But the capabilities endpoint tell me there is 1 record in total.
https://api.gbif.org/v2/map/occurrence/density/capabilities.json?datasetKey=3ad913f9-2f86-48c7-b570-3ec9f71acf88

capabilities was last updpated an hour ago. the dataset was last crawled 2 days ago with state: NOT_MODIFIED

@ahakanzn
Copy link

It seems like there is something wrong with that dataset particularly. We should take a look at that.
https://www.gbif.org/dataset/3ad913f9-2f86-48c7-b570-3ec9f71acf88

@muttcg
Copy link
Member

muttcg commented Aug 21, 2024

I happens because all records have the same lat, lon and date. And It is 3 sequence reads:

SELECT decimallatitude, decimallongitude, eventdate, materialsampleid
FROM occurrence
WHERE datasetkey = '3ad913f9-2f86-48c7-b570-3ec9f71acf88'
GROUP BY decimallatitude, decimallongitude, eventdate, materialsampleid;
decimallatitude decimallongitude eventdate materialsampleid
37.566 126.9784 2018-05-31 https://www.ebi.ac.uk/metagenomics/samples/ERS2540919
37.566 126.9784 2018-05-31 https://www.ebi.ac.uk/metagenomics/samples/ERS2540920
37.566 126.9784 2018-05-31 https://www.ebi.ac.uk/metagenomics/samples/ERS2540921

@MortenHofft Do you expect to have capabilities.total == datset.size?

@MattBlissett
Copy link
Member

The total in the tile is incorrect, I think it should be 1786:

curl -Ss 'https://api.gbif.org/v2/map/occurrence/density/0/0/0.mvt?datasetKey=3ad913f9-2f86-48c7-b570-3ec9f71acf88' | vtd
layers {
  name: "occurrence"
  features {
    tags: 0
    tags: 0
    tags: 1
    tags: 1
    type: POINT
    geometry: 9
    geometry: 872
    geometry: 396
  }
  keys: "2018"
  keys: "total"
  values {
    sint_value: 1
  }
  values {
    sint_value: 1
  }
  extent: 512
  version: 1
}

So probably something is wrong with the map build.

@MortenHofft
Copy link
Member Author

capabilities.total == datset.size

No the total is the number of points on the map. So records with coordinates that will show. whatever that filter is. I believe it is records with has_geospatial_issue=false. Essentially it tells me if there is a point in showing the map or not.

@muttcg muttcg assigned muttcg and unassigned ahakanzn Aug 29, 2024
@muttcg
Copy link
Member

muttcg commented Aug 29, 2024

The new UAT seems correct, but I haven’t found any significant differences in the code yet
https://api.gbif-uat.org/v2/map/occurrence/density/capabilities.json?datasetKey=3ad913f9-2f86-48c7-b570-3ec9f71acf88

{
  "minLat": 37,
  "maxLat": 38,
  "minLng": 126,
  "maxLng": 127,
  "minYear": 2018,
  "maxYear": 2018,
  "total": 1786,
  "generated": "2024-08-28T03:00Z"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants