Creating a Layer
Layers are the primary geospatial data building blocks in OSMap. They structure geographic features (like points, lines, or polygons) and their associated attributes fetched from your data stores (e.g., PostGIS).
1. Access Layer Management
- Open the application.
- In the sidebar navigation menu, click on Layers.
- Click the Add New Layer button (usually located in the top-right corner of the management list view).
2. Fill in Layer Details
The modal form is split into general parameters and database connection details:
- Title: A descriptive name for the layer (e.g.,
Train StationsorForest Boundaries). - Layer Name: A unique, system-level identifier. This is auto-generated based on the Title by converting it to lowercase and replacing spaces/special characters with underscores.
- Geometry Type: Choose the type of geospatial feature data this layer will contain:
Point/MultiPoint(e.g., coordinates, landmarks, stations).LineString/MultiLineString(e.g., routes, roads, railways).Polygon/MultiPolygon(e.g., building footprints, region boundaries, land plots).
- Description: An optional text describing what the layer represents or how it is utilized.
- Workspace: Select the organizational workspace for the layer.
- Datastore: Choose the target database store (must be a postgis connection).
- Upsert Key (Optional): Define a key field (e.g.,
id,gid) that the engine will use to resolve update/insert conflicts when editing feature records. - Private Layer / Public Layer: Toggle whether this layer is restricted to specific users/roles or is publicly viewable.
- WMS Enabled / WMS Disabled: Toggle to enable Web Map Service (WMS) rendering for complex or large layers.
3. Configure Layer Attributes
Attributes represent the schema columns of your database table and define how feature details are captured or displayed:
- Under the Layer Attributes section, click Add Attribute to create new fields.
- For each attribute, define:
- Label: User-friendly field name.
- Type: Data type (e.g., String, Number, Date, Boolean).
- Form Type: Specify form elements (e.g., Text input, Dropdown selection, DatePicker) when editing feature records.
- Visible: Toggle whether this attribute is visible in the map view popovers or tables.
- You can reorder attributes using drag handles to customize their display sequence.
4. Save and Publish
Once configured, click Create Layer to publish the layer. The backend will provision the tables and link the layer to your selected PostGIS datastore.
Method 2: Importing a Layer (Shapefile / GeoPackage)
Instead of creating a layer schema and attributes manually, you can upload existing geospatial files directly to provision a new layer:
- Navigate to the Layers list page.
- Click the Import File button.
- In the upload dialog:
- Upload File: Select or drag-and-drop a ZIP archive containing the Shapefile files (
.shp,.shx,.dbf) or a raw GeoPackage file (.gpkg). - Target Workspace: Select the workspace where the layer should reside.
- Target Datastore: Select the active PostGIS datastore connection to load the table into.
- Upload File: Select or drag-and-drop a ZIP archive containing the Shapefile files (
- Click Import Now. The system will process the spatial data, upload the geometries, map attributes automatically, and publish the new layer.
Method 3: Publishing Layers from a PostGIS Connection
If you already have spatial tables configured in your PostGIS database, you can pull and register them as OSMap layers without re-uploading the data:
- Navigate to the Layers list page.
- Click the Add New Layer button.
- Select your target Workspace and Datastore (which connects to your target database) from the dropdown selectors at the top.
- The system will query the database schema and load a list of all spatial tables detected.
- In the table list:
- Browse or search for your database table by name.
- Click the Publish button next to the desired table.
- The system will publish the layer in the GeoServer mapping engine and register it in the OSMap database. The status badge will change to Published.
- Once published, the layer will be available in the map editor's layer pool.