Service API
The HTTP Service API (REST style) is capable of returning map image files or JSON (Javascript Object Notation) responses for easier and faster integration of light weight GIS functionality into websites or web applications with a non-GIS focus.
Prerequisite for a map image is a running WebOffice 10.9 R4 project. Instead of calling the project with https://myserver.domain.com/<WebOffice web application>/synserver the preview images are called with https://myserver.domain.com/<WebOffice web application>/synservice.
Several parameters that known from the URL call inteface are also supported (a detailed description for the parameters can be found in the Chapter WebOffice URL Call interface):
Actions / Parameter |
Description |
||||
---|---|---|---|---|---|
Basic Information |
|||||
project |
Specifies the ID of the project (Project ID) to be launched by WebOffice 10.9 R4 client. E.g. use project=WebOffice_SampleProject for starting the WebOffice 10.9 R4 Sample Project configuration. |
||||
projectinfo |
The JSON response shows the layer ID as well as geometry types and edit layers in the node PROJECTINFO |
||||
metainfo |
The JSON response shows METAINFO information regarding version and build time. |
||||
user |
User (when using WebOffice UserManagement) |
||||
password |
Password (when using WebOffice UserManagement) |
||||
usergroup |
Define a user group to avoid manual selection of UserManagement groups (when using WebOffice UserManagement) |
||||
roles |
Role for Authentication type HTTP and Authentication type Portalverbundprotokoll (when using WebOffice UserManagement) |
||||
um_fallback |
If an UM Fallback is configured at the Authentication type, the parameter um_fallback=True allows the authenitication via an UMDB user. |
||||
Map Display |
|||||
x (map units) |
Define this parameter to set the center point (x coordinate) for initialization |
||||
y (map units) |
Define this parameter to set the center point (y coordinate) for initialization |
||||
scale |
Define this parameter to set the scale for initialization |
||||
width (px) |
Width (in pixels) of the map image |
||||
height (px) |
Height (in pixels) of the map image |
||||
view |
Defines the Map View to be used in the map image. The configuration of a map view contains a unique ID (External ID). For example, if the ID in WebOffice author standalone is citymap, then use view=citymap |
||||
basemapview |
Defines the Basemap View to be used in the map image. The configuration of a basemap view contains a unique ID (External ID). For example, if the ID in WebOffice author standalone is orthofoto, then use basemapview=orthofoto |
||||
geo_bookmark |
Use this parameter if you want to display the map at a certain spatial extent.
|
||||
exclude_north_and_scale=true |
With the parameter &exclude_north_and_scale=true only a map image will be displayed. North arrow, scale bar and copyright will be suppressed. |
||||
dpi |
Allows the creation of high quality map images for third application. By default map images are rendered with a resolution of 96dpi. Increase the value to e.g. 192 or 288 for higher resolution.
|
||||
Position |
|||||
xmin ymin xmax ymax |
Use these 4 parameters for specifying the initial map extent. |
||||
lat lon |
starts the application centered at the WGS84 position defined by lat/lon (decimal degrees, decimal separator = .); this works with any project disregarding the projection of the project since lat/lon values are projected from WGS84 to the project coordinate system |
||||
coordmarker_lat_lon |
Displays an image (by default pub\images\meet_x_20_20.png) to mark the spot which was defined by the specified coordinates. Separate the coordinates either with a space character or with %20. Example: "&coordmarker_lat_lon=47.069 15.435" "&coordmarker_lat_lon=47.069%2015.435"
|
||||
coordmarker_id |
Enter the ID which is configured in WebOffice author standalone in Meeting Points as External Marker-ID. This image will be displayed on the spot that was defined in the parameter coordmarker_lat_lon. |
||||
Functions |
|||||
query (1... n) keyname (1... n) keyvalue (1... n) separator
|
For executing a WebOffice 10.9 R4 search it is possible to pass these parameters. WebOffice 10.9 R4 then executes the search and displays the results in the Search result and map.
The parameter query identifies a predefined query.
The separator parameter defines the separator between multiple search values (keyvalue). Following characters can be used as separators: @ ; - ! ~ / : = |
||||
returnkey |
manages the result of the executed query where the attribute determined in the returnkey will be sent back in the response.
|
||||
gp_tool gp_param_name gp_param_value |
Specification of a GP tool configured in the project (gp_tool), whose result is returned, as well as its parameters (gp_param_name) and their values (pg_param_value). |
||||
query_fts_mw |
For more details see FTS in Service API |
||||
suggId_fts_mw |
For more details see FTS in Service API |
||||
edit |
For more details see Editing in Service API |
||||
The value data_only determines that when editing a feature (or multiple features) no image will be created in order to minimize CPU and memory usage. |
In order to get information about the current version (version and build time), just enter a synservice-request without the parameter project.
Example request: https://<myserver>/WebOffice/synservice
The response of the synservice-request provides the following information in the METAINFO section:
{
"METAINFO": {
"version": 10.5,
"build": 20130228-1717,
"mw_lic": true"
},
"response_id": 1ead5c3c-1bcc-4cd6-b4b0-e186d42df2ca"
}
Aktionen / Parameter |
Beschreibung |
---|---|
version |
Installed WebOffice version (majore release) |
build |
Curretn build of the WebOffice version |
mw_lic |
Existance of a WebOffice map widget license (true/false) |
By calling a project together with the parameter &projectinfo=true information about geometry types of editing layers will be returned.
Example request: https://<myserver>/WebOffice/synservice?project=World&projectinfo=true
The JSON-response shows layer IDs of geometry types of editing layers in the node PROJECTINFO:
{
"MAP": {
"url": http://myserver/wo_output/World_20130304_152121_620_40.jpg,
"x": 1288411.5,
"y": 6023839.5,
"scale": 1.174874185680074E7,
"width": 640,
"height": 400,
"upp": 3108.5275
},
"PROJECTINFO": {
"projectname": World,
"scales": null,
"editlayers": [
{
"layername": points,
"geometry_type": POINT"
},
{
"layername": lines,
"geometry_type": LINE"
},
{
"layername": areas,
"geometry_type": POLYGON"
}
]
},
"response_id": 00e38478-4ec4-43e6-88b4-13e245c4073c"
}
To get an impression how to use the JSON image preview in a website and to have an interface where you can test your calls, VertiGIS provides a demo website (file preview.jsp).
Open the preview website https://myserver.domain.com/<WebOffice web application>/client_preview/preview.jsp
Demo website for synservice interface
The image format of the response image is configured in the image blending options of the WebOffice application configuration |
see chapter Image Blending for details. |
Here you can test your requests and responses, e.g.:
../synservice?project=WebOffice_SampleProject&query=CNTRY&keyname=CNTRY_NAME&keyvalue=Austria&width=300&height=200
for a JSON request. The response to embed in your website would be:
{
"MAP": {
"url": http://<configured output folder>/Demo-Projekt_f_r_WebOffice_Demo-Projekt_f_r_WebOffice_20101210_131400_478_0c.png,
"x": 4570333.84795,
"y": 2744950.30755,
"scale": 7889575.407841748,
"width": 300,
"height": 200,
"upp": 2087.4543349000005
},
"FEATURES": {"COORDS": [{
"x": 150,
"y": 117
}]}
}
The request for an image would be:
../synservice?project=WebOffice_SampleProject&query=CNTRY&keyname=CNTRY_NAME&keyvalue=Austria&width=300&height=200&format=image
which you could directly embed as source of an image to a website:
That specified default map views will be ignored. The displayed layers depend on the TOC of map collection only! |