JMap Server Lima
English
English
  • Welcome to JMap Server Lima
  • Administrator
    • JMap Server Administrator Manual
      • Introduction
        • Quick Start Guide
        • User Interface
          • Old User Interface
      • Resources: Databases
        • Creating Databases
        • Configuring Databases
          • Database Permissions
        • Managing Databases
        • JMap Server System Database
      • Resources: JMap Server to JMap Server Connections
        • Creating Connections to JMap Server
        • Configuring JMap Server to JMap Server Connections
          • Permissions for the Remote Connection
        • Managing Connections
      • Resources: Spatial Data
        • Basic Concepts
        • Creating Spatial Data Sources
        • Configuring Spatial Data Sources
          • Spatial Data Source Permissions
          • External Attributes
          • Metadata
          • Sharing Spatial Data Sources
        • Managing Spatial Data Sources
        • Vector Data Sources
          • JMap ADF - E00 Arc - Info reader
          • JMap CSV reader
          • JMap DGN V7 - V8 File reader
          • JMap DWG - DXF reader
          • JMap EDIGEO reader
          • JMap File geodatabase reader
          • JMap GeoJSON reader
          • JMap GML reader
          • JMap GPX reader
          • JMap IFC reader
          • JMap KML reader
          • JMap MID - MIF reader
          • JMap Photo reader
          • JMap SHP reader
          • JMap TAB reader
          • Annotations in a database
          • ArcGIS REST
          • ArcSDE geodatabase
          • Coordinates in a database
          • Enterprise geodatabase
          • JMap Server
          • JMap Spatial Table
          • MongoDB
          • MySQL Spatial
          • OGC API Features
          • Oracle Spatial Locator
          • Personal geodatabase
          • PostGIS
          • SQL Server Spatial
          • WFS Server
          • WKB or WKT in a database
        • Raster Data Sources
          • ECW - JPG2000
          • GDAL - Geospatial Data Abstraction Library
          • ArcGIS REST
          • JMap Server
          • OpenStreetMap
          • WMS server
          • WMTS Server
      • Resources: Metadata templates
      • Resources: Projects
        • Creating Projects
          • Multilingual Projects
          • Vector tiles in JMap
        • Configuring Projects
          • Project Permissions
          • Managing Layers
            • Organizing Layers
          • Attribute Queries
            • Attribute Query Forms
          • Image Producer
          • JMap Extensions Compatible with JMap NG or JMap Survey
        • Sharing the Project
        • Managing Projects
      • Resources: Style Templates
        • Creating Style Templates
        • Managing Style Templates
      • Resources: Personal Layers
      • Resources: Layers
        • Creating Layers
        • Configuring Layers
          • Layer Permissions
          • General Settings
          • Dynamic Filters
          • Style
          • Thematics
          • Labels
          • Mouseover
          • Information Reports
          • Forms
            • Configuring Forms
            • Creating Forms
              • Layer Attributes Forms
              • Database Forms
          • JMap Extensions
        • Sharing Layers
      • JMap Server Applications
        • Deployment: Classical JMap applications
          • JMap Pro Applications
          • JMap Web Applications
            • Using a GeoWebCache Server
          • WFS and WMS Services
          • Managing Deployed Applications
          • Downloading Services
        • New generation JMap applications
      • Tools
        • SQL Console
        • Import / Export
          • User Data
        • Scheduler
        • Messaging
        • Debugging tools
      • JMap Server Extensions
        • Installed Extensions
        • Marketplace
      • JMap Server
        • JMap Server Status
        • Sessions
        • Security
          • Users and Groups
            • User Managers
              • JMap DB user manager
              • Composite user manager
              • Active Directory user manager
              • JMap LDAP user manager
              • OpenID Connect (OIDC) user manager
              • SAML2 user manager
            • Single Sign-On for JMap Pro
          • Managing Permissions
          • Using HTTPS with JMap
        • Log Files
        • Usage Statistics
        • JMap Server Settings
    • Technical Specifications
    • Installation Guide
    • Installing and Starting JMap Server (with installer)
    • Installing and Starting JMap Server (in a Docker container)
    • Migration Guide to JMap Server Lima
  • Applications
    • JMap Server Applications
    • JMap Pro User Guide
      • Introduction
        • User Interface
        • Navigating on the Map
        • Map Management
        • Map Settings
      • Map Layers
        • Layer Management
        • Elements Explorer
        • Thematic Maps
        • Layer Metadata
        • Layer Settings
          • General
          • Style
          • Thematics
          • Labeling
          • Mouseover
          • Filters
          • Advanced
        • Editable Layers
          • Editing Data
          • Personal Layers
      • Tools
        • Labeling
        • Interactive Selection
        • Information
          • Information Report
          • Geometry Information
          • Mouseover
        • Snap
        • Measurement
        • Search Tools
          • Attribute Queries
          • Spatial Queries
        • Collaboration Tools
          • Map Contexts
          • Sharing Maps
          • Printing Maps
      • Application Settings
      • Keyboard and Mouse Shortcuts
    • JMap NG User Guide
      • Introduction
        • Connecting to JMap NG
        • User Interface
        • Navigating on the Map
        • Profile and User Settings
      • The Data
        • The Layers Panel
        • Data Layers
          • Displaying Layers
          • Thematics
          • Layer Information
          • Geographic Extent of the Layer
          • Filter Elements on the Map
          • Making Layer Elements Selectable
      • I Wish to...
        • Display Element Information
          • Tooltips
          • Information Reports
        • Perform Searches
        • Select Elements on the Map
        • Measure Distances and Surfaces
        • Add Annotations to the Map
        • Edit Data
        • Create and Manage Customized Maps
        • Export / Print a Map
    • JMap Survey User Guide
      • Introduction
        • Working With an iOS Device
        • Working With an Android Device
        • Logging In
        • User Interface
      • The Data
      • I Wish to...
        • Access Information Associated With an Object
        • Perform Searches
        • Create Objects
        • Modify Objects
        • Work in Offline Mode
        • Synchronize Data with JMap Server
        • Log Out
    • JMap Web
      • JMap Web User Guide
  • Extensions
    • Edition
      • User Interface
      • Basic Concepts
      • I Wish to...
        • Edit Layers Geometries
          • Edition Tools
          • Selecting Elements
          • Node and Polygon Operations
          • Vertical Position and Element Duplication
          • WKT Geometries
        • Perform Spatial Operations
          • Geoprocessing
          • Spatial Tools
    • Export
    • Import
      • Importation Procedure
        • Importing MIF Files
        • Importing SHP Files
        • Importing CSV Files
        • Importing NMEA Data
        • Importing Data From WMS
    • Documents
      • Configuring JMap Documents
        • Selecting Data Sources to Associate Documents with
        • Configuring Document Depots
        • Managing repositories
        • Making Documents available in apps
      • Documents for JMap Pro
        • Graphical Interface
        • Associating Documents with Map Elements
        • Searching for Documents
        • Displaying the List of Documents Associated with Elements
      • Documents for JMap NG
        • Graphical Interface
        • Searching for Documents
        • Showing Selected Documents
      • Documents for JMap Survey
    • Tracking
      • Administrator
      • User
    • JMap NG Configuration
      • Configuration
  • Developer
    • JMap Server REST API
    • JMap Admin REST API
    • JMap Pro / Server API
    • JMap Web API
    • JMap Server SDK
    • JMap NG Developer Manual
      • Startup Options
      • Extensions
      • Examples
        • Start the JMap NG Core library
        • Start the JMap NG App
        • Add a JMap NG App extension
        • Toggle a JMap layer visibility
        • Add a layer to display custom data from GeoJSON file
        • Locate and select features by attribute query
        • Add an event on move end
        • Add attributions on the map
        • Locate and select feature by id
        • Locate and select feature(s) by location
        • Custom mouseover on a layer
        • Create a custom form in a div
      • Changelog
  • Knowledge Base
    • Knowledge Base
Propulsé par GitBook

K2 Geospatial 2024

Sur cette page
  • Creating a new attribute query
  • Layer queries
  • External queries
  • Required and optional parameters
  • Multiple values for the same parameter
  • Managing attribute queries
  • Organizing attribute queries
  • Deleting attribute queries
  • Publishing queries
  • Queries on referenced layers
Exporter en PDF
  1. Administrator
  2. JMap Server Administrator Manual
  3. Resources: Projects
  4. Configuring Projects

Attribute Queries

PrécédentOrganizing LayersSuivantAttribute Query Forms

Dernière mise à jour il y a 8 mois

Attribute queries are used to find and select elements of a map layer using their attribute values or a database associated with the layer.

In JMap Admin, JMap administrators create the queries and their associated forms. Then, users of JMap applications use those forms to enter attribute values to search for. All elements whose attribute values match the values entered are then selected or listed in an elements explorer.

The Queries tab of a project's configuration interface allows you to configure the project's queries.

The Queries tab appears when the project contains at least one layer.

This tab presents a table that displays the query groups. The table shows the number of queries each group contains. The section provides details about the groups.

Creating a new attribute query

To create a new query you must position yourself in a group of the Queries tab. The Create a query button is displayed and you can therefore open the query configuration interface.

Parameters will vary depending on the type of query selected.

Title

Enter a title for the query. Users will see this title in a list of queries.

Layer

Select the layer on which the query will be executed. A search field is provided to simplify layer selection.

Maximum scale

Specify the maximum scale used to present the results on the map. This is used to avoid zooming in too closely on the results.

Max. returned values

Specify the maximum number of elements this query can return. The query will refuse to execute if the return size is higher than this limit. This is used to avoid very long queries that could slow down the system.

Query templates

Basic: With this type of query, the search is only performed on the layer attributes. This is the simplest type of query. External database: With this type of query, the search is performed in an external database that has a field linking to an attribute of the layer. Setting up this type of query is more complex but offers more searching flexibility.

Layer queries

WHERE

WHERE clause of the SQL query used to run the search. Here is where all the search criteria will be defined. Typically, this clause contains numbered parameters ($param1, $param2, etc.) that will be replaced by the values the user enters in the form.

Examples

COUNTRY='$param1'

Selects the layer elements for which the attribute value COUNTRY is equal to the value entered by the user.

The attribute value must perfectly match the value entered ($param1).

lower(COUNTRY) like lower('$param1%')

Selects the layer elements for which the attribute value COUNTRY is similar to the value entered by the user. The attribute value must begin with the value entered ($param1). Since the lower operator is used, the search is not case sensitive.

POP2000>=$param1 and POP2000<$param2

Selects layer elements that have the POP2000 attribute value within the range defined by the two values that were entered ($param1 and $param2).

Form layout

External queries

This type of query is used when the search must be conducted within the data of an external database. The external database must contain a field that links to a layer attribute. A select SQL query is executed in the external database and the values returned are then associated with the layer elements using the link field.

Database

Select the database in which you would like to perform your query.

SQL query

Enter the SQL query that will be executed in the database to search for elements.

Example

select * from cities where CITY_LANGUAGE='$param1'

Searches the database selected above, in the cities table. Retrieves all fields of records for which the value of the CITY_LANGUAGE field is equal to the value entered by the user ($param1).

Layer attribute

Among the layer attributes, indicate which one is used to link with the database.

Field

Among the fields returned by the SQL query, indicate which one is used to link with the layer.

Form layout

Required and optional parameters

Although search forms are designed to mark fields as required or optional, the where clause of the query must be adjusted to support this option. To accomplish this, any part of the query that is associated with optional parameters must be included between braces ( { } ).

Example of WHERE clause:

CITY = '$param1' and { COUNTRY = '$param2' }

Multiple values for the same parameter

$multiple{true|false} {$delimiter{;}}

Example:

CITY = '$param1{$multiple{true} $delimiter{;}}'

Searches for cities whose CITY attribute value is equal to one of the values entered in parameter 1. The values are separated by semicolons.

Managing attribute queries

Attribute queries can be modified by administrators. In JMap Dakar and later versions, when a project’s queries are modified, the applications that disseminate the project do not need to be redeployed because the changes are reflected directly.

Organizing attribute queries

Attribute queries can be organized into groups. This is particularly useful for projects that have a large number of queries.

To create a new group, click on the Create group buttonon the Queries tab.

To delete a group, select it in the list and click on Delete.

Deleting attribute queries

Deleting an attribute query permanently deletes the query and its associated form. To delete a query, select it in the list and click on Delete.

Publishing queries

Once a query has been created, it is automatically published. However, you can disable this publication, which will make your query unavailable in applications, but its configuration will still be saved. If you do not want your query to be published, clear the Published checkbox of your query in the query management interface.

Queries on referenced layers

When a project contains referenced layers, the queries configured on these layers are automatically available in the project. The project “inherits” these queries.

You cannot modify these queries from the project; they can only be modified in the project that contains the original layer.

If you wish to make changes to a query on a referenced layer, create a copy of the query by clicking on Clone. The configuration interface shows the search parameters that you can modify.

Once the new query has been configured, you can clear the Published check box of the query that was “inherited” from the referenced layer if you no longer want it to be available in JMap applications. If the Published check box is cleared for an attribute query on a layer, that query will no longer be available in the projects that use the referenced layer.

Press this button to configure the query form. See for more information.

Click on this button to configure the query form. Refer to the section for more information on this topic.

This example searches for cities for which the attribute value CITY is equal to the value of parameter 1 ($param1) entered by the user and who optionally have their value for the COUNTRY attribute equal to the value of parameter 2 ($param2) entered by the user. If parameter 2 is left blank , the entire block { COUNTRY = '$param2' } is removed from the query, along with the and operator, which is now an orphan. Note that the administrator must absolutely define $param2 as optional when designing the form. Refer to the section for more information on designing forms.

Multiple values can be entered with a type field in the forms. The values are separated by the delimiter character ; (semicolon). This option can be activated in the WHERE clause of the query. The syntax is as follows:

To modify the order of groups, click on Modify and select Reorder groups. The window that is displayed allows you to drag and drop the groups in order to change their order. To rename a group, click on .

You can also create a new query on a referenced layer as described in the section .

Forms
List (multiple choices)
Organizing attribute queries
Creating a new attribute query
Forms
Forms