Untitled
unknown
plain_text
2 years ago
668 B
9
Indexable
let errors = [];
for await (suburb of data) {
await fetch(
`https://nominatim.openstreetmap.org/search.php?q=${`${suburb.city} ${suburb.state} ${suburb.postCode}, ${suburb.country}`}&polygon_geojson=1&format=json`,
)
.then((res) => res.json())
.then(async (data) => {
const boundaryData = data?.find((v) => v.class === 'boundary');
if (boundaryData && !!boundaryData.geojson && boundaryData.geojson?.coordinates) {
a = 1;
console.log(suburb.city)
} else { errors.push(suburb); console.log('ERROR SUBURB', suburb.city) }
})
}
console.log('ENDDDDDDDD!!!!-------------')Editor is loading...