OpenOrienteering/mapper

Feature proposal: Comparison operator and dynamic attribute support for ObjectQuery language

Opened this issue · 3 comments

There're basically two main use cases for this feature:

  1. To identify objects that violate minimal size constraints (length for line -symbols, area for area -symbols) (so that something can be done with them: to be removed, enlarged, consiously preserved despite violation etc).
  2. To filter out objects too small to be included in the map. This sort of objects may end up to the map e.g. via gdal_contour or gdal_polygonize when preprocessing lidar data (see Preparing and importing lidar data (sorry, only in finnish) ). These objects may be invisible in the Mapper (unless explicitly selected), but may come visible e.g. as pdf by certain viewers (Acrobat Reader), maybe even in printouts.

By comparison it is meant an ability to use relational operators, such as "less than" or "greater than" comparisons in ObjectQueries. This would be beneficial e.g. when defining range of values (of certain span) instead of explicitly listing every matching value (see ridigulously long expression in CRT for land survey database in Finland ). Further a support for comparison together with "dynamic attribute" concept would enable identification of objects e.g. shorter than required by mapping standards.

By dynamic attribute it is meant that an object may have "tags", such as "$length" or "$area" that would be dynamically determined by the Mapper as part of the ObjectQuery evaluation and which are based on objects appearances. Predefined set of dynamic attributes would be provided, such as "$length" for line- and "$area" for area objects. Dynamic attributes should be distinctable from ordinary tags. In this proposal, a prefix $ is used for that.

See also #1021

Yep, from technical point of view this proposal can be seen as one step toward #1021.

May work for minimum dimensions, but considering minimal gaps between objects something else might be needed though.

When I create contour lines from lidar data I manually remove small artefacts, so I'm interested in a selection of objects that are too small.