hypertidy / dsn

Data Source Name Helpers for Use With GDAL
https://hypertidy.github.io/dsn/
Other
6 stars 0 forks source link

dive into MapServer #4

Open mdsumner opened 1 year ago

mdsumner commented 1 year ago

for WMTS and WMS

u <- "https://services.thelist.tas.gov.au/arcgis/rest/services"
q <- sprintf("%s?f=pjson", u)

## get the services
folders <- jsonlite::fromJSON(readLines(q))$folders

qq <- sprintf("%s?f=pjson", file.path(u, folders))
services_list <- lapply(qq, function(.x) jsonlite::fromJSON(readLines(.x)))

services_df <- do.call(rbind, lapply(services_list, function(.x) .x$services)) %>% dplyr::filter(type == "MapServer")
services_df$wmts <- unlist(lapply(services_df$name, function(.x) any(grepl("WMTS", readLines(file.path(u, .x, "MapServer"))))))
services_df$wms <-  unlist(lapply(services_df$name, function(.x) any(grepl("WMS", readLines(file.path(u, .x, "MapServer"))))))

par(mfrow = n2mfrow(sum(services_df$wmts | services_df$wms)))
for (i in seq_along(services_df$wmts)) {
  if (services_df$wmts[i]) {
    dsn <- sprintf("WMTS:https://services.thelist.tas.gov.au/arcgis/rest/services/%s/MapServer/WMTS/1.0.0/WMTSCapabilities.xml", 
                   services_df$name[i])
    sds <- vapour::vapour_sds_names(dsn)
    #stop()
    #dsn <- "WMTS:https://services.thelist.tas.gov.au/arcgis/rest/services/Basemaps/AerialPhoto2020/MapServer/WMTS/1.0.0/WMTSCapabilities.xml"
    x <- try(im <- vapour::gdal_raster_image(sds[1], target_dim = c(3840 %/% sqrt(sum(services_df$wmts)), 0)))
    if (!inherits(x, "try-error")) {
      ximage::ximage(im)
      title(services_df$name[i])
  }
  } else {
    #stop()

#                        https://services.thelist.tas.gov.au/arcgis/services/AerialPhotoViewer/Aerial_Photo_Centres/MapServer/WMSServer?request=GetCapabilities&service=WMS
    dsn <- sprintf("WMS:https://services.thelist.tas.gov.au/arcgis/services/%s/MapServer/WMSServer", 
                   services_df$name[i])
    sds <- try(vapour::vapour_sds_names(dsn))
    if (inherits(sds, "try-error")) {
      plot(1, main = services_df$name[i])
    }
    x <- try(im <- vapour::gdal_raster_image(sds[1], target_dim = c(3840 %/% sqrt(sum(services_df$wmts)), 0)))
    if (!inherits(x, "try-error")) {
      ximage::ximage(im)
      title(services_df$name[i])
    } 
  }
}
mdsumner commented 1 year ago

image

mdsumner commented 1 year ago

NCI WCS, is this all dead?

https://opus.nci.org.au/pages/viewpage.action?pageId=137199852

mdsumner commented 1 year ago

here we go

gdalinfo "WCS:http://gsky.nci.org.au/ows/national_geophysical_compilations?service=WCS&version=1.0.0&request=GetCapabilities"
Driver: WCS/OGC Web Coverage Service
Files: /home/ubuntu/.gdal/wcs_cache/xstVT.aux.xml
Size is 512, 512
Origin = (0.000000000000000,0.000000000000000)
Pixel Size = (1.000000000000000,1.000000000000000)
Metadata:
  WCS_GLOBAL#Service.accessConstraints=NONE
  WCS_GLOBAL#Service.fees=NONE
  WCS_GLOBAL#Service.label=gsky
  WCS_GLOBAL#Service.name=gsky
  WCS_GLOBAL#version=1.0.0
Subdatasets:
  SUBDATASET_1_NAME=https://gsky.nci.org.au/ows/national_geophysical_compilations?VERSION=1.0.0&COVERAGE=gravmap2016_grid_grv_cscba
  SUBDATASET_1_DESC=Australia gravity grid 2016 (complete spherical cap Bouguer anomaly)
  SUBDATASET_2_NAME=https://gsky.nci.org.au/ows/national_geophysical_compilations?VERSION=1.0.0&COVERAGE=gravmap2016_grid_grv_ir
  SUBDATASET_2_DESC=Australia gravity grid 2016 (isostatic residual anomaly)
  SUBDATASET_3_NAME=https://gsky.nci.org.au/ows/national_geophysical_compilations?VERSION=1.0.0&COVERAGE=gravmap2016_grid_grv_scba
  SUBDATASET_3_DESC=Australia gravity grid 2016 (spherical cap Bouguer anomaly)
  SUBDATASET_4_NAME=https://gsky.nci.org.au/ows/national_geophysical_compilations?VERSION=1.0.0&COVERAGE=magmap2019_grid_tmi_1vd_awags_mag_2019
  SUBDATASET_4_DESC=Total Magnetic Intensity Grid of Australia 2019 - First Vertical Derivative (1VD)
  SUBDATASET_5_NAME=https://gsky.nci.org.au/ows/national_geophysical_compilations?VERSION=1.0.0&COVERAGE=magmap2019_grid_tmi_awags_mag_2019
  SUBDATASET_5_DESC=Total Magnetic Intensity (TMI) Grid of Australia 2019 - seventh edition - 80 m cell size
  SUBDATASET_6_NAME=https://gsky.nci.org.au/ows/national_geophysical_compilations?VERSION=1.0.0&COVERAGE=magmap2019_grid_tmi_cellsize40m_awags_mag_2019
  SUBDATASET_6_DESC=Total Magnetic Intensity (TMI) Grid of Australia 2019 - seventh edition - 40 m cell size
  SUBDATASET_7_NAME=https://gsky.nci.org.au/ows/national_geophysical_compilations?VERSION=1.0.0&COVERAGE=magmap2019_grid_tmi_rtp_awags_mag_2019
  SUBDATASET_7_DESC=Total Magnetic Intensity (TMI) Grid of Australia with Variable Reduction to Pole (VRTP) 2019 - seventh edition
  SUBDATASET_8_NAME=https://gsky.nci.org.au/ows/national_geophysical_compilations?VERSION=1.0.0&COVERAGE=radmap2019_grid_dose_terr_awags_rad_2019
  SUBDATASET_8_DESC=Radiometric Grid of Australia (Radmap) v4 2019 unfiltered terrestrial dose rate
  SUBDATASET_9_NAME=https://gsky.nci.org.au/ows/national_geophysical_compilations?VERSION=1.0.0&COVERAGE=radmap2019_grid_dose_terr_filtered_awags_rad_2019
  SUBDATASET_9_DESC=Radiometric Grid of Australia (Radmap) v4 2019 filtered terrestrial dose rate
  SUBDATASET_10_NAME=https://gsky.nci.org.au/ows/national_geophysical_compilations?VERSION=1.0.0&COVERAGE=radmap2019_grid_k_conc_awags_rad_2019
  SUBDATASET_10_DESC=Radiometric Grid of Australia (Radmap) v4 2019 unfiltered pct potassium
  SUBDATASET_11_NAME=https://gsky.nci.org.au/ows/national_geophysical_compilations?VERSION=1.0.0&COVERAGE=radmap2019_grid_k_conc_filtered_awags_rad_2019
  SUBDATASET_11_DESC=Radiometric Grid of Australia (Radmap) v4 2019 filtered pct potassium grid
  SUBDATASET_12_NAME=https://gsky.nci.org.au/ows/national_geophysical_compilations?VERSION=1.0.0&COVERAGE=radmap2019_grid_th_conc_awags_rad_2019
  SUBDATASET_12_DESC=Radiometric Grid of Australia (Radmap) v4 2019 unfiltered ppm thorium
  SUBDATASET_13_NAME=https://gsky.nci.org.au/ows/national_geophysical_compilations?VERSION=1.0.0&COVERAGE=radmap2019_grid_th_conc_filtered_awags_rad_2019
  SUBDATASET_13_DESC=Radiometric Grid of Australia (Radmap) v4 2019 filtered ppm thorium
  SUBDATASET_14_NAME=https://gsky.nci.org.au/ows/national_geophysical_compilations?VERSION=1.0.0&COVERAGE=radmap2019_grid_thk_ratio_awags_rad_2019
  SUBDATASET_14_DESC=Radiometric Grid of Australia (Radmap) v4 2019 ratio thorium over potassium
  SUBDATASET_15_NAME=https://gsky.nci.org.au/ows/national_geophysical_compilations?VERSION=1.0.0&COVERAGE=radmap2019_grid_u2th_ratio_awags_rad_2019
  SUBDATASET_15_DESC=Radiometric Grid of Australia (Radmap) v4 2019 ratio uranium squared over thorium
  SUBDATASET_16_NAME=https://gsky.nci.org.au/ows/national_geophysical_compilations?VERSION=1.0.0&COVERAGE=radmap2019_grid_u_conc_awags_rad_2019
  SUBDATASET_16_DESC=Radiometric Grid of Australia (Radmap) v4 2019 unfiltered ppm uranium
  SUBDATASET_17_NAME=https://gsky.nci.org.au/ows/national_geophysical_compilations?VERSION=1.0.0&COVERAGE=radmap2019_grid_u_conc_filtered_awags_rad_2019
  SUBDATASET_17_DESC=Radiometric Grid of Australia (Radmap) v4 2019 filtered ppm uranium
  SUBDATASET_18_NAME=https://gsky.nci.org.au/ows/national_geophysical_compilations?VERSION=1.0.0&COVERAGE=radmap2019_grid_uk_ratio_awags_rad_2019
  SUBDATASET_18_DESC=Radiometric Grid of Australia (Radmap) v4 2019 ratio uranium over potassium
  SUBDATASET_19_NAME=https://gsky.nci.org.au/ows/national_geophysical_compilations?VERSION=1.0.0&COVERAGE=radmap2019_grid_uth_ratio_awags_rad_2019
  SUBDATASET_19_DESC=Radiometric Grid of Australia (Radmap) v4 2019 ratio uranium over thorium
Corner Coordinates:
Upper Left  (   0.0000000,   0.0000000)
Lower Left  (       0.000,     512.000)
Upper Right (     512.000,       0.000)
Lower Right (     512.000,     512.000)
mdsumner commented 1 year ago

this gives the WMS versus the WCS, this is behind the national map (and the origins of DEA)

gdalinfo "WMS:https://gsky.nci.org.au/ows/national_geophysical_compilations?service=WCS"

gdalinfo "WMS:https://gsky.nci.org.au/ows/national_geophysical_compilations"