From c348924838f18be83842243686eb905092176a54 Mon Sep 17 00:00:00 2001 From: "jeremy@jermolene.com" Date: Tue, 11 Apr 2023 17:14:51 +0100 Subject: [PATCH] Split docs into separate tabs --- plugins/tiddlywiki/geospatial/docs.tid | 132 +----------------- .../geospatial/docs/geodifference.tid | 44 ++++++ .../geospatial/docs/geodistance.tid | 18 +++ .../geospatial/docs/geointersect.tid | 13 ++ .../tiddlywiki/geospatial/docs/geolookup.tid | 15 ++ plugins/tiddlywiki/geospatial/docs/geomap.tid | 15 ++ .../geospatial/docs/geonearestpoint.tid | 21 +++ .../tiddlywiki/geospatial/docs/geopoint.tid | 27 ++++ .../tiddlywiki/geospatial/docs/geounion.tid | 13 ++ .../tiddlywiki/geospatial/docs/olc-decode.tid | 12 ++ .../tiddlywiki/geospatial/docs/olc-encode.tid | 13 ++ 11 files changed, 192 insertions(+), 131 deletions(-) create mode 100644 plugins/tiddlywiki/geospatial/docs/geodifference.tid create mode 100644 plugins/tiddlywiki/geospatial/docs/geodistance.tid create mode 100644 plugins/tiddlywiki/geospatial/docs/geointersect.tid create mode 100644 plugins/tiddlywiki/geospatial/docs/geolookup.tid create mode 100644 plugins/tiddlywiki/geospatial/docs/geomap.tid create mode 100644 plugins/tiddlywiki/geospatial/docs/geonearestpoint.tid create mode 100644 plugins/tiddlywiki/geospatial/docs/geopoint.tid create mode 100644 plugins/tiddlywiki/geospatial/docs/geounion.tid create mode 100644 plugins/tiddlywiki/geospatial/docs/olc-decode.tid create mode 100644 plugins/tiddlywiki/geospatial/docs/olc-encode.tid diff --git a/plugins/tiddlywiki/geospatial/docs.tid b/plugins/tiddlywiki/geospatial/docs.tid index 039805f1c..39325c156 100644 --- a/plugins/tiddlywiki/geospatial/docs.tid +++ b/plugins/tiddlywiki/geospatial/docs.tid @@ -1,133 +1,3 @@ title: $:/plugins/tiddlywiki/geospatial/docs -! Widgets - -!! `<$geomap>` widget - -The `<$geomap>` widget displays an interactive map using [[Leaflet.js|https://leafletjs.com/]]. - -The following attributes are supported: - -|!Attribute |!Description | -|''state'' |The title of a state tiddler used to track the state of the map in the `zoom`, `long` and `lat` fields | -|''layers'' |A filter identifying the GeoJSON layer tiddlers to be displayed on the map | -|''markers'' |A filter identifying the GeoJSON marker tiddlers to be displayed on the map | - -! Filter Operators - -!! `geopoint` operator - -The `geopoint` operator converts separate latitude, longitude and (optionally) altitude numbers into a [[GeoJSON Point Feature]] that can be used with other geospatial primitives. - -The coordinates are specified as two or three operands: - -``` -[geopoint,,] -``` - -Any operands that cannot be interpreted as a valid number will be interpreted as the value zero. - -For example: - -``` -<$text text={{{ [geopoint[51.751944],[-1.257778]] }}}/> -``` - -Returns: - -``` -{"type":"Feature","properties":{},"geometry":{"type":"Point","coordinates":[51.751944,-1.257778,0]}} -``` - -!! `geodistance` operator - -The `geodistance` operator calculates the distance between two points in [[GeoJSON Point Feature]] format. The points are specified as two operands. An optional third operand specifies the units as `miles`, `kilometers`, `degrees` or `radians` (defaults to `miles`). - -``` -<$let - oxford={{{ [geopoint[51.751944],[-1.257778]] }}} - new-york={{{ [geopoint[40.730610],[-73.935242]] }}} -> -<$text text={{{ [geodistance,] }}}/>, -<$text text={{{ [geodistance,,[miles]] }}}/>, - -``` - -!! `geonearestpoint` operator - -The `geonearestpoint` operator determines the point in a list that is nearest to a target point. Each input list item is interpreted as a [[GeoJSON Point Feature]] comprising the candidate points. The target point is specified as the first operand in [[GeoJSON Point Feature]] format. - -``` -<$let - oxford={{{ [geopoint[51.751944],[-1.257778]jsonset[id],[Oxford]] }}} - winchester={{{ [geopoint[51.0632],[-1.308]jsonset[id],[Winchester]] }}} - new-york={{{ [geopoint[40.730610],[-73.935242]jsonset[id],[New York]] }}} -> - -<$text text={{{ =[] =[] +[geonearestpointjsonget[id]] }}}/>, -<$text text={{{ =[] =[[Not a point]] +[geonearestpointjsonget[id]] }}}/>, -<$text text={{{ =[[Not a point]] +[geonearestpointjsonget[id]] }}}/> - - -``` - -!! `geounion` operator - -The `geounion` operator calculates the union between two or more [[GeoJSON Polygon Features|GeoJSON Polygon Feature]]. - -Each input list item is interpreted as a [[GeoJSON Polygon Feature Collection]] containing polygons. - -``` -[geounion[]] -``` - -!! `geointersect` operator - -The `geointersect` operator calculates the intersection between two or more [[GeoJSON Polygon Features|GeoJSON Polygon Feature]]. - -Each input list item is interpreted as a [[GeoJSON Polygon Feature Collection]] containing polygons. - -``` -[geointersect[]] -``` - -!! `geodifference` operator - -The `geodifference` operator calculates the difference between two or more [[GeoJSON Polygon Features|GeoJSON Polygon Feature]]. - -Each input list item is interpreted as a [[GeoJSON Polygon Feature Collection]] containing polygons. - -``` -[geodifference[]] -``` - -!! `geolookup` operator - -The `geolookup` operator identifies the polygon(s) within a [[GeoJSON Polygon Feature]] that correspond to a particular point, and returns the JSON properties of that polygon. - -Each input list item is interpreted as a [[GeoJSON Point Feature]] and the operand is interpreted as a [[GeoJSON Polygon Feature Collection]]. - -For example, here we lookup the point 100.5,0.5 in the [[GeoJSON Polygon Feature Collection]] stored in the tiddler `TestData` and then extracts the indexes `0` and `animal` from the resulting JSON: - -``` -<$text text={{{ [geopoint[100.5],[0.5]geolookup{TestData}jsonget[0],[animal]] }}}/> -``` - -!! `olc-decode` operator - -The `olc-decode` operator converts an [[OpenLocationCode|https://github.com/google/open-location-code]] shortcut into the [[GeoJSON Point Feature]] at its centre or the [[GeoJSON Polygon Feature]] representing the bounds of the area identified by the input code. - -``` -[olc-decode:bounds[9C3WQP2R+QV]] -[olc-decode:point[9C3WQP2R+QVH]] -``` - -!! `olc-encode` operator - -The `old-encode` operator converts separate latitude and longitude numbers into an [[OpenLocationCode|https://github.com/google/open-location-code]] shortcut code with a specified length (defaults to 11 characters). - -``` -[olc-encode[51.751944],[-1.257778]] -[olc-encode[51.751944],[-1.257778],[11]] -``` - +<> diff --git a/plugins/tiddlywiki/geospatial/docs/geodifference.tid b/plugins/tiddlywiki/geospatial/docs/geodifference.tid new file mode 100644 index 000000000..fd426dd68 --- /dev/null +++ b/plugins/tiddlywiki/geospatial/docs/geodifference.tid @@ -0,0 +1,44 @@ +title: $:/plugins/tiddlywiki/geospatial/docs/geodifference +caption: geodifference operator +tags: $:/tags/GeospatialDocs + +!! `geodifference` operator + +The `geodifference` operator calculates the difference between two or more [[GeoJSON Polygon Features|GeoJSON Polygon Feature]]. + +Each input list item is interpreted as a [[GeoJSON Polygon Feature Collection]] containing polygons. + +``` +[geodifference[]] +``` + +!! `geolookup` operator + +The `geolookup` operator identifies the polygon(s) within a [[GeoJSON Polygon Feature]] that correspond to a particular point, and returns the JSON properties of that polygon. + +Each input list item is interpreted as a [[GeoJSON Point Feature]] and the operand is interpreted as a [[GeoJSON Polygon Feature Collection]]. + +For example, here we lookup the point 100.5,0.5 in the [[GeoJSON Polygon Feature Collection]] stored in the tiddler `TestData` and then extracts the indexes `0` and `animal` from the resulting JSON: + +``` +<$text text={{{ [geopoint[100.5],[0.5]geolookup{TestData}jsonget[0],[animal]] }}}/> +``` + +!! `olc-decode` operator + +The `olc-decode` operator converts an [[OpenLocationCode|https://github.com/google/open-location-code]] shortcut into the [[GeoJSON Point Feature]] at its centre or the [[GeoJSON Polygon Feature]] representing the bounds of the area identified by the input code. + +``` +[olc-decode:bounds[9C3WQP2R+QV]] +[olc-decode:point[9C3WQP2R+QVH]] +``` + +!! `olc-encode` operator + +The `old-encode` operator converts separate latitude and longitude numbers into an [[OpenLocationCode|https://github.com/google/open-location-code]] shortcut code with a specified length (defaults to 11 characters). + +``` +[olc-encode[51.751944],[-1.257778]] +[olc-encode[51.751944],[-1.257778],[11]] +``` + diff --git a/plugins/tiddlywiki/geospatial/docs/geodistance.tid b/plugins/tiddlywiki/geospatial/docs/geodistance.tid new file mode 100644 index 000000000..41725c296 --- /dev/null +++ b/plugins/tiddlywiki/geospatial/docs/geodistance.tid @@ -0,0 +1,18 @@ +title: $:/plugins/tiddlywiki/geospatial/docs/geodistance +caption: geodistance operator +tags: $:/tags/GeospatialDocs + +!! `geodistance` operator + +The `geodistance` operator calculates the distance between two points in [[GeoJSON Point Feature]] format. The points are specified as two operands. An optional third operand specifies the units as `miles`, `kilometers`, `degrees` or `radians` (defaults to `miles`). + +``` +<$let + oxford={{{ [geopoint[51.751944],[-1.257778]] }}} + new-york={{{ [geopoint[40.730610],[-73.935242]] }}} +> +<$text text={{{ [geodistance,] }}}/>, +<$text text={{{ [geodistance,,[miles]] }}}/>, + +``` + diff --git a/plugins/tiddlywiki/geospatial/docs/geointersect.tid b/plugins/tiddlywiki/geospatial/docs/geointersect.tid new file mode 100644 index 000000000..67ea1071f --- /dev/null +++ b/plugins/tiddlywiki/geospatial/docs/geointersect.tid @@ -0,0 +1,13 @@ +title: $:/plugins/tiddlywiki/geospatial/docs/geointersect +caption: geointersect operator +tags: $:/tags/GeospatialDocs + +!! `geointersect` operator + +The `geointersect` operator calculates the intersection between two or more [[GeoJSON Polygon Features|GeoJSON Polygon Feature]]. + +Each input list item is interpreted as a [[GeoJSON Polygon Feature Collection]] containing polygons. + +``` +[geointersect[]] +``` diff --git a/plugins/tiddlywiki/geospatial/docs/geolookup.tid b/plugins/tiddlywiki/geospatial/docs/geolookup.tid new file mode 100644 index 000000000..62c756f9a --- /dev/null +++ b/plugins/tiddlywiki/geospatial/docs/geolookup.tid @@ -0,0 +1,15 @@ +title: $:/plugins/tiddlywiki/geospatial/docs/geolookup +caption: geolookup operator +tags: $:/tags/GeospatialDocs + +!! `geolookup` operator + +The `geolookup` operator identifies the polygon(s) within a [[GeoJSON Polygon Feature]] that correspond to a particular point, and returns the JSON properties of that polygon. + +Each input list item is interpreted as a [[GeoJSON Point Feature]] and the operand is interpreted as a [[GeoJSON Polygon Feature Collection]]. + +For example, here we lookup the point 100.5,0.5 in the [[GeoJSON Polygon Feature Collection]] stored in the tiddler `TestData` and then extracts the indexes `0` and `animal` from the resulting JSON: + +``` +<$text text={{{ [geopoint[100.5],[0.5]geolookup{TestData}jsonget[0],[animal]] }}}/> +``` diff --git a/plugins/tiddlywiki/geospatial/docs/geomap.tid b/plugins/tiddlywiki/geospatial/docs/geomap.tid new file mode 100644 index 000000000..5e7cdb05e --- /dev/null +++ b/plugins/tiddlywiki/geospatial/docs/geomap.tid @@ -0,0 +1,15 @@ +title: $:/plugins/tiddlywiki/geospatial/docs/geomap +caption: geomap widget +tags: $:/tags/GeospatialDocs + +!! `<$geomap>` widget + +The `<$geomap>` widget displays an interactive map using [[Leaflet.js|https://leafletjs.com/]]. + +The following attributes are supported: + +|!Attribute |!Description | +|''state'' |The title of a state tiddler used to track the state of the map in the `zoom`, `long` and `lat` fields | +|''layers'' |A filter identifying the GeoJSON layer tiddlers to be displayed on the map | +|''markers'' |A filter identifying the GeoJSON marker tiddlers to be displayed on the map | + diff --git a/plugins/tiddlywiki/geospatial/docs/geonearestpoint.tid b/plugins/tiddlywiki/geospatial/docs/geonearestpoint.tid new file mode 100644 index 000000000..aa7290a20 --- /dev/null +++ b/plugins/tiddlywiki/geospatial/docs/geonearestpoint.tid @@ -0,0 +1,21 @@ +title: $:/plugins/tiddlywiki/geospatial/docs/geonearestpoint +caption: geonearestpoint operator +tags: $:/tags/GeospatialDocs + +!! `geonearestpoint` operator + +The `geonearestpoint` operator determines the point in a list that is nearest to a target point. Each input list item is interpreted as a [[GeoJSON Point Feature]] comprising the candidate points. The target point is specified as the first operand in [[GeoJSON Point Feature]] format. + +``` +<$let + oxford={{{ [geopoint[51.751944],[-1.257778]jsonset[id],[Oxford]] }}} + winchester={{{ [geopoint[51.0632],[-1.308]jsonset[id],[Winchester]] }}} + new-york={{{ [geopoint[40.730610],[-73.935242]jsonset[id],[New York]] }}} +> + +<$text text={{{ =[] =[] +[geonearestpointjsonget[id]] }}}/>, +<$text text={{{ =[] =[[Not a point]] +[geonearestpointjsonget[id]] }}}/>, +<$text text={{{ =[[Not a point]] +[geonearestpointjsonget[id]] }}}/> + + +``` diff --git a/plugins/tiddlywiki/geospatial/docs/geopoint.tid b/plugins/tiddlywiki/geospatial/docs/geopoint.tid new file mode 100644 index 000000000..99767b216 --- /dev/null +++ b/plugins/tiddlywiki/geospatial/docs/geopoint.tid @@ -0,0 +1,27 @@ +title: $:/plugins/tiddlywiki/geospatial/docs/geopoint +caption: geopoint operator +tags: $:/tags/GeospatialDocs + +!! `geopoint` operator + +The `geopoint` operator converts separate latitude, longitude and (optionally) altitude numbers into a [[GeoJSON Point Feature]] that can be used with other geospatial primitives. + +The coordinates are specified as two or three operands: + +``` +[geopoint,,] +``` + +Any operands that cannot be interpreted as a valid number will be interpreted as the value zero. + +For example: + +``` +<$text text={{{ [geopoint[51.751944],[-1.257778]] }}}/> +``` + +Returns: + +``` +{"type":"Feature","properties":{},"geometry":{"type":"Point","coordinates":[51.751944,-1.257778,0]}} +``` diff --git a/plugins/tiddlywiki/geospatial/docs/geounion.tid b/plugins/tiddlywiki/geospatial/docs/geounion.tid new file mode 100644 index 000000000..e5fc3a53d --- /dev/null +++ b/plugins/tiddlywiki/geospatial/docs/geounion.tid @@ -0,0 +1,13 @@ +title: $:/plugins/tiddlywiki/geospatial/docs/geounion +caption: geounion operator +tags: $:/tags/GeospatialDocs + +!! `geounion` operator + +The `geounion` operator calculates the union between two or more [[GeoJSON Polygon Features|GeoJSON Polygon Feature]]. + +Each input list item is interpreted as a [[GeoJSON Polygon Feature Collection]] containing polygons. + +``` +[geounion[]] +``` diff --git a/plugins/tiddlywiki/geospatial/docs/olc-decode.tid b/plugins/tiddlywiki/geospatial/docs/olc-decode.tid new file mode 100644 index 000000000..15a83acad --- /dev/null +++ b/plugins/tiddlywiki/geospatial/docs/olc-decode.tid @@ -0,0 +1,12 @@ +title: $:/plugins/tiddlywiki/geospatial/docs/olc-decode +caption: olc-decode operator +tags: $:/tags/GeospatialDocs + +!! `olc-decode` operator + +The `olc-decode` operator converts an [[OpenLocationCode|https://github.com/google/open-location-code]] shortcut into the [[GeoJSON Point Feature]] at its centre or the [[GeoJSON Polygon Feature]] representing the bounds of the area identified by the input code. + +``` +[olc-decode:bounds[9C3WQP2R+QV]] +[olc-decode:point[9C3WQP2R+QVH]] +``` diff --git a/plugins/tiddlywiki/geospatial/docs/olc-encode.tid b/plugins/tiddlywiki/geospatial/docs/olc-encode.tid new file mode 100644 index 000000000..ffeffe513 --- /dev/null +++ b/plugins/tiddlywiki/geospatial/docs/olc-encode.tid @@ -0,0 +1,13 @@ +title: $:/plugins/tiddlywiki/geospatial/docs/olc-encode +caption: olc-encode operator +tags: $:/tags/GeospatialDocs + +!! `olc-encode` operator + +The `old-encode` operator converts separate latitude and longitude numbers into an [[OpenLocationCode|https://github.com/google/open-location-code]] shortcut code with a specified length (defaults to 11 characters). + +``` +[olc-encode[51.751944],[-1.257778]] +[olc-encode[51.751944],[-1.257778],[11]] +``` +