Open Kovoschiz opened 11 months ago
Another workaround would be to run the query in Overpass Ultra. However, that tool uses a Mapbox Style Specification style rather than MapCSS. You can use the main OHM style JSON as a starting point, adding a symbol
layer with a text-field
property that’s a get
expression for the start_date
or end_date
property.
@1ec5 Am I correct that neither it nor Mapbox has support for evaluating dates? /mapbox/mapbox-gl-js#9436 /mapbox/mapbox-gl-js#6484
That’s correct. Only OverpassQL has built-in date parsing (for converting to a number, and only for 1000 CE to present). However, it looks like your query above wasn’t really parsing the dates, only comparing them lexicographically, which works.
I wanted to highlight incomplete date data in response to the original question. Eg for objects with end_date=
but no start_date=
(\~=15%), maybe end_date=
1850\~1900 likely existed in 1800\~1850, while 1900\~1950 is less likely.
You can compare the dates as strings using the <
and >
expression operators. This works for start_date
and end_date
but not start_date:edtf
and end_date:edtf
.
i think there's at least a typo in your "eval" mapcss function, namely, you need to put the whole expression to be evaluated in single quotes: https://overpass-turbo.eu/s/1Fsu
Unfortunately, I have no idea why this isn't working on openhistoricalmap's overpass turbo instance. :(
What's your idea for a cool feature that would help you use OHM better. Please provide a clear and concise description of the problem you'd like to solve & how you'd like to solve it. Or, the other way around! e.g. I'd like to have the inspector show time-related pictures of the object, so I can get a better idea of what the place was like at the time. I want to help visualize dates in the data from Overpass. I can color them, but not show the dates.
The text maker parameter is ignored without errors. (expected for unsupported parameters)
Current workarounds Is there any way to meet this need using a workaround or "hack" right now? Not using Overpass Turbo for viewing. Only get the data from Overpass there.
Additional info Please add any other context, comparables, screenshots, pictures of drawings on napkins about the feature request here. https://wiki.openstreetmap.org/wiki/Overpass_turbo/MapCSS#Markers_with_Text https://wiki.openstreetmap.org/wiki/File:Overpass-turbo_MapCSS_marker_text.png The query is for data from a specific time period. MapCSS isn't able to evaluate dates anyway.