From 4ce8aa0acd6d5e34412e2873aa251f3b1703bb3b Mon Sep 17 00:00:00 2001 From: KoalaGeo Date: Mon, 11 Mar 2024 13:52:43 +0000 Subject: [PATCH 01/22] Update summary error message --- app/static/js/htmlView.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/static/js/htmlView.js b/app/static/js/htmlView.js index b8d344d..38b470b 100644 --- a/app/static/js/htmlView.js +++ b/app/static/js/htmlView.js @@ -192,7 +192,7 @@ agsHtml.displayFileResult=function(fileResult){ xhtml=xhtml + "
-
-
-
-
- {% block body %} - {% endblock %} -
-
-
-
-
-
- Powered by pyagsapi 5.0. pyagsapi was created by and is maintained by the British Geological Survey and is distributed under the LGPL v3.0 licence, code is available on GitHub. pyagsapi uses the Official AGS Python Library v0.5.0. + +
+
+
+
+ {% block body %} + {% endblock %} +
+
+
Powered by pyagsapi 5.0. pyagsapi was created by and is maintained by the British Geological Survey and is distributed under the LGPL v3.0 licence, code is available on GitHub. pyagsapi uses the Official AGS Python Library v0.5.0.
+

 

Selected extent

@@ -422,7 +375,6 @@

Selected extent

Download ZIP of selected boreholes

 

-
{% block extrafoot %} {% endblock %} - diff --git a/app/templates/landing_page.html b/app/templates/landing_page.html index 4e56b14..c1bd98c 100644 --- a/app/templates/landing_page.html +++ b/app/templates/landing_page.html @@ -2,33 +2,30 @@ {% block title %}Home{% endblock %} {% block body %} -
+

AGS4 File Utilities Tool and API

-

This tool and associated API allow schema validation, data validation and conversion of your AGS files. Files are not saved or stored by this tool. Also included are links to our other AGS data related services and applications

-

Tools and Utilities

-
-
-
-
+ +

AGS Data Submission


-

Deposit your AGS data with the National Geoscience Data Centre (NGDC) here. Please validate your files prior to submission. For further details please see geotechnical data services.

+

Deposit your AGS data with the National Geoscience Data Centre (NGDC) here.

+

Please validate your files prior to submission. For further details please see geotechnical data services.

+
+
-
-
-
-

AGS4 Schema & Data Validation

-
+ +

AGS4 Validation

Performs validation using the Official AGS Python Library version 0.5.0, this implements checks of the rules as written in the AGS data format standard v4.x.

If you're using AGS Data Format Standard v3.x use our legacy AGS Validator

@@ -131,11 +128,11 @@

Future data validation rules: (Coming Soon)


If HTML show LOCA features on a map / If JSON include GeoJSON - - - -
-
+ + + +
+
Select .ags / .AGS file(s) for validation (v4.x only) (50 Mb Maximum) @@ -144,13 +141,10 @@

Future data validation rules: (Coming Soon)

-
-
-
-
-

AGS Data Discovery

-
+ +

Use the map below to find AGS data, click on the markers to find borehole information, links to graphical logs, .ags data download from the NGDC AGS database, and the original submitted AGS data.

+

The map will show a maximum of 100 AGS markers - users may need to pan/zoom to display markers of interest.

If no AGS Submission Record is shown at the link provided there is likely a legacy confidentiality restriction.


@@ -158,16 +152,13 @@

AGS Data Discovery

  • Selecting 10 boreholes from 10 different PROJ ID, then 10 .ags files will be supplied.
  • Selecting 10 boreholes from a single PROJ ID then only one .ags file will be supplied.
  • -
-
+
-
-
-
-
+ +

AGS Converter

-

Convert .ags file(s) to/from .xlsx.

- Which ever format file is submitted, the opposite will be returned e.g. if 5 .ags files and 3 .xlsx files were submitted the result would be 5 .xlsx files and 3 .ags files +

Convert .ags file(s) to/from .xlsx.

+ Which ever format file is submitted, the opposite will be returned e.g. if 5 .ags files and 3 .xlsx files were submitted the result would be 5 .xlsx files and 3 .ags files


@@ -175,13 +166,13 @@

AGS Converter

Sort worksheets in .xlsx file using a sorting strategy (Warning: .ags to .xlsx only. The original group order will be lost) -
- -
+
-
+
+ +
-
+

@@ -191,11 +182,9 @@

AGS Converter

-
-
-
-
-

API Definition

+ +
+

API Documentation and definition

Documentation (Swagger UI)

OpenAPI Document

ReDoc

From 8e9a9cc621a1557a7fca94c56a458b7aee4a128c Mon Sep 17 00:00:00 2001 From: Simon Burden Date: Tue, 19 Mar 2024 15:19:52 +0000 Subject: [PATCH 05/22] update-css-for-new-ui --- app/static/css/htmlView.css | 52 +++++++++++++++++++++++++++++++------ 1 file changed, 44 insertions(+), 8 deletions(-) diff --git a/app/static/css/htmlView.css b/app/static/css/htmlView.css index 96c605d..d0267f0 100644 --- a/app/static/css/htmlView.css +++ b/app/static/css/htmlView.css @@ -2,12 +2,12 @@ /* Styling for HTML validation result viewer plugin */ #resultPopup{ - display:block; + display:block; border:1px solid #CCCCCC; background-color:#FAFAFA; - margin:5px; + margin:5px; padding:0px; - } + } /* close button */ #resultPopup>h2>input{ @@ -21,17 +21,17 @@ font-size: 90%; cursor:pointer; box-shadow: 2px 2px 4px #444; - } + } #resultPopup>h2>input:hover{ border: 1px solid #000; background-color: #444; color: #FFF; box-shadow: 1px 1px 2px #222; - } - + } + input.submitBtn{color:rgb(0,48,66);} input.submitBtn:disabled{opacity:0.5;color:#888;} - + #resultPopup>p{ padding: 4px 8px; margin: 0px; @@ -41,7 +41,7 @@ input.submitBtn:disabled{opacity:0.5;color:#888;} margin:5px; background-color: #FFFFFF; } -#res_Files>article>h3{color:#FFF;} +#res_Files>article>h3{color:#FFF;} #res_Files>article>h3.valid{background-color:#080;} #res_Files>article>h3.invalid{background-color:#900;color:#FFF;} #res_Files>article>h3>*{display:inline-block;padding: 2px 4px;} @@ -69,3 +69,39 @@ input.submitBtn:disabled{opacity:0.5;color:#888;} #res_Files>article>ul.fileResErrors>li>ul{display:none;} #res_Files>article>ul.fileResErrors>li>ul>li>span{color:#800000;} +/* Validation map container */ +#res_Map{height:400px;} + +/* Validation map marker popups */ +span.popupContent{} +span.popupContent>h4{border-bottom:1px solid #000000;margin:0em;} +span.popupContent>label{color:#444;} +span.popupContent>strong{color:#000;} + +#resultPopup>p#res_LoadMsg{ + color:#FFF; + background-color:#97875B; + margin:10px; + padding:2px 5px; + border-radius:5px; + font-size:120%; + } + +#res_LoadMsg>span{ + font-weight:bold; + display:inline-block; + width:24px; + height:24px; + padding:2px; + margin:2px; + color:#97875B; + background-color:#FFF; + border-radius:50%; + } + +.rotate{animation: rotation 2s linear infinite;} + +@keyframes rotation{ + from {transform: rotate(0deg);} + to {transform: rotate(359deg);} + } From 90cec2faef7aeb430c729f4fd36edd15cfeb18d2 Mon Sep 17 00:00:00 2001 From: Simon Burden Date: Tue, 19 Mar 2024 15:34:24 +0000 Subject: [PATCH 06/22] Update style.css --- app/static/css/style.css | 105 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) diff --git a/app/static/css/style.css b/app/static/css/style.css index 50af642..433b752 100644 --- a/app/static/css/style.css +++ b/app/static/css/style.css @@ -2,6 +2,7 @@ width: 100%; height: 600px; cursor: crosshair; + border:1px solid var(--blue); } #dOpacitySliderBox { @@ -69,3 +70,107 @@ padding:3px 5px; float:right; } + + +/* NEW */ + +#identification{ + clear:both; + margin-bottom:0px; + } +#identification>h1{ + margin-bottom:0px; + } +#identification>p{ + background-color:var(--white); + color:var(--blue); + padding:10px; + margin:10px; + } +#identification>ul{ + list-style-type:none; + display:flex; + background-color:var(--blue); + padding:0px 5px; + margin:0px; + border-top-left-radius:5px; + border-top-right-radius:5px; + } +#identification>ul>li{ + flex:1; + padding:10px; + background-color:var(--lt-ochre); + margin:5px; + margin-bottom:0px; + text-align:center; + cursor:pointer; + border:1px solid var(--blue); + border-top-left-radius:5px; + border-top-right-radius:5px; + font-weight:bold; + } +#identification>ul>li>a{ + text-decoration:none; + color:var(--blue); + } + +#identification>ul>li:hover{ + background-color:var(--lt-gray); + } + + + + +#identification>ul>li.open{ + background-color:var(--white); + border:1px solid var(--white); + } + + +#openapi, #validator, #converter, #ags_data, #deposit{ + border:1px solid var(--blue); + border-top:0px; + padding:20px; + } + +#openapi, #validator, #converter, #deposit{ + display:none; + } + +/* FROM _base.html */ + +.collapsible { + background-color: #cec4a9; + color: black; + cursor: pointer; + padding: 18px; + width: 100%; + border: none; + text-align: left; + outline: none; + font-size: 15px; +} + +.active, .collapsible:hover { + background-color: #97875B; +} + +.collapsible:after { + content: '\002B'; + color: black; + font-weight: bold; + float: right; + margin-left: 5px; +} + +.active:after { + content: "\2212"; +} + +.content { + padding: 0 18px; + max-height: 0; + overflow: hidden; + transition: max-height 0.2s ease-out; + background-color: #edf3f4; +} From 1d881d1eca59ab92cad967b19fdf6a64114f6a5d Mon Sep 17 00:00:00 2001 From: Simon Burden Date: Tue, 19 Mar 2024 16:02:58 +0000 Subject: [PATCH 07/22] add-logging-to-test-validation-map --- app/static/css/htmlView.css | 6 +++--- app/static/js/htmlView.js | 11 +++++++++-- app/static/js/validation-map.js | 7 +++++++ 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/app/static/css/htmlView.css b/app/static/css/htmlView.css index d0267f0..15116c8 100644 --- a/app/static/css/htmlView.css +++ b/app/static/css/htmlView.css @@ -2,12 +2,12 @@ /* Styling for HTML validation result viewer plugin */ #resultPopup{ - display:block; + display:block; border:1px solid #CCCCCC; background-color:#FAFAFA; - margin:5px; + margin:5px; padding:0px; - } + } /* close button */ #resultPopup>h2>input{ diff --git a/app/static/js/htmlView.js b/app/static/js/htmlView.js index be94b24..9b24c1a 100644 --- a/app/static/js/htmlView.js +++ b/app/static/js/htmlView.js @@ -193,6 +193,8 @@ agsHtml.parseValidationError=function(xhr){ agsHtml.parseValidationResponse=function(jData){ // validation success - show results + console.log("agsHtml.parseValidationResponse"); + console.log(jData); var i=0; var fileResult={}; $("#res_Summary").html(jData.msg); @@ -210,6 +212,9 @@ agsHtml.parseValidationResponse=function(jData){ }; agsHtml.displayFileResult=function(fileResult,ix){ + console.log("agsHtml.displayFileResult"); + console.log(fileResult); + console.log(ix); var xhtml=""; var i=0; var errGroups=[]; @@ -281,12 +286,14 @@ agsHtml.displayFileResult=function(fileResult,ix){ agsHtml.resetValidationMap(); if(fileResult.geojson && fileResult.geojson.type){ + console.log("GOT GeoJSON"); // show GeoJSON if returned + pass through filename for popup agsHtml.showOnValidationMap(fileResult.geojson,fileResult.filename,ix); // enable download button $("#downloadGeoJSONBtn").prop("disabled",false); } else{ + console.log("NO GeoJSON"); // otherwise hide validation map + disable download button agsHtml.hideValidationMap(); $("#downloadGeoJSONBtn").prop("disabled",true); @@ -295,9 +302,7 @@ agsHtml.displayFileResult=function(fileResult,ix){ return true; }; - agsHtml.setupCollapsibles=function(){ - console.log("agsHtml.setupCollapsibles"); var coll = document.getElementsByClassName("collapsible"); var i; for (i = 0; i < coll.length; i++){ @@ -325,11 +330,13 @@ agsHtml.showOnValidationMap=function(geoJSON,ix){ }; agsHtml.resetValidationMap=function(){ + console.log("agsHtml.resetValidationMap"); vMap.resetValidationMap(); return true; }; agsHtml.hideValidationMap=function(){ + console.log("agsHtml.hideValidationMap"); vMap.hideValidationMap(); return true; }; diff --git a/app/static/js/validation-map.js b/app/static/js/validation-map.js index 7e9f057..86a9a34 100644 --- a/app/static/js/validation-map.js +++ b/app/static/js/validation-map.js @@ -12,6 +12,7 @@ vMap.map={ }; vMap.setupValidationMap=function(){ + console.log("vMap.setupValidationMap"); var baseLayers={}; var overlays={}; var mapOpts={ @@ -36,6 +37,10 @@ vMap.setupValidationMap=function(){ }; vMap.showOnValidationMap=function(geoJSON,fileName,ix){ + console.log("vMap.showOnValidationMap"); + console.log(geoJSON); + console.log(fileName); + console.log(ix); // show GeoJSON features on map - add popups and tooltips L.geoJSON(geoJSON,{ "pointToLayer":function(feature,latlng){ @@ -50,6 +55,7 @@ vMap.showOnValidationMap=function(geoJSON,fileName,ix){ }; vMap.fitValidationMap=function(){ + console.log("vMap.fitValidationMap"); // fit bounds of validation GeoJSON layer(s) vMap.map.lMap.fitBounds(vMap.map.lyrs.GeoJSON.getBounds()); return true; @@ -92,6 +98,7 @@ vMap.pointToLayer=function(feature,latlng,ix){ }; vMap.resetValidationMap=function(){ + console.log("vMap.resetValidationMap"); // force map redraw when showing map and clear out any existing layers vMap.map.lyrs.GeoJSON.clearLayers(); vMap.map.lMap.invalidateSize(); From 26dff7f0e9f300c8d63fc51a298f9bc5f25b59d3 Mon Sep 17 00:00:00 2001 From: Edd Lewis - BGS Date: Tue, 19 Mar 2024 16:11:01 +0000 Subject: [PATCH 08/22] Added tooltip description for sorting strategy --- app/static/js/htmlView.js | 2 +- app/templates/landing_page.html | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/static/js/htmlView.js b/app/static/js/htmlView.js index 9b24c1a..2ee1c9c 100644 --- a/app/static/js/htmlView.js +++ b/app/static/js/htmlView.js @@ -241,7 +241,7 @@ agsHtml.displayFileResult=function(fileResult,ix){ xhtml=xhtml + "
    "; if(summaries.length === 0){ - xhtml=xhtml + "
  • No summary generated due to errors reading file (see below) or BGS validation not selected (required for summary)
  • "; + xhtml=xhtml + "
  • No summary generated due to errors reading file (see below)
  • "; }; if(fileResult.additional_metadata.bgs_all_groups){ diff --git a/app/templates/landing_page.html b/app/templates/landing_page.html index c1bd98c..02822dc 100644 --- a/app/templates/landing_page.html +++ b/app/templates/landing_page.html @@ -166,13 +166,13 @@

    AGS Converter

    Sort worksheets in .xlsx file using a sorting strategy (Warning: .ags to .xlsx only. The original group order will be lost) -
    - -
    +
    -
    +
    + +
    -
    +

    From d4981f8f5e434f524ba7e5589d0e695b421601a3 Mon Sep 17 00:00:00 2001 From: Simon Burden Date: Wed, 20 Mar 2024 09:26:22 +0000 Subject: [PATCH 09/22] fix-validation-map-display-logic --- app/static/js/htmlView.js | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/app/static/js/htmlView.js b/app/static/js/htmlView.js index 2ee1c9c..37b4909 100644 --- a/app/static/js/htmlView.js +++ b/app/static/js/htmlView.js @@ -197,13 +197,33 @@ agsHtml.parseValidationResponse=function(jData){ console.log(jData); var i=0; var fileResult={}; + var gotGeoJSON=false; + $("#res_Summary").html(jData.msg); + // clear any previous results $("#res_Files").html(""); + for(i=0;i < jData.data.length;i++){ fileResult=jData.data[i]; agsHtml.displayFileResult(fileResult,i); + // check for GeoJSON + if(fileResult.geojson && fileResult.geojson.type){gotGeoJSON=true;}; }; + + // check if any of the files returned GeoJSON + if(gotGeoJSON){ + // enable download button + fit map to bounds + $("#downloadGeoJSONBtn").prop("disabled",false); + mavg.mergeGeoJSON(jData); + vMap.fitValidationMap(); + } + else{ + // if no files have GeoJSON then hide validation map + disable download button + agsHtml.hideValidationMap(); + $("#downloadGeoJSONBtn").prop("disabled",true); + }; + $("#res_LoadMsg").hide(); $("#res_Download").show(); $("#resultPopup").show(); @@ -241,7 +261,7 @@ agsHtml.displayFileResult=function(fileResult,ix){ xhtml=xhtml + "
      "; if(summaries.length === 0){ - xhtml=xhtml + "
    • No summary generated due to errors reading file (see below)
    • "; + xhtml=xhtml + "
    • No summary generated due to errors reading file (see below) or BGS validation not selected (required for summary)
    • "; }; if(fileResult.additional_metadata.bgs_all_groups){ @@ -286,17 +306,12 @@ agsHtml.displayFileResult=function(fileResult,ix){ agsHtml.resetValidationMap(); if(fileResult.geojson && fileResult.geojson.type){ - console.log("GOT GeoJSON"); - // show GeoJSON if returned + pass through filename for popup + console.log("GOT GeoJSON for file #" + ix); + // show GeoJSON if returned + pass through filename for popup + file index for colour agsHtml.showOnValidationMap(fileResult.geojson,fileResult.filename,ix); - // enable download button - $("#downloadGeoJSONBtn").prop("disabled",false); } else{ - console.log("NO GeoJSON"); - // otherwise hide validation map + disable download button - agsHtml.hideValidationMap(); - $("#downloadGeoJSONBtn").prop("disabled",true); + console.log("NO GeoJSON for file #" + ix); }; $("#res_Files").append(xhtml); return true; From d892d9851a7d29b082e498274820ffc7bbf93e1f Mon Sep 17 00:00:00 2001 From: Simon Burden Date: Wed, 20 Mar 2024 09:41:04 +0000 Subject: [PATCH 10/22] fix-missing-filename-argument --- app/static/js/htmlView.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/app/static/js/htmlView.js b/app/static/js/htmlView.js index 37b4909..fb559fd 100644 --- a/app/static/js/htmlView.js +++ b/app/static/js/htmlView.js @@ -201,8 +201,9 @@ agsHtml.parseValidationResponse=function(jData){ $("#res_Summary").html(jData.msg); - // clear any previous results + // clear any previous results and data from validation map $("#res_Files").html(""); + agsHtml.resetValidationMap(); for(i=0;i < jData.data.length;i++){ fileResult=jData.data[i]; @@ -302,9 +303,6 @@ agsHtml.displayFileResult=function(fileResult,ix){ }; xhtml=xhtml + ""; - // clear any old data from validation map - agsHtml.resetValidationMap(); - if(fileResult.geojson && fileResult.geojson.type){ console.log("GOT GeoJSON for file #" + ix); // show GeoJSON if returned + pass through filename for popup + file index for colour @@ -338,9 +336,9 @@ agsHtml.setupValidationMap=function(){ return true; }; -agsHtml.showOnValidationMap=function(geoJSON,ix){ - console.log("agsHtml.showOnValidationMap"); - vMap.showOnValidationMap(geoJSON,ix); +agsHtml.showOnValidationMap=function(geoJSON,fileName,ix){ + console.log("agsHtml.showOnValidationMap " + ix); + vMap.showOnValidationMap(geoJSON,fileName,ix); return true; }; From d3ea3f62c887e65379a2fdbccd271bb818ac0b1d Mon Sep 17 00:00:00 2001 From: Simon Burden Date: Wed, 20 Mar 2024 13:11:36 +0000 Subject: [PATCH 11/22] re-fix-map-redraw --- app/static/js/htmlView.js | 27 ++++----------------------- app/static/js/validation-map.js | 2 ++ 2 files changed, 6 insertions(+), 23 deletions(-) diff --git a/app/static/js/htmlView.js b/app/static/js/htmlView.js index fb559fd..2ca877c 100644 --- a/app/static/js/htmlView.js +++ b/app/static/js/htmlView.js @@ -330,29 +330,10 @@ agsHtml.setupCollapsibles=function(){ }; // interfaces to vMap (validation-map.js) -agsHtml.setupValidationMap=function(){ - console.log("agsHtml.setupValidationMap"); - vMap.setupValidationMap(); - return true; - }; - -agsHtml.showOnValidationMap=function(geoJSON,fileName,ix){ - console.log("agsHtml.showOnValidationMap " + ix); - vMap.showOnValidationMap(geoJSON,fileName,ix); - return true; - }; - -agsHtml.resetValidationMap=function(){ - console.log("agsHtml.resetValidationMap"); - vMap.resetValidationMap(); - return true; - }; - -agsHtml.hideValidationMap=function(){ - console.log("agsHtml.hideValidationMap"); - vMap.hideValidationMap(); - return true; - }; +agsHtml.setupValidationMap=function(){ vMap.setupValidationMap(); return true; }; +agsHtml.showOnValidationMap=function(geoJSON,fileName,ix){ vMap.showOnValidationMap(geoJSON,fileName,ix); return true; }; +agsHtml.resetValidationMap=function(){ vMap.resetValidationMap(); return true; }; +agsHtml.hideValidationMap=function(){ vMap.hideValidationMap(); return true; }; // init agsHtml.init=function(){ diff --git a/app/static/js/validation-map.js b/app/static/js/validation-map.js index 86a9a34..1eaf3b4 100644 --- a/app/static/js/validation-map.js +++ b/app/static/js/validation-map.js @@ -56,6 +56,8 @@ vMap.showOnValidationMap=function(geoJSON,fileName,ix){ vMap.fitValidationMap=function(){ console.log("vMap.fitValidationMap"); + // force map redraw + vMap.map.lMap.invalidateSize(); // fit bounds of validation GeoJSON layer(s) vMap.map.lMap.fitBounds(vMap.map.lyrs.GeoJSON.getBounds()); return true; From 80bc9396bd4f36757be887ddadfe71ccf3382bd5 Mon Sep 17 00:00:00 2001 From: Simon Burden Date: Wed, 20 Mar 2024 13:22:20 +0000 Subject: [PATCH 12/22] put-tooltip-css-back --- app/templates/_base.html | 1 + 1 file changed, 1 insertion(+) diff --git a/app/templates/_base.html b/app/templates/_base.html index 58c3c1e..0f025fd 100644 --- a/app/templates/_base.html +++ b/app/templates/_base.html @@ -16,6 +16,7 @@ + From 36388ebd8e494da1778cc3bdedd959c983517e98 Mon Sep 17 00:00:00 2001 From: Edd Lewis - BGS Date: Wed, 20 Mar 2024 13:52:25 +0000 Subject: [PATCH 13/22] CHange validation map colour ramp --- app/static/js/validation-map.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/static/js/validation-map.js b/app/static/js/validation-map.js index 1eaf3b4..29f441d 100644 --- a/app/static/js/validation-map.js +++ b/app/static/js/validation-map.js @@ -1,7 +1,7 @@ // validation-map.js var vMap={}; -vMap.colours=['#B2182B','#D6604D','#F4A582','#FDDBC7','#F7F7F7','#D1E5F0','#92C5DE','#4393C3','#2166AC']; +vMap.colours=['#a6cee3','#1f78b4','#b2df8a','#33a02c','#fb9a99','#e31a1c','#fdbf6f','#ff7f00','#cab2d6','#6a3d9a','#ffff99','#b15928']; vMap.map={ "basemaps":{}, From 80ec964248ce01a3d82f7ef8bff57a2972f98163 Mon Sep 17 00:00:00 2001 From: Edd Lewis - BGS Date: Thu, 21 Mar 2024 14:17:40 +0000 Subject: [PATCH 14/22] use esri desert bloom colour ramp --- app/static/js/validation-map.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/static/js/validation-map.js b/app/static/js/validation-map.js index 29f441d..2f2c6f1 100644 --- a/app/static/js/validation-map.js +++ b/app/static/js/validation-map.js @@ -1,7 +1,7 @@ // validation-map.js var vMap={}; -vMap.colours=['#a6cee3','#1f78b4','#b2df8a','#33a02c','#fb9a99','#e31a1c','#fdbf6f','#ff7f00','#cab2d6','#6a3d9a','#ffff99','#b15928']; +vMap.colours=["#d9351a", "#ffc730", "#144d59", "#2c6954", "#ed9310", "#8c213f", "#102432", "#a64f1b", "#18382e", "#661510", "#b31515", "#4a0932"]; vMap.map={ "basemaps":{}, From 3744f95e63642b02111e917a698e1e710ad3be30 Mon Sep 17 00:00:00 2001 From: Edd Lewis - BGS Date: Thu, 21 Mar 2024 14:21:01 +0000 Subject: [PATCH 15/22] Update version in openapi doc --- app/main.py | 2 +- app/routes.py | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/app/main.py b/app/main.py index 57eec28..96374dc 100644 --- a/app/main.py +++ b/app/main.py @@ -83,7 +83,7 @@ def custom_openapi(): return app.openapi_schema openapi_schema = get_openapi( title="pyagsapi - AGS File Utilities Tools and API", - version="4.5.3", + version="5.0", description=("The API performs schema validation, data validation and conversion of your AGS files. " "It also exports a graphical log from AGS data held by NGDC. " "Schema validation and conversion uses https://gitlab.com/ags-data-format-wg/ags-python-library"), diff --git a/app/routes.py b/app/routes.py index 7ab96ea..38d1306 100644 --- a/app/routes.py +++ b/app/routes.py @@ -320,7 +320,6 @@ async def convert(background_tasks: BackgroundTasks, summary="Generate Graphical Log", description=("Generate a graphical log (.pdf) from AGS data " "held by the National Geoscience Data Centre."), - include_in_schema=False, response_class=Response, responses=pdf_responses) def get_ags_log(bgs_loca_id: str = ags_log_query, @@ -369,7 +368,6 @@ def get_ags_log(bgs_loca_id: str = ags_log_query, summary="Export one or more boreholes in .ags format", description=("Export one or more borehole in .ags format from AGS data " "held by the National Geoscience Data Centre."), - include_in_schema=False, response_class=Response, responses=ags_export_responses) def ags_export(bgs_loca_id: str = ags_export_query): @@ -418,7 +416,6 @@ def ags_export(bgs_loca_id: str = ags_export_query): description=("Export a number of boreholes in .ags format from AGS data " "held by the National Geoscience Data Centre, using a" " polygon using Well-Known-Text."), - include_in_schema=False, response_model=BoreholeCountResponse, responses=ags_export_responses) def ags_export_by_polygon(polygon: str = polygon_query, From 074585a99830b584a160b5f9d21c371538cf31ed Mon Sep 17 00:00:00 2001 From: Edd Lewis - BGS Date: Thu, 21 Mar 2024 14:29:00 +0000 Subject: [PATCH 16/22] tooltip width --- app/static/css/tooltip.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/static/css/tooltip.css b/app/static/css/tooltip.css index e040ce0..0d3d70c 100644 --- a/app/static/css/tooltip.css +++ b/app/static/css/tooltip.css @@ -8,7 +8,7 @@ .tooltip .tooltiptext { visibility: hidden; - width: 120px; + width: 240px; background-color: black; color: #fff; text-align: center; From 33d21e81ad194ca3600a8833c44640b151670c74 Mon Sep 17 00:00:00 2001 From: Edd Lewis - BGS Date: Thu, 21 Mar 2024 14:51:06 +0000 Subject: [PATCH 17/22] allow api --- test/integration/test_api.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/test/integration/test_api.py b/test/integration/test_api.py index c95c87c..15006c8 100644 --- a/test/integration/test_api.py +++ b/test/integration/test_api.py @@ -33,10 +33,9 @@ def test_openapi_json(client): # exposed endpoints assert '/validate' in response.text assert '/convert' in response.text - # hidden endpoints - assert '/ags_log' not in response.text - assert '/ags_export' not in response.text - assert '/ags_export_by_polygon' not in response.text + assert '/ags_log' in response.text + assert '/ags_export' in response.text + assert '/ags_export_by_polygon' in response.text @pytest.mark.parametrize('filename, expected', From 23abe82212525411c670e442cf603fa0a5234ed4 Mon Sep 17 00:00:00 2001 From: Edd Lewis - BGS Date: Thu, 21 Mar 2024 15:38:05 +0000 Subject: [PATCH 18/22] Update tab name --- app/templates/landing_page.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/templates/landing_page.html b/app/templates/landing_page.html index 02822dc..b9f575a 100644 --- a/app/templates/landing_page.html +++ b/app/templates/landing_page.html @@ -11,7 +11,7 @@

      AGS4 File Utilities Tool and API

    • Schema & Data Validator
    • Data Submission
    • File Conversion
    • -
    • Documentation
    • +
    • API Documentation
From e11ed020d6766b8cbd471038f90d10fbb0b3ec5b Mon Sep 17 00:00:00 2001 From: KoalaGeo Date: Thu, 21 Mar 2024 16:41:56 +0000 Subject: [PATCH 19/22] Add stroke to circlemarker --- app/static/js/validation-map.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/static/js/validation-map.js b/app/static/js/validation-map.js index 2f2c6f1..048f667 100644 --- a/app/static/js/validation-map.js +++ b/app/static/js/validation-map.js @@ -93,7 +93,7 @@ vMap.pointToLayer=function(feature,latlng,ix){ "weight":1, "opacity":1, "fillOpacity":0.7, - "stroke":false + "stroke":true }; var marker=L.circleMarker(latlng,markerOpts); return marker; From 034f0f666ff48ae59f02fc762ecc4c83d81297a8 Mon Sep 17 00:00:00 2001 From: Simon Burden Date: Fri, 22 Mar 2024 08:57:23 +0000 Subject: [PATCH 20/22] add-per-file-symbols-and-map-key --- app/static/css/htmlView.css | 22 ++++++++++++++++++++++ app/static/js/htmlView.js | 6 ++++-- app/static/js/validation-map.js | 7 ++++++- 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/app/static/css/htmlView.css b/app/static/css/htmlView.css index 15116c8..f313bec 100644 --- a/app/static/css/htmlView.css +++ b/app/static/css/htmlView.css @@ -105,3 +105,25 @@ span.popupContent>strong{color:#000;} from {transform: rotate(0deg);} to {transform: rotate(359deg);} } + +/* Validation map key and symbols */ + +p.mapKey{ + border: 1px solid #CCC; + margin: 1px; + } + +span.symbol { + display: inline-block; + width: 16px; + height: 16px; + overflow: hidden; + border-radius: 50%; + margin: 0px; + padding: 0px; + } + +h3>span.symbol{ + padding: 0px; + border:1px solid #FFF; + } diff --git a/app/static/js/htmlView.js b/app/static/js/htmlView.js index 2ca877c..fe9e119 100644 --- a/app/static/js/htmlView.js +++ b/app/static/js/htmlView.js @@ -241,13 +241,15 @@ agsHtml.displayFileResult=function(fileResult,ix){ var errGroups=[]; var errGroup=""; var summaries=[]; + var pointColour=vMap.colours[ix % vMap.colours.length]; xhtml=xhtml + "
"; - if(fileResult.valid){xhtml=xhtml + "

" + fileResult.filename + " " + fileResult.message + "

"; + if(fileResult.valid){ + xhtml=xhtml + "

  " + fileResult.filename + " " + fileResult.message + "

"; } else{ - xhtml=xhtml + "

" + fileResult.filename + " " + fileResult.message + "

"; + xhtml=xhtml + "

  " + fileResult.filename + " " + fileResult.message + "

"; }; xhtml=xhtml + "

" + fileResult.filesize + " bytes

"; xhtml=xhtml + "

" + fileResult.checkers.join(", ") + "

"; diff --git a/app/static/js/validation-map.js b/app/static/js/validation-map.js index 048f667..015bc67 100644 --- a/app/static/js/validation-map.js +++ b/app/static/js/validation-map.js @@ -41,6 +41,11 @@ vMap.showOnValidationMap=function(geoJSON,fileName,ix){ console.log(geoJSON); console.log(fileName); console.log(ix); + + var pointColour=vMap.colours[ix % vMap.colours.length]; + var xhtml="

" + pointColour + " " + fileName + "

"; + $("#res_Files").append(xhtml); + // show GeoJSON features on map - add popups and tooltips L.geoJSON(geoJSON,{ "pointToLayer":function(feature,latlng){ @@ -88,7 +93,7 @@ vMap.pointToLayer=function(feature,latlng,ix){ var markerOpts={ "id":feature.properties.LOCA_ID, "radius":6, - "fillColor":vMap.colours[ix], + "fillColor":vMap.colours[ix % vMap.colours.length], "color":"#000", "weight":1, "opacity":1, From 2bc305e0e67f14eb623853aece8d889f6ded2f38 Mon Sep 17 00:00:00 2001 From: Simon Burden Date: Tue, 26 Mar 2024 09:07:52 +0000 Subject: [PATCH 21/22] remove-hex-colour-debug-output --- app/static/js/validation-map.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/static/js/validation-map.js b/app/static/js/validation-map.js index 015bc67..e46d25d 100644 --- a/app/static/js/validation-map.js +++ b/app/static/js/validation-map.js @@ -43,7 +43,7 @@ vMap.showOnValidationMap=function(geoJSON,fileName,ix){ console.log(ix); var pointColour=vMap.colours[ix % vMap.colours.length]; - var xhtml="

" + pointColour + " " + fileName + "

"; + var xhtml="

  " + fileName + "

"; $("#res_Files").append(xhtml); // show GeoJSON features on map - add popups and tooltips From b45b6d734633cf29b73db33241a3ad86c437985f Mon Sep 17 00:00:00 2001 From: Edd Lewis - BGS Date: Wed, 27 Mar 2024 09:56:45 +0000 Subject: [PATCH 22/22] Change fill opacity to 0.9 --- app/static/js/validation-map.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/static/js/validation-map.js b/app/static/js/validation-map.js index e46d25d..8c18414 100644 --- a/app/static/js/validation-map.js +++ b/app/static/js/validation-map.js @@ -97,7 +97,7 @@ vMap.pointToLayer=function(feature,latlng,ix){ "color":"#000", "weight":1, "opacity":1, - "fillOpacity":0.7, + "fillOpacity":0.9, "stroke":true }; var marker=L.circleMarker(latlng,markerOpts);