This article illustrates the different configuration options for spatial access restrictions. For a general overview of access control in LuciadFusion, see the Access control in LuciadFusion article.

Spatial restrictions for vector data

As an example, we use the Data/Shp/Usa/States.shp shapefile, which defines the states of the USA.

First we define the area and reference for the spatial restriction. The area is the WKT representation of a polygon. Together with the area we specify the spatial reference, which must be an EPSG code.

In this example, we use this spatial area and reference:

  • Area: POLYGON ((-115 50, -90 50, -90 25, -115 25))

  • Reference: EPSG:4326

The blue polygon in this figure shows the resulting spatial area:

states
Figure 1. The vector data used in the example. The blue polygon shows the area bounds used in the spatial restriction.

Now we illustrate the behavior of the accept and overlappingShapes parameters for the defined area. The Table 1, “Spatial restriction parameter combinations” table shows the behavior of the different combinations of these parameters. In the figures, the red areas are filtered out by the spatial restriction and won’t be visible.

Table 1. Spatial restriction parameter combinations
Accept OverlappingShapes Behavior Example

Inside

Include

Contains the shapes that are inside the spatial area. Shapes that overlap with the bounds of the spatial area are included.

states inside include

Inside

Exclude

Contains the shapes that are inside the spatial area. Shapes that overlap with the bounds of the spatial area are excluded.

states inside exclude

Inside

Clip

Contains the shapes that are inside the spatial area. Shapes that overlap with the bounds of the spatial area are clipped at the spatial area bounds.

states inside clip

Outside

Include

Contains the shapes that are outside the spatial area. Shapes that overlap with the bounds of the spatial area are included.

states outside include

Outside

Exclude

Contains the shapes that are outside the spatial area. Shapes that overlap with the bounds of the spatial area are excluded.

states outside exclude

Outside

Clip

Contains the shapes that are outside the spatial area. Shapes that overlap with the bounds of the spatial area are clipped at the spatial area bounds.

states outside clip

Spatial restrictions for raster data

You define spatial restrictions for raster data in the same way as spatial restrictions for vector data, except for the overlappingShapes property. This property doesn’t apply to raster data. The raster data is always clipped at the bounds of the spatial area.