@trailstash/ultra 3.8.5 → 3.8.6
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.
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Query OSM using Sophox
|
|
3
|
+
description: Load OSM data from Sophox
|
|
4
|
+
type: sparql
|
|
5
|
+
server: https://sophox.org/sparql
|
|
6
|
+
options:
|
|
7
|
+
zoom: -0.1
|
|
8
|
+
center: [0, 30]
|
|
9
|
+
---
|
|
10
|
+
SELECT * WHERE {
|
|
11
|
+
?newspaper osmt:office "newspaper";
|
|
12
|
+
osmm:loc ?coordinates.
|
|
13
|
+
}
|
|
Binary file
|
package/docs/yaml.md
CHANGED
|
@@ -131,14 +131,15 @@ Detected if:
|
|
|
131
131
|
|
|
132
132
|
### `sparql`
|
|
133
133
|
|
|
134
|
-
Make a [
|
|
134
|
+
Make a [SPARQL](https://www.w3.org/TR/sparql11-query/) query to load data.
|
|
135
135
|
|
|
136
|
-
**Note:**
|
|
136
|
+
**Note:** requires you to specify a [server](#server).
|
|
137
137
|
|
|
138
138
|
Examples:
|
|
139
139
|
|
|
140
140
|
* [Qlever](./Examples/qlever.md)
|
|
141
141
|
* [Wikidata Query Service](./Examples/wikidata-sparql.md)
|
|
142
|
+
* [Sophox](./Examples/sophox.md)
|
|
142
143
|
|
|
143
144
|
### `ohsome`
|
|
144
145
|
|
|
@@ -25,15 +25,15 @@ const source = async function (query, controller, { server, bounds }) {
|
|
|
25
25
|
}
|
|
26
26
|
const resp = await fetch(server, {
|
|
27
27
|
method: "POST",
|
|
28
|
-
body: query,
|
|
28
|
+
body: new URLSearchParams([["query", query]]),
|
|
29
29
|
signal: controller.signal,
|
|
30
30
|
headers: {
|
|
31
|
-
"Content-Type": "application/
|
|
31
|
+
"Content-Type": "application/x-www-form-urlencoded",
|
|
32
32
|
Accept: "application/sparql-results+json",
|
|
33
33
|
},
|
|
34
34
|
});
|
|
35
35
|
if (!resp.ok) {
|
|
36
|
-
throw new Error(`
|
|
36
|
+
throw new Error(`SPARQL API returned ${resp.status}: ${await resp.text()}`);
|
|
37
37
|
}
|
|
38
38
|
const data = sparql2geojson(await resp.json());
|
|
39
39
|
let attribution = "";
|
package/package.json
CHANGED