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
- In the Q2G panel, locate the Workspace section
- Click the "Create New Workspace" button
- Enter a name for your workspace
- Click "Create"
- The new workspace will be automatically selected
Workspace Creation Process
When you create a workspace, Q2G:
- Validates the workspace name
- Creates the workspace on GeoServer
- Sets default namespace
- Refreshes the workspace list
- 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
Selecting Workspaces
Workspace Dropdown
To select a workspace:
- Click the Workspace dropdown menu
- Select the workspace you want to work with
- 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
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:
- Select a workspace
- Look at the "Datastores" section in the plugin
- 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:
- Select the datastore in the list
- Click the "Delete" button
- Confirm the deletion
- The datastore and all its layers will be deleted
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:
- Detects the PostGIS connection
- Creates or uses an existing datastore
- Registers the layer in GeoServer
- 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
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
- Select the workspace you want to delete
- Click the "Delete Workspace" button
- Confirm the deletion
- The workspace and all its contents will be deleted
Deletion Process
When you delete a workspace, Q2G:
- Verifies the workspace exists
- Deletes all layers in the workspace
- Deletes all datastores
- Deletes all styles
- Deletes the workspace itself
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
- Layer Upload - Upload layers to workspaces
- Preview & Visualization - Preview workspace layers
- Advanced Features - Learn advanced workspace management