Creating Layers

 

Each layer of a project in JMap takes its data from a spatial data source. Thus, before layers can be created, the related data sources must already exist (see Creating Spatial Data Sources for more information).

Creating a new layer

To create a new layer, press Create in the Add menu of the Layers section of a project. Note that the new layer will have the same name as the data source by default. The name can be changed later.

Creating a new layer requires completing the following wizard steps.

Spatial data source

Spatial data source

Select the spatial data source that will provide the data of the layer. Selecting a vector data source will create a vector layer. Selecting a raster data source will create a raster layer.

The next steps are different for vector layers and raster layers. Note that creating a raster layer is also different for each type of raster data sources. Jump to the corresponding section below.

Creating a vector layer

Attributes

Available attributes/Bound attributes

By default, when layer elements (points, lines, polygons, etc.) are transferred from JMap Server to an application's memory, the element attributes (or descriptive data) are not. This is because the attributes are not “bound” to the elements. Data binding binds attribute data to layer elements. Data binding is necessary for the following client-side functions: labeling, mouseover, thematic mapping and displaying attributes in the elements or selection explorer.

Select and add the attributes to the list on the right to bind them to the layer. The other attributes will still be available for other functions like attribute queries and information reports.

Note that the number of bound attributes has an impact on network and memory usage and thus can reduce the overall performances. Unneeded attributes should not be bound unless they are required on the application side.

 

Geometry type

Geometry type

If the data source provides more than one type, select the unique geometry type for the layer.

 

Geometry angle (layers of points only)

Attribute angle

This section is only available for layers of points. In this section, select a numeric attribute that contains rotation angles (in degrees or in radians) for the symbols representing the points of the layer. If you select an attribute of the angle, the symbols will be displayed with a rotation following this attribute value. The rotation direction specifies how to interpret the angle values.

Direction

Choose the rotation direction. Angle values can be interpreted clockwise or counterclockwise.

 

The request mode determines how the vector data is requested from JMap Server. There are 2 available request modes: by tile and by region.

Request mode

Load by tile

The data is requested by rectangular zones (tiles) defined by a predetermined fixed grid that covers all the layer data. Structuring layer data in tiles makes data management more efficient, for network transfers, memory management and cache storage. If the grid is not properly configured, this can have a negative impact on the system's performance or lead to operational problems. When you press the Estimate button, JMap performs a calculation to determine the best configuration for the grid. You can accept these values or modify them according to your needs.

 

This mode offers the best performance because once a tile has been extracted from a data source, it can be cached for a certain amount of time and reused effectively. This is the recommended mode for most applications.

 

Load by region

The data is requested by random regions, according to the user's navigation actions. Each time the layer needs to be displayed in the application, a new request is sent to JMap Server and the data is extracted again from the spatial data source. This mode is very dynamic as no caching is used and users can see data changes at every map manipulation (zoom, pan, etc.). Note however that it is much more intensive for JMap Server and, if not used properly, it can affect the system's general performance.

This mode must be used for dynamic data. Typically, this data is found in a relational database and can be randomly modified. This is the case for layers that are editable by JMap.

 

Advanced parameters

Most of the time, the following advanced parameters don't need to be modified.

Advanced (optional)

Transformation

Apply a translation: Translate each geometry of the layer by X units horizontally and Y units vertically. The original data is not affected.

Generalize geometries: Generalize (simplify) geometries using the specified tolerance. For a given geometry, all nodes that are closer together than the tolerance are eliminated. In addition, all nodes that are located on the same straight line are eliminated.

Filter

SQL conditions: SQL conditions are used to filter the elements of the spatial data source. Only the elements that satisfy the SQL conditions will be on the layer. This allows you to create many layers showing different data using the same spatial data source. SQL conditions are interpreted directly by the database system so the syntax is the same as that of an SQL WHERE clause. The where keyword is not necessary.

Caching

This section allows you to define data caching rules for the vector data and its attributes. The cache is on the server. This improves performances because once data is in the cache, JMap Server does not need to load it again from the data source.

Activate server data caching for this layer: Use this option to enable or disable data caching on the server for this layer.

Automatically build the cache when the data source is updated: If caching is enabled, this tells JMap Server to flush and rebuild the cache for this layer, when the corresponding spatial data source gets updated. Building the cache in advance helps to prevent delays for the users. Building the cache may take a long time, depending on the volume of the data.

Cache timeout: This instructs JMap Server to cache the data no longer than the specified time period. When the timeout is reached, the data is requested again from the data source.This is mostly useful for spatial data sources that get their data from spatial data servers to which JMap Server is connected (Oracle Spatial/Locator, ESRI geodatabases, PostGIS, MySQL Spatial, etc.).

Update layer cache after I click "Finish": Select this option to have the cache built immediately for this layer. Building the cache may take a long time, depending on the volume of data.

Creating a raster layer based on a WMS data source

To create a raster layer based on a WMS spatial data source, you need to tell JMap what data to request from the WMS server. The WMS server provides capabilities information that enumerates all the layers it can serve and their properties. In JMap, the WMS layer creation interface allows you to select the layers to include in the WMS layer you wish to create.

WMS raster layer

Available layers

The list of layers the WMS server is publishing. If you hold your mouse pointer on a layer name, its description will display automatically, along with its attributes. The attributes determine if the layer is Queriable (supports GetFeatureInfo requests), Cascaded (comes from another WMS server) or Opaque (not transparent, i.e. the layers found under it will not be visible).

Selected layer(s)

The layers selected among those that are available appear in this list. Click on Add to add a new layer to this list. You can select the style to be used. A default style is always provided.

Connection type (Direct/Server)

The connection type determines if JMap applications will request images directly from the WMS server or if they will send the requests to JMap Server, which in turn will query the WMS server. If direct is selected and a client application fails to connect to the WMS server, the connection mode will revert to server.

Note that if JMap Server is behind a firewall/proxy, it may need proxy authentication settings in order to access the Internet. See JMap Server Settings for more information.

S.R.S.

The list of Spatial Reference Systems offered by the WMS server for the layer. You can select the one to use.

Background color

Tells the WMS server what color to use in the background of the map images. Any area where there is no data will be filled with this color.

Use background color as transparent color

Tells the WMS server to use the background color as the transparency color. Using transparency allows the map images to be placed on top of other layers without completely hiding them.

Output format

The list of output formats offered by the WMS server. You can select the format to use.

Creating a raster layer based on a GDAL, TIFF/GEOTIFF or ECW/ECWP data source

Raster layer

Image format

Select the image format to use for image transfers between JMap Server and JMap applications. For air photos, JPEG usually gives the best results.

Image format parameters

Only used with JPEG image format to specify the quality factor (1 means excellent quality and low compression while 0 means low quality and high compression). Test with different values to determine what fits your needs. A value of 0.5 is usually a good compromise.

Example: quality=0.6

Background color

Tells JMap Server what color to use in the background of the images. Any area where there is no data will be filled with this color.

Use background color as transparent color

Tells JMap Server to use the background color as the transparency color. Using transparency allows the images to be used on top of other layers without completely hiding them.