Standard WebGIS server is included to the Wialon local. By default, any address information used for online tracking and reports is taken directly from it.
AVD format files are used in WebGIS. Files of such a format could be created from other vector data formats, such as MP, MapInfo, ESRI Shape, OSM (OpenStreetMap). Note that the source map should be done in the WGS-84 coordinate system (in grades).
Source maps in the supported vector format should be downloaded to the server. The source maps files should be given as data archive (TAR, RAR, ZIP) including a set of configuration files. Depending on the source map format, the archive should include a particular set of files.
To successfully unpack the archive on the server, the first one should not contain subfolders.
Compilation parameters
Parameter | Description |
---|---|
Map name | Map name, for example, the name of the city for which the map is created. |
Map tag | Map tag like city, country, etc. Could be used for a search or as a drawing filter. |
Priority | Map priority; 100 by default. Bigger priority means earlier map render. Maps with minor priority are rendered later and are situated above those with bigger priority. |
Min level | The minimum desired level at which to draw a map (0-16). |
Max level | The maximum desired level at which to draw a map (0-16). |
Add search | Add information for search to the map. |
Capital letters | Consider letter case (lower/upper) in the MP file address info (cities, regions, countries). |
Clear background | Clear background on render map option is used for combining multiple maps. Maps with higher priority situated in lower layers are not displayed. If maps overlay, the top (more detailed) map is displayed. The background is white. The flag is highly recommended to be used. |
Skip render | Skip map rendering is used when you do not want to add drawing information to the file (in this case, the map is used for a search only). |
Skip default render | Not to include the drawing information for the map into the file by default. Map rendering is available only for the billing plans with the corresponding map tags. |
Skip addresses | Not to add information to the file for reverse geocoding (determining the address by coordinates) on the map (it is used only for rendering). |
To create a map from the Polish MP format, you have to use a special XML configuration file. To download it on the server, an archive consisting of a source map in MP format and of a configuration XML file should be created.
The names of the configuration XML file and of the archive must be the same.
Standard configuration file transforming MP files to AVD files (pfm.xml) can be downloaded here: http://distro.gurtam.com/maps_cfg/. You can create your own configuration file according to your requirements.
Example:
<pfm> <feature type="0x0001" shape="PL" avd_type="1" max_level="2" name="A restricted access major divided highway, normally with 2 or more running lanes plus emergency hard shoulder. Equivalent to the Freeway, Autobahn, etc." use_addr="1" is_street="1"/> <feature type="0x0002" shape="PL" avd_type="3" max_level="2" name=" Important roads that aren't motorways. Typically maintained by central, not local government. Need not necessarily be a divided highway." use_addr="1" is_street="1"/> <feature type="0x0003" shape="PL" avd_type="5" max_level="2" name="Roads generally linking larger towns." use_addr="1" is_street="1"/> <feature type="0x0004" shape="PL" avd_type="7" max_level="2" name="Roads generally linking smaller towns and villages." use_addr="1" is_street="1"/> <feature type="0x0000" shape="PL" avd_type="9" max_level="2" name="Minor roads." use_addr="1" is_street="1"/> <feature type="0x000a" shape="PL" avd_type="11" max_level="1" name="Unclassified roads typically form the lowest form of the interconnecting grid network." use_addr="1" is_street="1"/> <feature type="0x0042" shape="PL" avd_type="12" max_level="1" name="Unpaved roads." use_addr="1"/> <feature type="0x3008" shape="POI" avd_type="59" max_level="0" name="A fire station." use_addr="1" is_house="1"/> <feature type="0xf001" shape="POI" avd_type="60" max_level="0" name="Bus station." use_addr="1" is_house="1"/> <feature type="0x2f06" shape="POI" avd_type="61" max_level="0" name="A bank." use_addr="1" is_house="1"/> <feature type="0x2b00" shape="POI" avd_type="62" max_level="0" name="A hotel." use_addr="1" is_house="1"/> </pfm>
The following parameters are used in the configuration XML file.
Parameter | Description |
---|---|
use_addr | Use this element when searching an address by coordinates. |
is_city | Use this element when searching a place by name (city). |
is_street | Use this element when searching a street by name (street). Locking (snap) to roads function can also use this element. |
is_house | Use this element when searching a house by name or number (house). |
is_road | The road. This element can also be used to lock the unit's movements to existing roads. |
type | Source type from MP file (Polish format). |
shape: | PG — polygon, PL — polyline, POI — point. |
avd_type | Resulting map type in AVD file (0—255). |
max_level | Maximum level to store map data in AVD format. Levels depend on meterage: o level — from 10 to 250 meters, 1 level — from 250 m to 20 km, 2 level — from 20 to 500 km. |
name | The name of an object, area, point, that is a custom mark. |
- source MP file must be encoded in Win 1251, and the inscription (IMG ID) must contain the string CodePage=1251;
- source MP file must be encoded in Win UTF-8, and the inscription (IMG ID) must contain the string CodePage=1252 or other value different from 1251.
Creating maps from OSM format
To create maps from OSM format files, a configuration XML file or allCountries.txt are used. To download on the server, an archive containing OSM format source map, configuration XML file, and allCountries.txt should be formed. The last one (allCountries.txt) is an additional file for address binding. The document consists of world cities list in which the population size is indicated. An approximate radius of a city is calculated on the basis of the special algorithm and depends on the population size.
osm.xml is a configuration file transferring OSM files to the standard AVD files.
Standard configuration file transferring OSM files to AVD files (osm.xml) and allCountries.txt could be downloaded here: http://distro.gurtam.com/maps_cfg/.
Maps from other vector formats
To create maps from other vector formats such as MapInfo, ESRI shapefile, etc., it is necessary to download an archive consisting of the source map layers in a corresponding format and of a configuration XML file.
XML file should be encoded in UTF-8 without BOM:
<conv name="cheljabinskaja" encoding="utf8"> <layer file="chel-roads-l.shp"> <features max_level="1" name="$NAME" use_addr="1" is_street="1" region="$ADDR_REGIO" street="$NAME"> <mod filter="(highway ='bridleway') or (highway ='living_street')" type="14"/> <mod filter="(highway ='path') or (highway ='steps')" type="16"/> </features> </layer> <layer file="chel-buildings-a.shp"> <features type="210" max_level="1" name= "$ADDR_HOUSE" is_house="1" region="$ADDR_REGIO" street="$ADDR_STREET" house="$ADDR_HOUSE" use_addr="1"/> </layer> <layer file="chel-city-p.shp"> <features type="64" max_level="2" name="$NAME" address="$NAME"> <mod filter="PLACE ='village'" type="66" is_city="1" region="$ADDR_REGIO" max_level="1" name="$NAME" address="$NAME"/> <mod filter="PLACE = 'town'" type="65" is_city="1" region="$ADDR_REGIO" max_level="1" name="$NAME" address="$NAME"/> <mod filter="PLACE = 'city'" type="64" is_city="1" region="$ADDR_REGIO" max_level="1" name="$NAME" address="$NAME"/> </features> </layer> <layer file="chel-landuse-a.shp"> <features type="166" max_level="1" name="$NAME"> <mod filter="LANDUSE ='Military'" type="173" max_level="1" name="$NAME"/> <mod filter="LANDUSE ='cemetery'" type="147" max_level="1" name="$NAME"/> <mod filter="LANDUSE ='commercial'" type="151" max_level="1" name="$NAME"/> <mod filter="LANDUSE ='forest'" type="165" max_level="1" name="$NAME"/> <mod filter="LANDUSE ='nature_reserve'" type="184" max_level="1" name="$NAME"/> <mod filter="LANDUSE ='residential'" type="166" max_level="1" name="$NAME"/> </features> </layer> <layer file="chel-admin-a.shp"> <features type="0x004a" shape="PG" avd_type="0" max_level="0"/> </layer> </conv>
The file starts and ends with the conv tag. The following keys can be used inside this tag:
name — map name, encoding — file encoding for a conversion.
The main part of a map conversion is the description of the layers used to receive data. The layer tag allows to describe each layer individually and, if provided by different attributes, converse a map according to them.
The file key is used to define the layer file.
Then you should indicate the features layer properties. In the type key, it is necessary to indicate the elements' type value from the map in the format .avd (see it in pfm.xml or osm.xml). The name parameter is used to display any properties of a converted object. This parameter will be used as a caption for objects on the map. Only Latin letters and $ sign are accepted. In the above-mentioned example, the names for the used fields could be found in the files indicated there,i.e., in .shp. If other symbols are used, the file may be converted with errors or not converted at all. If you would like to convert such files, you should change the fields' names for the Latin ones.
It is also necessary to indicate the level on which the maps from the file will be situated. The max_level parameter is in charge of it. Depending on your preferences, you can vary these parameters from 0 to 2 or leave them as in pfm.xml or osm.xml.
The following parameters are optional.
Parameter | Description | Example |
---|---|---|
data_type | Object type: polygon (pg), polyline (pl), point (poi). | data_type="pg" |
address | Define address by the indicated value. | |
region | Define region name by the indicated value. | region="$Region" |
street | Define street name by the indicated value. | street="$st" |
street_type | Define street type by the indicated value. | street_type="$sts_type" |
house | Define house number by the indicated value. | house="$number" |
is_city | Define if this object is a city. If it is not, do not use this parameter. | is_city="1" |
is_street | Define if this object is a street. If it is not, do not use this parameter. | is_street="1" |
is_house | Define if this object is a house. If it is not, do not use this parameter. | is_house="1" |
dump_attr | It is responsible for displaying particular object properties (in stdout). It works in the same way as the name parameter, but it displays information for a user who is converting the map. |
Here is an example.
Let us assume, that we have two layers:
- the cities layer with the fields ID, Name, Region;
- the streets layer with fields ID, City, CityID, Name.
Then, - to get street name and the city, use
$Name|, |#CityID.Cities.Name; - to get the city and region while searching by another field, use
$Name|, |#City.Cities.Region.Name='%'.
If you have noticed that the layer file contains objects of different types (you can check it with the dump_attr parameter), and you want to display them as different types, use the 'mod' tag. There you set filtration conditions and object type expected as the result of the conversion process. In the filter parameter enter the condition as SQL query. The type parameter is set in the same manner as it was described above.
In one layer there can be any number of features. In one feature there can be any number of mod.
If there is an error when reading the file, try to open it in another program, for example, Internet Explorer: if there are any errors in file body, IE displays only the correct part of the file. However, note that the check is performed only for opening/closing tags.
Use comments to make further editing and usage of the file easier.