Closed Djiit closed 6 months ago
The current best way I think would be:
// get an OverpassApiObject like const api = DefaultOverpassApi();
const results = await api.execJson(
(s) => s.query(OverpassQueryTarget.NodeWayRelation, { changing_table: /yes/ }),
{ geoInfo: OverpassOutputGeoInfo.Geometry },
{
timeout: 25,
globalBoundingBox: [47.09139684143848, -1.720390319824219, 47.38114922279505, -1.4028167724609377],
},
);
// do something with results
The query being run would be:
/* Settings */
[timeout:25]
[out:json]
[bbox:47.09139684143848,-1.720390319824219,47.38114922279505,-1.4028167724609377];
/* Statements */
nwr ["changing_table"~"yes"];
/* Output */
._ out geom
There are some changes pending to be merged & published, that would allow this to be written like:
const result = await api.execJson(
(s) => s.query(OverpassQueryTarget.NodeWayRelation, { changing_table: /yes/ })
.and(c => c.bbox([47.09139684143848, -1.720390319824219, 47.38114922279505, -1.4028167724609377])),
{ geoInfo: OverpassOutputGeoInfo.Geometry },
{ timeout: 25 },
);
And the query would be like the one you wanted:
/* Settings */
[timeout:25]
[out:json];
/* Statements */
nwr ["changing_table"~"yes"]
(47.09139684143848, -1.720390319824219, 47.38114922279505, -1.4028167724609377);
/* Output */
._ out geom;
If you are still interested in using this, I'll get this published asap.
Sorry for the wait @Djiit , I somehow did not get notifications for your messages, gotta look into it.
Thanks for answer. Your example would be a nice addition to the README or the example folder 🙏
There is now documentation on how to interact with this package to execute queries, checkout the wiki
I'm not sure how I can use a query that I can export from Overpass turbo, e.g.: