@trailstash/ultra 4.2.3 → 4.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,6 +6,7 @@ options:
6
6
  zoom: 15
7
7
  type: postpass
8
8
  ---
9
- SELECT osm_id, way, tags FROM planet_osm_point
10
- WHERE amenity = 'bicycle_repair_station'
11
- AND way && ST_MakeEnvelope({{wsen}}, 4326)
9
+ SELECT osm_id, osm_type, tags, geom
10
+ FROM postpass_point
11
+ WHERE tags->>'amenity'='fast_food'
12
+ AND geom && ST_MakeEnvelope({{wsen}},4326)
package/docs/yaml.md CHANGED
@@ -254,6 +254,13 @@ Detected if
254
254
  An SQL query to be executed on a [Postpass](https://github.com/woodpeck/postpass) server. Server
255
255
  results are modified to have the same structure as [overpass](#overpass)
256
256
 
257
+ !!! warning
258
+
259
+ Postpass is in very early stages of development, so Ultra may lag behind as new versions of the
260
+ API are released. This provider defaults to the version 0.2 of the [GeoFabrik Postpass
261
+ API](https://github.com/woodpeck/postpass-ops) &
262
+ [Schema](https://github.com/woodpeck/postpass-ops/blob/main/SCHEMA.md)
263
+
257
264
  ## `options`
258
265
 
259
266
  When an Ultra query is run in "interactive map" mode, you can specify the
@@ -3,38 +3,25 @@ import { setQueryBounds } from "../bounds.js";
3
3
 
4
4
  import { layers, popupTemplate, popupContextBuilder } from "./osm.js";
5
5
 
6
- const nonTags = {
7
- osm_id: true,
8
- tags: true,
9
- way_area: true,
10
- z_order: true,
11
- };
12
-
13
6
  const flattenPropertiesAndInferIdAndType = (geoJSON) => {
14
7
  // prety major assumption basked into this as Postpass executes arbitrary SQL so the returned
15
8
  // data could be anything. This assumes that the query returns un-renamed columns.
16
- geoJSON.features = geoJSON.features.map((x) => {
9
+ geoJSON.features = geoJSON.features.map((f) => {
17
10
  const properties = {};
18
- if (x.properties.osm_id) {
19
- properties["@type"] = x.geometry.type === "Point" ? "node" : "way";
20
- properties["@id"] = x.properties.osm_id;
21
- if (properties["@id"] < 0) {
22
- properties["@id"] = -properties["@id"];
23
- properties["@type"] = "relation";
24
- }
11
+ if (f.properties.osm_id) {
12
+ properties["@id"] = f.properties.osm_id;
13
+ properties["@type"] = f.properties.osm_type;
25
14
  }
26
- if (x.properties.tags) {
27
- for (const [k, v] of Object.entries(x.properties.tags)) {
15
+ if (f.properties.tags) {
16
+ for (const [k, v] of Object.entries(f.properties.tags)) {
28
17
  properties[k] = v;
29
18
  }
30
19
  }
31
- for (const [key, value] of Object.entries(x.properties)) {
32
- if (!nonTags[key]) {
33
- properties.tags[key] = value;
34
- }
20
+ for (const [k, v] of Object.entries(f.properties)) {
21
+ properties[k] = v;
35
22
  }
36
23
  return {
37
- ...x,
24
+ ...f,
38
25
  properties,
39
26
  };
40
27
  });
@@ -44,7 +31,7 @@ const flattenPropertiesAndInferIdAndType = (geoJSON) => {
44
31
  const postpass = {
45
32
  source: async function (query, controller, { server, bounds }) {
46
33
  if (!server) {
47
- server = "https://postpass.geofabrik.de/api/0.1/interpreter";
34
+ server = "https://postpass.geofabrik.de/api/0.2/interpreter";
48
35
  }
49
36
  const resp = await fetch(server, {
50
37
  method: "POST",
package/mkdocs.yml CHANGED
@@ -24,3 +24,7 @@ extra:
24
24
  extra:
25
25
  analytics:
26
26
  provider: custom
27
+ markdown_extensions:
28
+ - admonition
29
+ - pymdownx.details
30
+ - pymdownx.superfences
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "4.2.3",
6
+ "version": "4.2.5",
7
7
  "description": "A web based tool for making MapLibre GL maps with data from sources such as Overpass, GeoJSON, GPX, KML, TCX, etc",
8
8
  "main": "index.js",
9
9
  "scripts": {