Vector Basic

Vector Basic AIKP provides functionality to publish and visualise shapefile and GeoJSON vector data in webUI.

Features

  • Input shapefiles (.shp) or GeoJSON format

  • Preserve geometry and attribute information

  • Support for all common shapefile geometry types (Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon)

  • Customizable output file naming

  • Optional per-feature icons

  • Integration with OCLI’s COS storage system

Prerequisite

  • rsync to your OCLI home folder input data (shapefile or geojson vector data)

CLI workflow

Create a project (if required)

create -n project_name -a

Create Task.

task create -t ocli.aikp.vector_basic -n task_name --activate

Set input vector file

task set file_path=/path/to/my/shapefile.shp

Optional: Output of this command is tabular view of data parameters (attribute table)

 task template inspect

Optional: Select the column that will be used for grouping, default is “index” (every record will be colored separately)

task set group_by_column=<column name>

Optional: Configure the colormap. Default `”terrain_r”. If user input is invalid, a list of valid options will be printed to screen. The list of available colormaps can be found here https://matplotlib.org/stable/gallery/color/colormap_reference.html

task set colormap=<colormap name>

Optional: Configure alpha/transparency channel, with 0 completely transparent and 1 not-transparent. The default is 0.5.

task set alpha=<float[0, 1]>

Optional: Render point features with a custom icon instead of the default marker. Set icon_column to a column holding an icon value per feature, and icon_type to select how that value is interpreted (default nato-sidc; see Supported icon types below). Every value in icon_column is rendered into a generated icon atlas published alongside the document. If any value is invalid, ai makegeojson fails with an error listing the bad values.

When icon_column is set, the document is published without categorical fill/stroke coloring or a legend, and each point’s color and size are set automatically for a clear, undistorted icon display.

task set icon_column=<column name>
task set icon_type=nato-sidc
task make recipe
ai makegeojson
ai upload
ai publish post

Supported icon types

  • nato-sidc — column holds a NATO SIDC code (MIL-STD-2525/APP-6, numeric format). A value is valid only if the military_symbol package can render a symbol for it.

Implementation Details

The module reads shapefiles using GeoPandas and converts them to GeoJSON format. Each feature in the shapefile is saved as a separate GeoJSON file, maintaining its properties and geometry. The module supports all common shapefile geometry types and handles attributes from the shapefile.

Dependencies

  • GeoPandas

  • Shapely

  • OCLI core libraries

  • military_symbol and cairosvg (only exercised when icon_column is set)