Code Monkey home page Code Monkey logo

rls-data's People

Contributors

dependabot[bot] avatar yanirs avatar

Watchers

 avatar  avatar

rls-data's Issues

Download & parse survey data from the new server

Useful snippet:

# TODO: new links:
# - "https://geoserver-portal.aodn.org.au/geoserver/ows?typeName=imos:ep_m2_inverts_public_data&SERVICE=WFS&outputFormat=csv&REQUEST=GetFeature&VERSION=1.0.0"
# - "https://geoserver-portal.aodn.org.au/geoserver/ows?typeName=imos:ep_m0_off_transect_sighting_public_data&SERVICE=WFS&outputFormat=csv&REQUEST=GetFeature&VERSION=1.0.0"
# - "https://geoserver-portal.aodn.org.au/geoserver/ows?typeName=imos:ep_m2_cryptic_fish_public_data&SERVICE=WFS&outputFormat=csv&REQUEST=GetFeature&VERSION=1.0.0"
# - "https://geoserver-portal.aodn.org.au/geoserver/ows?typeName=imos:ep_m1_public_data&SERVICE=WFS&outputFormat=csv&REQUEST=GetFeature&VERSION=1.0.0"
# TODO: survey_list and site_list needed?
# TODO: limit to only the RLS program? `&CQL_FILTER=(program%20LIKE%20'RLS')`
# TODO: parse the new files
for data_type in ('m0_off_transect_sighting', 'm1', 'm2_cryptic_fish', 'm2_inverts'):
    url = ('https://geoserver-portal.aodn.org.au/geoserver/ows?SERVICE=WFS&outputFormat=csv&REQUEST=GetFeature&'
           f'VERSION=1.0.0&typeName=imos:ep_{data_type}_public_data')
    out_path = survey_data_dir / f"{data_type.lower()}.csv"
    _logger.info(f'Downloading {url} to {out_path}')
    with open(out_path, 'w') as fp:
        fp.write(requests.get(url).text)
  • Also update expectations based on new server files

Consider downloading & parsing M0 data

It's possible to also download m0_off_transect_sighting as a data type here:

for data_type in ("m1", "m2_cryptic_fish", "m2_inverts")

This would require parsing an additional file and inferring the correct method. It might not be worth it as it's only 5M of additional data.

Get survey methods from species.json

Having multiple sources of truth for survey methods is brittle. It'd probably be better to drop the static mappings from this repo in favour of getting the methods from species.json, or to completely retire the legacy api-*.json files.

Consider padding create_static_maps extents

In some cases, the generated map doesn't look good since there's a single site right on the edge of the map. Such cases may be addressed by reducing the checked area when checking if all the sites fit or by adding padding in addition to the hardcoded extents (e.g., a couple of degrees in each direction, or something like 2% to 5% to maintain a constant aspect ratio).

Stop committing minified JSONs

Minification can be done when the JSONs are fetched ahead of serving. We get nicer diffs and simpler code without the minification.

Move away from scraping species data

  • Species can be obtained from the new API
  • It'd probably be a good idea to remove unlisted species from the survey JSON
  • Scraping can be done separately to check the site (might be unnecessary)

Decide whether to include non-RLS data

For data backward compatibility, AODN downloading is limited only to RLS surveys:

f"VERSION=1.0.0&CQL_FILTER=(program%20LIKE%20'RLS')&typeName=imos:ep_{data_type}_public_data",

It's possible to remove the CQL_FILTER condition, which would increase the overall download size by over 100M.

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.