Understanding Workspaces

What is a Workspace?

A workspace is a logical grouping of related layers and datastores in GeoServer. Each workspace is independent and can have:

  • Its own set of layers
  • Its own datastores and coverage stores
  • Its own styles
  • Its own WMS/WFS services

Workspace Benefits

  • Organization: Group related layers together
  • Isolation: Separate different projects
  • Management: Easy to manage and maintain
  • Permissions: Control access by workspace

Naming Conventions

Best practices for workspace names:

  • Use lowercase letters, numbers, and underscores
  • Avoid spaces and special characters
  • Use descriptive names (e.g., "project_name", "department_data")
  • Keep names short but meaningful

Creating Workspaces

Using Q2G

  1. In the Q2G panel, locate the Workspace section
  2. Click the "Create New Workspace" button
  3. Enter a name for your workspace
  4. Click "Create"
  5. The new workspace will be automatically selected

Workspace Creation Process

When you create a workspace, Q2G:

  1. Validates the workspace name
  2. Creates the workspace on GeoServer
  3. Sets default namespace
  4. Refreshes the workspace list
  5. Selects the new workspace

Validation Rules

  • Workspace name must be unique
  • Name must be 1-50 characters
  • Only alphanumeric characters and underscores allowed
  • Cannot start with a number
Tip: Create a new workspace for each project to keep things organized.

Selecting Workspaces

Workspace Dropdown

To select a workspace:

  1. Click the Workspace dropdown menu
  2. Select the workspace you want to work with
  3. The plugin will load the workspace's layers and datastores

Workspace Information

When a workspace is selected, you can see:

  • List of layers in the workspace
  • Available datastores
  • Coverage stores (for raster data)
  • Workspace properties

Layer Management in Workspaces

Viewing Layers

When you select a workspace, you can see all layers published in that workspace:

  • Layer names are displayed in a list
  • Click on a layer to select it
  • Use the workspace dropdown to switch between workspaces

Layer Operations

Available operations for layers in a workspace:

  • Delete Layer - Remove the layer from GeoServer using the delete button
  • View in GeoServer - Access the layer through GeoServer's web interface
  • Preview Layer - View the layer on an interactive map
Tip: To manage layer styles, use the SLD upload feature when uploading layers or access GeoServer's web interface directly.

Understanding Datastores

What is a Datastore?

A datastore is a connection to a data source in GeoServer. Types include:

  • File-based: Shapefiles, GeoPackages, etc.
  • Database: PostGIS, MySQL, Oracle, etc.
  • Web Services: WFS, WMS, etc.

Datastore Properties

Property Description
Name Unique identifier for the datastore
Type Type of data source (Shapefile, PostGIS, etc.)
Workspace The workspace this datastore belongs to
Connection Parameters Details for connecting to the data source
Enabled Whether the datastore is active

Managing Datastores

Viewing Datastores

To see datastores in the current workspace:

  1. Select a workspace
  2. Look at the "Datastores" section in the plugin
  3. You'll see a list of available datastores

Datastore Information

For each datastore, you can see:

  • Datastore name
  • Data source type
  • Connection status
  • Number of layers

Deleting Datastores

To delete a datastore:

  1. Select the datastore in the list
  2. Click the "Delete" button
  3. Confirm the deletion
  4. The datastore and all its layers will be deleted
Warning: Deleting a datastore will delete all layers associated with it. This action cannot be undone.

PostGIS Datastores

What is PostGIS?

PostGIS is a spatial extension for PostgreSQL that allows storing and querying geographic data directly in a database.

Creating PostGIS Datastores

When you upload a PostGIS layer, Q2G automatically:

  1. Detects the PostGIS connection
  2. Creates or uses an existing datastore
  3. Registers the layer in GeoServer
  4. Publishes the layer

PostGIS Configuration

You may need to provide PostGIS credentials:

  • Host: Database server address
  • Port: Database port (default: 5432)
  • Database: Database name
  • User: Database username
  • Password: Database password
Tip: PostGIS credentials are stored locally in postgis.ini for convenience.

Coverage Stores

What is a Coverage Store?

A coverage store is a connection to raster data (images, satellite imagery, etc.) in GeoServer.

Supported Raster Formats

  • GeoTIFF
  • JPEG2000
  • PNG
  • Other georeferenced image formats

Managing Coverage Stores

Coverage stores are managed similarly to datastores:

  • View available coverage stores
  • See associated coverage layers
  • Delete coverage stores if needed

Deleting Workspaces

Using Q2G

  1. Select the workspace you want to delete
  2. Click the "Delete Workspace" button
  3. Confirm the deletion
  4. The workspace and all its contents will be deleted

Deletion Process

When you delete a workspace, Q2G:

  1. Verifies the workspace exists
  2. Deletes all layers in the workspace
  3. Deletes all datastores
  4. Deletes all styles
  5. Deletes the workspace itself
Caution: Deleting a workspace cannot be undone. All data will be permanently deleted from GeoServer. Make sure you have backups if needed.

Workspace Organization Best Practices

Organization Strategies

  • By Project: One workspace per project
  • By Department: One workspace per department
  • By Data Type: Separate workspaces for different data types
  • By Environment: Separate workspaces for dev, test, production

Naming Conventions

  • Use descriptive names
  • Include project or department identifier
  • Use consistent naming across workspaces
  • Document the purpose of each workspace

Maintenance

  • Regularly review and clean up unused workspaces
  • Keep datastores organized and named clearly
  • Document datastore purposes and connections
  • Monitor workspace size and performance

Troubleshooting Workspace Issues

Cannot Create Workspace

  • Check your GeoServer connection
  • Verify you have admin permissions
  • Ensure workspace name is valid
  • Check if workspace name already exists

Workspace Not Appearing

  • Click "Refresh" to reload workspace list
  • Check your GeoServer connection
  • Verify the workspace exists on GeoServer

Cannot Delete Workspace

  • Ensure no layers are using the workspace
  • Check if you have delete permissions
  • Try deleting layers first, then the workspace

Datastore Connection Failed

  • Verify connection parameters are correct
  • Check if the data source is accessible
  • For PostGIS, verify database is running
  • Check firewall and network connectivity

Next Steps