Skip to content

Conversation

@Kcheung42
Copy link
Contributor


Purpose

Add ability to remove single layer via server mode

Related Issues

Closes GEO-51

Submission Checklist

  • Commits include the JIRA issue and the #review hashtag (e.g. GEO-### #review <comment>)
  • Code passes linter rules (clj-kondo --lint src)
  • Feature(s) work when compiled (clojure -M:compile-cljs)

Testing

  1. Launch geosync-server in your repl. Modify params according do your
    development setup.
(do
  (use '[geosync.cli])
  (start-server! (add-derived-params
                  {:geosync-server-host "localhost"
                   :geosync-server-port 8082
                   :geoserver-username  "admin"
                   :geoserver-password  "geoserver"
                   :geoserver-rest-uri  "http://localhost:8080/geoserver/rest"
                   :file-watcher        {:dir             "/srv/data"
                                         :workspace-regex {"fire_detections" #"(?<=/)fire_detections/[\w]+"}
                                         :dev             false}})))
  1. Register fire detection layers from data.pyregence.org by scp-ing
    the folder to the fire_detections directory that is monitored by the
    file-watcher (i.e. /srv/data/fire_detections). Make sure the viirs
    folder does not already exist otherwise layers will not be registered.
cd /srv/data/fire_detections
scp -r geoserver@data:/var/www/html/fire_detections/viirs .
  1. Send the request to remove a single layer from the workspace.
(def request {:action              "remove",
              :geoserver-workspace "fire_detections_viirs",
              :geoserver-layer     "viirs-timestamped_20210924_150000"
              :response-host       "my.server.org",
              :response-port       5555})

(sockets/send-to-server! "localhost" 8082 (json/write-str request))
  1. Check Geoserver that the layer is removed but the workspace and
    other layers still exist.

@sirmspencer
Copy link
Contributor

README.org
157 1 -> 3

src/geosync/core.clj
490, this check is redundant. You are already checking each response on 496. You can save a api call by removing this check.
491, use [acc cur]. Accumulator and current are pretty standard.

src/geosync/rest_api.clj
164, 224, I think these should just always be set to recurse=true. If you have it false, and forgot to delete the layer, it fails or leaves behind data in the server. If you already deleted the layer separately, it causes no issue to leave it true. Revert the multi arity function and just add recurse=true

@Oliver-BE Oliver-BE changed the base branch from development to main June 12, 2023 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants