AtlasOfLivingAustralia / ALA4R

Access data and resources hosted by the Atlas of Living Australia (ALA)
https://atlasoflivingaustralia.github.io/ALA4R/
42 stars 8 forks source link

To what does the geodeticDatum (occurrences) field relate? #7

Closed johnbaums closed 9 years ago

johnbaums commented 9 years ago

Consider x <- occurrences('Diplolaena grandiflora', fq='geospatial_kosher:true', download_reason_id=10).

Is x$data$geodeticDatum the datum associated with x$data$latitude and x$data$longitude, or have the coordinates given in those fields already been transformed to WGS84 (or GDA94? - though they are basically identical AFAIK)?

If they have been transformed, then:

  1. perhaps the name "geodeticDatumOriginal" might be more appropriate; and
  2. What does this mean for the following row:

    subset(x$data, id=='5400e754-d39c-4814-82ca-2f29b40fb3e2', 
          c('id', 'geodeticDatum', 'latitude', 'longitude', 
            'geodeticDatumAssumedWgs84', 'unrecognizedGeodeticDatum'))
    
    #                                       id geodeticDatum latitude longitude geodeticDatumAssumedWgs84 unrecognizedGeodeticDatum
    #139 5400e754-d39c-4814-82ca-2f29b40fb3e2      113.5681 -25.9764  113.5681                     FALSE                      TRUE

    If the datum is unrecognised, and it's not assumed to be WGS84, what datum is assumed? In this case latitudeOriginal and longitudeOriginal match latitude and longitude, so it seems no transformation has taken place. Note also that the original occurrences() query requested geospatial_kosher records only - should records such as 5400e754-d39c-4814-82ca-2f29b40fb3e2 be omitted?

raymondben commented 9 years ago

This relates to the underlying ALA service that delivers the data - ALA4R just wraps that service. I've asked the ALA devs for comment, will report here.

WCSPNG commented 9 years ago

Nice package. Over the last 24 hours the occurrences function is producing errors that I haven't seen previously. Any ideas? e.g.

x=occurrences(taxon="penguins", download_reason_id=10) Error in read.table(unz(thisfile, filename = "data.csv"), header = TRUE, : no lines available in input

raymondben commented 9 years ago

@WCSPNG - I created a new issue for your comment, see https://github.com/AtlasOfLivingAustralia/ALA4R/issues/8

raymondben commented 9 years ago

Back to the geodeticDatum question. From the ALA devs:

"Generally it appears to operate like this:

  1. if datum is not supplied then set assertion geodeticDatumAssumedWgs84 and use raw lat lon and wgs84 as the processed location
  2. else if datum is not recognised then set assertion unrecognizedGeodeticDatum and use raw lat lon and raw datum as the processed location
  3. else if lat lon transformation to wgs84 is not successful then set assertion decimalLatLongConversionFailed and use transformed lat lon and wgs84 as the processed location

Your example http://biocache.ala.org.au/ws/occurrence/5400e754-d39c-4814-82ca-2f29b40fb3e2 is (2). The processed location is using the unrecognised datum.

If supplying a valid raw datum the raw location and processed location datums do vary http://sandbox.ala.org.au/ws/occurrences/8580591d-80ba-44c9-9572-96a3d292581e"

I'll close the issue here. If more info is needed, suggest raising an issue on the repo that provides the underlying service: https://github.com/AtlasOfLivingAustralia/biocache-service

WCSPNG commented 9 years ago

Thank very much Ben.

The occurrence function started functioning normally again about 24 hours after I posted on GitHub. I now suspect that a rogue .Rprofile file might have been interferring with the downloads (oddly "search _fulltext" was working but not "occurrences") . Apologies for bothering you.

Wonderful package - so useful. I've stuck a RMarkdown doc on Rpubs to showcase the package at a very basic level.

Cheers, Nathan

On 23/04/2015 5:00 PM, Ben Raymond wrote:

@WCSPNG https://github.com/WCSPNG - I created a new issue for your comment, see #8 https://github.com/AtlasOfLivingAustralia/ALA4R/issues/8

— Reply to this email directly or view it on GitHub https://github.com/AtlasOfLivingAustralia/ALA4R/issues/7#issuecomment-95466124.

Click here https://www.mailcontrol.com/sr/Ozia0S6fQBbGX2PQPOmvUqW%21RI4xIDLrMVeu4IDYsR+gN%21lnmeTw7l1a4vbsEpc5MBnckTdHjFJsVqdfswMBgw== to report this email as spam.

Scientific Support Officer WCS Papua New Guinea PO Box 277, Goroka, Eastern Highlands Province, Papua New Guinea PNG Phone: (+675) 532-3494 Fax: (+675) 532-3180

/Our vision for PNG: Gutpela sindaun, gutpela solwara, gutpela bus. Empowered communities with healthy forests and seas./


This email has been checked for viruses by Avast antivirus software. http://www.avast.com