Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make CoastSeg work without an active map instance #228

Closed
7 tasks
2320sharon opened this issue Feb 9, 2024 · 2 comments
Closed
7 tasks

Make CoastSeg work without an active map instance #228

2320sharon opened this issue Feb 9, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@2320sharon
Copy link
Collaborator

Currently, CoastSeg only works properly when it is loaded with the map. In order to make CoastSeg more flexible and to be used in scripts and such Coastseg needs to be able to run without a map that users click ROIs and such on. This means any functions that rely on reading layers from the map, require the map to be instantiated, or in any way directly rely on the map must be modified they can work properly with or without the map. This will also mean some error messages need to be updated to tell the user to pass information or objects like ROIs or different parameters.

Tasks

  • make the creation of map components optional in the init method
  • make the creation of the toolbars optional in the map creation
  • make the error messages work with or without the map being present
  • do not read from layers directly
  • make calls that remove or add layers to the map check if a map instance is defined first and do nothing if the map was not defined
  • allow users to add rois and various features without having to load them on the map
  • when extracting shorelines don't read from the selected set instead allow the user to pass in a set of rois
@2320sharon 2320sharon added the enhancement New feature or request label Feb 9, 2024
@2320sharon 2320sharon self-assigned this Feb 9, 2024
2320sharon added a commit that referenced this issue Feb 14, 2024
@2320sharon
Copy link
Collaborator Author

2320sharon commented Feb 14, 2024

Tasks

save_config

  • allow user to pass in ROI IDs to save to save_config

  • Don't use selected layer to save ROI

        # selected_layer must contain selected ROI
        selected_layer = self.map.find_layer(ROI.SELECTED_LAYER_NAME)
        exception_handler.check_empty_roi_layer(selected_layer)
        logger.info(f"self.rois.roi_settings: {self.rois.roi_settings}")
        
        # if the rois do not have any settings then save the currently loaded settings to the ROIs
        if not self.rois.get_roi_settings():
            filepath = filepath or os.path.abspath(os.getcwd())
            roi_settings = common.create_roi_settings(
                settings, selected_layer.data, filepath
            )
            self.rois.set_roi_settings(roi_settings)

2320sharon added a commit that referenced this issue Feb 21, 2024
@dbuscombe-usgs
Copy link
Member

We'll call this, when ready, the 'headless mode' of the program, and we'll make a wiki page devoted to it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants