Navigation:  WebOffice APIs >

Service API

Previous pageReturn to chapter overviewNext page

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 functionalities into websites or web applications with a non-GIS focus.

Prerequisite for a map image is a running WebOffice 10.5 SP2 project. Instead of calling the project with http://<WebOffice web application>/synserver the preview images are called with http://<WebOffice web application>/synservice.

Several parameters, known from the URL Call Interface, are supported (a detailed description for the parameters can be found in the Chapter WebOffice URL Call interface):

project

query (1… n)

keyname (1… n)

keyvalue (1… n)

user

password

usergroup

roles (Authentication Type HTTP and Authentication Type Portalverbundprotokoll)

x

y

scale

width

height

view

basemapview

xmin

ymin

xmax

ymax

lat

lon

coordmarker_lat_lon

coordmarker_id

metainfo

projectinfo

geo_bookmark

exclude_north_and_scale

separator

 

In order to get information about the current version (version and build time), just enter a synservice-request without the parameter "project".

Example request: http://w-ws-wintner/WebOffice_LatestBuild/synservice

The response of the synservice-request provides the following information in the metainfo section:

{"METAINFO":{"version":"10.3","build":"20121122-1429","mw_lic":"true"},"response_id":"eb297dd2-f2eb-495f-a29d-bc9a6bbb00c5"}

version: installed WebOffice version (major release)

build: current build of the WebOffice version

mw_lic: Existence 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: http://w-ws-wintner/WebOffice_LatestBuild/synservice?project=LowerAustriaEdit&projectinfo=true

The JSON-response shows layer IDs of geometry types of editing layers in the node PROJECTINFO:

{

 "MAP": {

   "url": "http://w-ws-wintner/weboffice_output/Ost_sterreich__Standard_Version__20130306_102425_594_11.jpg",

   "x": 625622,

   "y": 485147,

   "scale": 352005.59520002216,

   "width": 640,

   "height": 400,

   "upp": 93.13499999999999

 },

 "PROJECTINFO": {

   "projectname": "LowerAustriaEdit",

   "scales": null,

   "editlayers": [

     {

       "layername": "railroads",

       "geometry_type": "LINE"

     },

     {

       "layername": "Roads",

       "geometry_type": "LINE"

     },

     {

       "layername": "Settlements",

       "geometry_type": "POINT"

     },

     {

       "layername": "bahnhoefe",

       "geometry_type": "POINT"

     },

     {

       "layername": "datatypes",

       "geometry_type": "POINT"

     }

   ]

 },

 "response_id": "98ca1d2e-eef1-43fa-9e9d-b64efdf1297a"

}

 

 

Note: query/keyvalue: To use these parameters for a Geolocator Search see chapter: WebOffice URL Call Interface.

 

The following parameters are used for the 'synservice'- interface support:

 

image_format (PNG | JPG | data_only)

 The value "data_only" means that no image is generated when editing a single feature - as well as during bulk editing - which means that the database, CPU and memory can be freed up if a large                number of individual editing calls are made.

 

returnkey (the parameter controls the results in a passed on query, which is returned in the specified attribute return)

 

dpi (to provide high quality map images for external applications. Default value is 96 dpi, using this parameter you can define a multiple of 96, e. g. dpi=196 or dpi=288)

 

Note for returnkey: A rather simple usage for the returnkey could be:

synservice?project=Test_Stmk&query=test&keyname=OBJECTID&keyvalue=1&returnkey=Name

It is possible to get more results with one returnkey, therefore multiple returnkeys are separated by ; (e.g. &returnkey=Name;ID;...)

 

Not for user/password: Since WebOffice 10.4 SP1 the choice of groups can be handled via the parameter usergroup.

 

Note for dpi: If you call for an image with &dpi=288, you get an image with 288 dpi, which will be displayed for 96 dpi. Therefor you have to adapt also the image size. In this case (288 dpi; triple 96) you have to display a triple-amplified image (width/height).

 

Note: For using the query, keyname and keyvalue parameter an External-Layer-ID and Search field are needed.

 

Note: For using the editing functionality (URL Call parameters for editing support for Service API) with the parameters editaction, editkeyfield, editkeyvalue and geometry, please contact your corresponding WebOffice support team.

 

To get an impression of an example, how to use the JSON image preview in a website and to have an interface where you can test your calls, SynerGIS provides the file 'preview.jsp'. Call it with http://<WebOffice web application>/client_preview/preview.jsp

 

Note: 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:

 

Note that specified default map views will be ignored. The displayed layers depend on the TOC of map collection only!