Skip to content

Commit

Permalink
feat!: add more geosparql output variants (#26)
Browse files Browse the repository at this point in the history
Adds bbox, centroid, length, area; updates `@ngageoint/geopackage`
  • Loading branch information
redmer authored Mar 27, 2024
1 parent f12c143 commit fef3b5b
Show file tree
Hide file tree
Showing 20 changed files with 759 additions and 630 deletions.
25 changes: 20 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,16 @@ Options:
-o, --output Output quads file [string]
--format Override output format (default: nquads)
[choices: "nq", "nquads", "trig", "nt", "ntriples", "ttl", "turtle"]
--bounding-box Limit features to bounding box [string]
--bounding-box-crs Coordinate Reference System code [string]
--bbox Limit features to bounding box [string]
--bbox-crs Coordinate Reference System code [string]
--only-layers Only output named feature layers and attribute ta
bles [array]
--include-binary-values Output binary values [boolean]
--base-iri Base IRI [string]
--model Data meta model [choices: "facade-x"]
--geosparql Output GeoSPARQL
[array] [choices: "wkt", "geojson", "bbox", "centroid", "length-area"] [defaul
t: ["wkt"]]
```

## Options
Expand All @@ -40,16 +43,28 @@ Basic input and output serializations can be set with the following options:

Work with large GeoPackages by limiting the output features, output tables and binary values:

- `--bounding-box` limits the the output features to those in this area (default CRS: WGS84)
- `--bounding-box-crs` indicates the CRS for the aforementioned bounding box. Supply a EPSG code (web lookup with EPSG.io) or a projection WKT.
- `--bbox` limits the the output features to those in this area (default CRS: WGS84)
- `--bbox-crs` indicates the CRS for the aforementioned bounding box. Supply a EPSG code (web lookup with EPSG.io) or a projection WKT.
- `--only-layers` limits which feature layers (or attribute tables!) are output.
- `--include-binary-values` overrides the default of skipping binary values. These will be base64 encoded string values with a `^^xsd:base64Binary` data type. NULL values are never output.

Modify the model and types of the output triples or quads:

- `--base-iri`: set the relative base for the output RDF data. By default, this value is derived from the present working directory.
- `--model`: the GeoPackage tables are not natively RDF data, so a module is programmed to generating triples according to a data meta-model. Included modules:
- default: [`facade-x`](#model-facade-x)
- **default**: [`facade-x`](#model-facade-x)
- `--geosparql`: modify which GeoSPARQL geometries, serializations and properties are output. Only the WKT literal is in layer native CRS, all other are calculated and/or projected.
Multiple values (space separated) are allowed.
Included feature predicates are listed in the table below.

| Option | GeoSPARQL feature predicates | Note |
| ------------------- | ----------------------------------------- | --------------------------------------------------------------- |
| `wkt` (**default**) | `geo:hasGeometry/geo:asWKT` | Output the feature's geometry as a WKT string literal |
| `geojson` | `geo:hasGeometry/geo:asGeoJSON` | Output the feature's geometry as a WGS84 GeoJSON string literal |
| `bbox` | `geo:hasBoundingBox` | Output a feature's bounding box |
| `centroid` | `geo:hasCentroid` | Output a feature's centroid point |
| `length-area` | `geo:hasMetricLength` `geo:hasMetricArea` | Output the length (in m) and area (in m²) of the feature |
| _always on_ | `rdf:type geo:Feature` | Output the feature class |

## RDF output

Expand Down
Loading

0 comments on commit fef3b5b

Please sign in to comment.