Accession API v1: Geo info
Add endpoint to AccessionController v1 API /acn/geo
as geoInfo(String filterCode, AccessionFilter filter)
that returns
{
"bounds": [
[-4.8587000, 39.8772333],
[-6.4917667, 39.0945000]
],
"accessionCount": 123123,
"tileServers": [ "cdn1.sandbox.genesys-pgr.org", "cdn2.sandbox.genesys-pgr.org" ]
}
Bounds
Add getBounds(AccessionFilter filter)
to AccessionServiceImpl.
See https://leafletjs.com/reference-1.3.4.html#latlngbounds
It should select min(latitude), max(longitude), max(latitude), min(longitude) from accession.accessionId.geo
and return:
[
[ min(latitude), max(longitude) ],
[ max(latitude), min(longitude) ]
]
Accession count
Add public long count(AccessionFilter filter)
to AccessionServiceImpl:
@Override
public Page<Accession> list(AccessionFilter filter) {
long total = elasticsearchService.count(Accession.class, filter);
if (total < 10000) {
// If total is below 10K, use actual count
total = accessionRepository.count(filter.buildQuery());
}
return total;
}
Tile servers
Tileservers info is the cdn.servers
setting from application.properties
and it's accessible at:
@Value("${cdn.servers}")
private String[] cdnServers;