idn-au / fuzzy-geometries

JavaScript implementation of the SUFF model - https://w3id.org/suff/
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Fuzzy Geometries SUFF Software

This repo is for the software implementation of the SUFF model in JavaScript, which will be an NPM package as well as an online test UI, available here - suff.idnau.org (yet to be deployed).

Table of Contents

The SUFF Model

The Spatial Uncertainty for Features & Functions (SUFF) model is a new cutting-edge model to be included in GeoSPARQL 1.3 which provides a way to describe spatial uncertainty in data.

Features in the SUFF model fit into one of three levels of measurement (see diagram below):

SUFF Model Diagram Credit: Nicholas Car - https://w3id.org/suff/

Example of a SUFF feature in RDF:

PREFIX geo: <http://www.opengis.net/ont/geosparql#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX sdo: <https://schema.org/>
PREFIX suff: <http://w3id.org/suff/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>

<https://example.com/feature/feature1>
    a geo:Feature ;
    sdo:name "Test SUFF feature" ;
    geo:hasGeometry [
        a geo:GeometryCollection ;
        rdfs:_1 [
            a geo:Geometry ;
            geo:asWKT "POLYGON ((...))"^^geo:wktLiteral ;
            rdf:value "0.3"^^xsd:double ;
        ] ;
        rdfs:_2 [
            a geo:Geometry ;
            geo:asWKT "POLYGON ((...))"^^geo:wktLiteral ;
            rdf:value "0.5"^^xsd:double ;
        ] ;
        rdfs:_3 [
            a geo:Geometry ;
            geo:asWKT "POLYGON ((...))"^^geo:wktLiteral ;
            rdf:value "0.8"^^xsd:double ;
        ] ;
    ];
.

Installation

NPM Package

To install, run the following using your favourite npm package manager (not yet published):

pnpm add suff

or

yarn add suff

or

npm install suff

Test UI

This project uses PNPM, so ensure that's installed first. Clone this repo then run the following at the project root directory to install the test UI application on your machine:

pnpm install

Usage

NPM Package

An example of importing & using the SUFF package using the blur function:

import { blur } from "suff";

const rdfDataStr = "...";

const geometries = blur(rdfDataStr);

Functions available from the NPM package (TBD):

Test UI

Run the following to run a dev server for the test UI application:

cd suff-rdf
pnpm build
cd ../suff-test
pnpm dev

Software Implementation

  1. determine case - nominal, ordinal or "numeric"
  2. convert to geojson SUFF Model Diagram
  3. create 0 & 1 geometries if applicable SUFF Model Diagram
  4. convert geoms to points and create TIN network SUFF Model Diagram
  5. sample point grid from TIN network SUFF Model Diagram
  6. create contours from point grid SUFF Model Diagram
  7. display a large number of contours with opacity to visualise blurring SUFF Model Diagram

Copyright and License

© Indigenous Data Network 2024. This software is licensed for reuse using the BSD 3-Clause license.

Contact

Jamie Feiss
Data Infrastructure Developer
Indigenous Data Network
University of Melbourne
jamie.feiss@unimelb.edu.au