Skip to content

Examples

Juan Couste edited this page May 24, 2024 · 3 revisions
api.execJson(
	(s) =>
		s.node
			.byTags({ capital: /yes/ })
			.and((c) => c.bbox([10, -5, 11, -4]))
			.and((c) =>
				c.filter((e) => e.hasTag("population")
					.and(e.getTag("population").parseNumber().gt(100000))),
			),
	{ geoInfo: OverpassOutputGeoInfo.Geometry },
	{ timeout: 25 },
);

Yields

/* Settings */
[timeout:25]; 
/* Statements */
node ["capital"~"yes"]
    (10, -5, 11, -4)
    (if: (is_tag("population") && (number(t["population"]) > 100000)));
/* Output */
._ out geom;
Clone this wiki locally