You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sdap.apache.org by nc...@apache.org on 2023/04/25 18:51:06 UTC

[incubator-sdap-nexus] branch release/1.1.0 updated: SDAP-459 - Ensure min/max lat/lon values are float (#243)

This is an automated email from the ASF dual-hosted git repository.

nchung pushed a commit to branch release/1.1.0
in repository https://gitbox.apache.org/repos/asf/incubator-sdap-nexus.git


The following commit(s) were added to refs/heads/release/1.1.0 by this push:
     new 19237f3  SDAP-459 - Ensure min/max lat/lon values are float (#243)
19237f3 is described below

commit 19237f3a2a5841a371374e3c3f23c026c780c82d
Author: Riley Kuttruff <72...@users.noreply.github.com>
AuthorDate: Tue Apr 25 11:51:00 2023 -0700

    SDAP-459 - Ensure min/max lat/lon values are float (#243)
    
    * SDAP-459 - Ensure min/max lat/lon values are float
    
    * Update CHANGELOG.md
    
    * SDAP-459: Explicitly define some tile fields
    
    Min/max lat/lon defined as pdouble instead of defaulting to string
    
    * Changelog
    
    * Undid float casting
    
    * Update CHANGELOG.md
    
    ---------
    
    Co-authored-by: rileykk <ri...@jpl.nasa.gov>
---
 CHANGELOG.md                                |  1 +
 docker/solr/cloud-init/create-collection.py | 27 +++++++++++++++++----------
 2 files changed, 18 insertions(+), 10 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 841ed00..933ccb6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 - Deletebyquery: Parameter to set the number of rows to fetch from Solr. Speeds up time to gather tiles to delete; especially when there is a lot of them.
 - Added Saildrone's `baja_2018` insitu dataset.
 - SDAP-454: Added new query parameter `prioritizeDistance` to matchup algorithm
+- SDAP-459: Added explicit definitions of min/max lat/lon values in nexustiles Solr collection creation script
 ### Changed
 - SDAP-443:
   - Replacing DOMS terminology with CDMS terminology:
diff --git a/docker/solr/cloud-init/create-collection.py b/docker/solr/cloud-init/create-collection.py
index eb77d00..682dd62 100755
--- a/docker/solr/cloud-init/create-collection.py
+++ b/docker/solr/cloud-init/create-collection.py
@@ -125,16 +125,23 @@ try:
             else:
                 logging.error("Error creating field type 'geo': {}".format(field_type_response.text))
 
-            field_payload = json.dumps({
-                "add-field": {
-                    "name": "geo",
-                    "type": "geo"}})
-            logging.info("Creating field 'geo'...")
-            field_response = requests.post(url=schema_api, data=field_payload)
-            if field_response.status_code < 400:
-                logging.info("Success.")
-            else:
-                logging.error("Error creating field 'geo': {}".format(field_response.text))
+            def add_field(schema_api, name, type):
+                field_payload = json.dumps({
+                    "add-field": {
+                        "name": name,
+                        "type": type}})
+                logging.info(f"Creating {type} field '{name}'...")
+                field_response = requests.post(url=schema_api, data=field_payload)
+                if field_response.status_code < 400:
+                    logging.info("Success.")
+                else:
+                    logging.error(f"Error creating field '{name}': {field_response.text}")
+
+            add_field(schema_api, 'geo', 'geo')
+            add_field(schema_api, 'tile_max_lat', 'pdouble')
+            add_field(schema_api, 'tile_min_lat', 'pdouble')
+            add_field(schema_api, 'tile_max_lon', 'pdouble')
+            add_field(schema_api, 'tile_min_lon', 'pdouble')
 
 finally:
     zk.stop()