Skip to content

Geographic Role

When creating maps, it is necessary to confirm the location on the map based on geographic information. The Place Mode locates the position on the map based on geographic names, countries, first-level administrative regions, second-level administrative regions, and third-level administrative regions. When using the Place Mode for positioning, it is first necessary to convert the geographic name field into a geographic role. This involves matching the geographic name field with the corresponding geographic location names in the system. A successful match indicates that the geographic information can be displayed on the map.

Below is a detailed introduction to geographic roles and their usage.

Types of Geographic Roles

Geographic roles include four types: country, first-level administrative region, second-level administrative region, and third-level administrative region. Currently, the system pre-configures data for various administrative regions in China and the United States. Data for other countries' administrative regions needs to be adapted by the user Geographic Data Adaptation.

Geographic Role Conversion

Geographic information fields can be converted into geographic role fields using the following two methods:

Method One: In the data area of the map editing page, click the dropdown arrow of the geographic information to be converted, and select the corresponding administrative region in Geographic Role.

Method Two: In Dataset -> Field Management, based on the alias of the geographic information to be converted, click the dropdown arrow of the corresponding Field Type, and select the corresponding administrative region in Geographic Role.

Geographic Role Matching

During the geographic role conversion process, if the geographic information field does not match the corresponding geographic role, a geographic role matching window will pop up, allowing the user to manually match the unmatched fields. The left side of the matching window displays the geographic role matching status on a map, with successful matches highlighted. The right side displays the matching status in a list, with unmatched items marked in red.

Click on the unmatched item Yixing, search for the province and city where Yixing is located, and then select the corresponding administrative region. In this example, the conversion is done using the second-level administrative region, so Yixing can only be matched with Wuxi City. If the conversion is done using the first-level administrative region, Yixing would be matched with Jiangsu Province. After handling all unmatched items, click OK.

Tip

The matching rule requires matching only at the current administrative level. For example, if the geographic role is set to the first-level administrative region, the field "Haidian District, Beijing" can only be matched with Beijing, not with the third-level administrative region. Successfully matched geographic fields also support manual modification of the corresponding administrative region. Third-level administrative region names are not unique; for example, both Nanjing and Xuzhou have a Gulou District. When matching geographic roles for third-level administrative regions, the third-level administrative region is associated with the province and city to make the name unique. This scenario requires that the province and city fields must be converted into geographic roles.

Geographic Role Field Mapping

After converting geographic information into geographic roles, you can start creating maps.

  • In simple maps, the dimension field must be a geographic role field, so dragging the geographic role field directly will generate a map.
  • In hierarchical maps, first confirm the layer's positioning mode. When the positioning mode is set to location mode, dragging in the geographic role field will generate a map. When the positioning mode is set to latitude and longitude mode, no geographic role conversion is needed; simply drag in the field to generate a map.

Geographic Data Adaptation

The system comes pre-configured with geographic data for China and the United States at various administrative levels. If you need to display data for other countries, such as Japan, Canada, Australia, etc., users need to adapt the corresponding country's geographic data files and upload them to {HengShiHome}/conf/geo/upload.

Each country's geographic data file contains geographic data for the country's first-level, second-level, and third-level administrative regions. The file type is geojson, and the administrative region files are named according to their administrative level, such as 1.json for first-level regions, 2.json for second-level regions, and 3.json for third-level regions. Finally, compress all levels of the country's administrative region geographic data into a zip package, upload it to the system's {HengShiHome}/conf/geo/upload, and restart the system.

The geographic data zip package is named using the country's English abbreviation, such as CN.zip for China, GB.zip for the United Kingdom, and CA.zip for Canada.

In the geographic data file, the properties field stores the unique identifier of the administrative region, the basic name of the administrative region, and other information. The geometries column stores geographic location information, with the center point calculated by the user. The properties consist of the following fields:

Field NameField MeaningRequiredType
nameAdministrative Region NameYesString
adcodeAdministrative Region Unique IdentifierYesString
parentCodeParent Administrative Region Unique IdentifierYes, can be omitted for first-level regions, required for other levelsString
abbrAdministrative Region AbbreviationNoString
ChineseNameAdministrative Region Chinese Name AbbreviationNoString
fullChineseNameAdministrative Region Full Chinese NameNoString
cpCenter Coordinate Point (order [longitude, latitude])Yesdouble[]

For reference, please see the China Geographic Data File Example.

Regional Map

When analyzing data using maps, the concept of regions often comes into play. For example, in weather forecasts, it is common to mention that there is heavy to torrential rain in the North China region, where North China is not a specific province or city, but rather a region that may consist of several provinces or cities. For such scenarios, the geographic role column value grouping feature can be used to combine fields in the geographic role into a new geographic role field based on actual regions. Using this new geographic role field to create a map, such a map is typically referred to as a regional map.

Geographic Role Grouping

The geographic role field, like other types of numerical column value grouping, can be grouped in the Dataset's Field Management. Click the three-dot menu of the geographic role field to perform column value grouping.

In the column value grouping interface, create a group and drag the geographic role into the new group.

The grouped geographic role forms a new field, which can be dragged into the map to generate a regional map.

HENGSHI SENSE Platform User Manual