0.1.11 • Published 11 days ago

@jsse/geobox v0.1.11

Weekly downloads
-
License
MIT
Repository
-
Last release
11 days ago

@jsse/geobox

geo-json-schemas (and maybe more to come!)

Install

pnpm add @jsse/geobox
# or
npm i @jsse/geobox
# or
yarn add @jsse/geobox

Example (wip)

import {Type } from "@sinclair/typebox";
import * as geobox from "./dist/index.js";

const pointSchemaBabydog = geobox.PointFeature(
    Type.Object({ dingo: Type.String() })
);

console.log(JSON.stringify(pointSchemaBabydog, null, 2));

// {
//   "type": "object",
//   "properties": {
//     "type": {
//       "const": "Feature",
//       "type": "string"
//     },
//     "id": {
//       "anyOf": [
//         {
//           "type": "string"
//         },
//         {
//           "type": "number"
//         }
//       ]
//     },
//     "geometry": {
//       "title": "GeoJSON Point",
//       "type": "object",
//       "properties": {
//         "type": {
//           "const": "Point",
//           "type": "string"
//         },
//         "coordinates": {
//           "title": "GeoJSON coordinate",
//           "description": "coordinate: [longitude, latitude] or [longitude, latitude, elevation/z]",
//           "anyOf": [
//             {
//               "title": "GeoJSON coordinate 2d",
//               "description": "coordinate: [longitude, latitude]",
//               "type": "array",
//               "items": [
//                 {
//                   "title": "Longitude",
//                   "description": "longitude",
//                   "type": "number"
//                 },
//                 {
//                   "title": "Latitude",
//                   "type": "number"
//                 }
//               ],
//               "additionalItems": false,
//               "minItems": 2,
//               "maxItems": 2
//             },
//             {
//               "title": "GeoJSON coordinate 3d",
//               "description": "coordinate: [longitude, latitude, elevation/z]",
//               "type": "array",
//               "items": [
//                 {
//                   "title": "Longitude",
//                   "description": "longitude",
//                   "type": "number"
//                 },
//                 {
//                   "title": "Latitude",
//                   "type": "number"
//                 },
//                 {
//                   "type": "number"
//                 }
//               ],
//               "additionalItems": false,
//               "minItems": 3,
//               "maxItems": 3
//             }
//           ]
//         }
//       },
//       "required": [
//         "type",
//         "coordinates"
//       ]
//     },
//     "properties": {
//       "type": "object",
//       "properties": {
//         "dingo": {
//           "type": "string"
//         }
//       },
//       "required": [
//         "dingo"
//       ]
//     }
//   },
//   "required": [
//     "type",
//     "geometry",
//     "properties"
//   ]
// }

console.log(JSON.stringify(Type.Strict(pointSchemaBabydog), null, 2));
// {
//   "type": "object",
//   "properties": {
//     "type": {
//       "const": "Feature",
//       "type": "string"
//     },
//     "id": {
//       "anyOf": [
//         {
//           "type": "string"
//         },
//         {
//           "type": "number"
//         }
//       ]
//     },
//     "geometry": {
//       "title": "GeoJSON Point",
//       "type": "object",
//       "properties": {
//         "type": {
//           "const": "Point",
//           "type": "string"
//         },
//         "coordinates": {
//           "title": "GeoJSON coordinate",
//           "description": "coordinate: [longitude, latitude] or [longitude, latitude, elevation/z]",
//           "anyOf": [
//             {
//               "title": "GeoJSON coordinate 2d",
//               "description": "coordinate: [longitude, latitude]",
//               "type": "array",
//               "items": [
//                 {
//                   "title": "Longitude",
//                   "description": "longitude",
//                   "type": "number"
//                 },
//                 {
//                   "title": "Latitude",
//                   "type": "number"
//                 }
//               ],
//               "additionalItems": false,
//               "minItems": 2,
//               "maxItems": 2
//             },
//             {
//               "title": "GeoJSON coordinate 3d",
//               "description": "coordinate: [longitude, latitude, elevation/z]",
//               "type": "array",
//               "items": [
//                 {
//                   "title": "Longitude",
//                   "description": "longitude",
//                   "type": "number"
//                 },
//                 {
//                   "title": "Latitude",
//                   "type": "number"
//                 },
//                 {
//                   "type": "number"
//                 }
//               ],
//               "additionalItems": false,
//               "minItems": 3,
//               "maxItems": 3
//             }
//           ]
//         }
//       },
//       "required": [
//         "type",
//         "coordinates"
//       ]
//     },
//     "properties": {
//       "type": "object",
//       "properties": {
//         "dingo": {
//           "type": "string"
//         }
//       },
//       "required": [
//         "dingo"
//       ]
//     }
//   },
//   "required": [
//     "type",
//     "geometry",
//     "properties"
//   ]
// }
0.1.11

11 days ago

0.1.10

29 days ago

0.1.9

1 month ago

0.1.7

1 month ago

0.1.4

1 month ago

0.1.3

1 month ago

0.1.5

1 month ago

0.1.2

2 months ago

0.1.1

3 months ago

0.1.0

4 months ago

0.0.12

5 months ago

0.0.10

7 months ago

0.0.11

7 months ago

0.0.3

10 months ago

0.0.9

7 months ago

0.0.8

7 months ago

0.0.5

9 months ago

0.0.4

10 months ago

0.0.7

7 months ago

0.0.6

7 months ago

0.0.2

11 months ago

0.0.1

11 months ago