Open tordans opened 5 years ago
There is a workaround for now: For simple area forms, the length of an area-way can be used to approximate the area size. I think this should be OK to use, at least for simple filters like I described above.
Before | After |
---|---|
(From the example above.) | . |
[out:json];
(
way["leisure"="garden"]["access"!~"no|private"](if: length() > 10)({{bbox}});
way["leisure"="park"]["access"!~"no|private"](if: length() > 10)({{bbox}});
);
out geom;
make stat total_length=sum(length()),section_lengths=set(length());
out;
The number 10 is picked by looking at the section_length list of a query without the if
(or with if: … > 1
), which, for the given example, would return:
{
"type": "stat",
"id": 1,
"tags": {
"total_length": "38.458",
"section_lengths": "28.941;9.517"
}
}
Hi @tordans, I really hope this "area size" will be implemented. Thank you for the workaround :heart:
i´d also would love to see the "area size" feature :)! but thanks anyway for the workaround!
This would be so useful to be able to get the data directly without pre processing
This functionality would be especially useful to OpenHistoricalMap. For example, you could query for the maximum extent of a city or an empire – a very basic fact in historiography – by filtering its boundary relations until you get a result set of only one. The perimeter is not necessarily very useful, because some boundaries have historically had very many enclaves and exclaves, not to mention scraggly borders.
For example, you could query for the maximum extent of a city or an empire – a very basic fact in historiography – by filtering its boundary relations until you get a result set of only one.
As a workaround, here’s a SPARQL query for the maximum extent of an empire in OpenHistoricalMap using QLever.
UseCase: Query all parks||gardens but only those areas that are above a certain size. Like bigger than 10 square meters.
Example:
I don't want results like https://www.openstreetmap.org/way/634006146
This might be related to https://github.com/drolbr/Overpass-API/issues/464