LuciadLightspeed allows you to filter certain objects from a layer and exclude them from visualization or other actions such as selection or displaying tool tips. Cases where such a filter is useful are:

  • You want to focus on the most relevant data during analysis.

  • You want to boost rendering performance.

  • You want to keep the map view clear.

There are four ways to filter objects in a layer:

  • Define a scale range on the layer to display only objects within a limited range of scales in 2D, or within a certain distance range from the view point in 3D. For more information, see the scale range getter and setter methods of TLspShapeLayerBuilder, TLspRasterLayerBuilder, TLspLayer and TLspRasterLayer in the API reference documentation.

  • Write a generic filter: each object in the ILcdModel is evaluated by this filter. You can use any criterion to either include or exclude the object. For example, you can set up a generic filter to display only cities with a population of more than one million inhabitants. See the filter getter and setter methods of the layer builders in the API reference documentation for more information. An advanced filter implementation is OGC filtering. To learn more about OGC filtering, see OGC Filters in a LuciadLightspeed application.

  • Set a minimum object size: when the user zooms out on the map, small objects may become irrelevant. For example, it does not make sense to display airport runways on a map zoomed out to a scale of 1:100.000.000. TLspLayer.setMinimumObjectSizeForPainting allows you to set a size threshold (in pixels) for objects. Objects that are smaller than the given threshold, are automatically excluded. You can disable this behavior by setting the threshold to 0. Refer to the API reference for more information.

  • Use the painter styler to exclude individual objects from visualization. You can only use ALspStyleTargetProvider to separate individual objects from a group of objects, and make those invisible. For more information, see Deriving geometry from objects.

For more information about layer builders and stylers, see Object painting in a Lightspeed view.