Query services

06. 03. 2020

Spatial data from the Internet is frequently accessed through browser services in the form of map compositions. The potential use of spatial data, however, is much broader. In practice, many different tasks require determining the existence of elements or attributes on the Earth’s surface without needing to display a map of an area. To perform these tasks, the City of Prague uses query services. These are web services that allow any spatial data in a database to be searched. Query services are based on Elastic Web Service (EWS) technology. They provide access to an application interface for the public database of Geographic data of IPR Prague and the City of Prague.

The services are available through the REST interface based on XML and JSON formats (for more information, see https://cs.wikipedia.org/wiki/Representational_State_Transfer) or an XML-based interface that communicates through the XML-RPC standard protocol – POST method (for more, see http://xmlrpc.scripting.com/spec). In both cases, the services are queried using the HTTP transport protocol.

Services are available at https://ews.iprpraha.cz/
Examples of calling services are given at https://ews.iprpraha.cz/user/index.html

Brief description of using the services

Communicating with the services involves three steps:
1. User authentication (Authenticate method) – users can also be authenticated directly through HTTP Base Auth in the REST interface
2. Query for database objects (GetSchema, GetComposedQueryResult, GetStoredQueryResult)
3. User deauthentication (Deauthenticate method)

List of available methods:

  • Authenticate (username, md5)
  • Deauthenticate (sessionid)
  • GetCapabilities (sessionid)
  • GetSchema (sessionid) – method returns a list of all stored queries and accessible database objects
  • GetComposedQueryResult (sessionid, xmlrequest) – method for calling a simple (SQL) query
  • GetStoredQueryResult (sessionid, queryid, rows, offset, xmlparams) – method for calling a stored query

A more detailed description of interfaces and methods is given in the manual.


Service applications

Data services can be used to create applications to make use of Prague’s Geoportal and its potential without needing to handle map data. Typical tasks including listing objects (and their attributes) for particular coordinates (points, lines and areas, including lists of parcel numbers of polygons entered by users) or finding information about objects according to their spatial correlation with elements of other classes (e.g. determining lot prices for parcels in the land register selected according to parcel number and cadastral ID).

Data services can also be used as a simple download service for geographic data. Because the geometry of elements can be supplied as regular column values (attributes), the service can also be used as a means to distribute or update information.

Contact person: Ing. Filip Drda, drda@ipr.praha.eu