What is Web Map Service (WMS)
- Published on
Article Number : 19
WMS, short for "Web Map Service," is a technology that provides web-based map services through a standard protocol. It is used to view, retrieve, and utilize map data over the internet.
WMS relies on a client-server model. The client (usually a web browser) sends a map request to the server, and the server processes the requested map data and sends it back to the client. The client then uses this data to display the map.
WMS can provide map data in either vector or raster format. Vector data typically represents geometric representations of geographic objects (such as points, lines, polygons), while raster data consists of images composed of pixels.
WMS supports several fundamental functions:
Map Viewing: It allows users to view map data. The client can focus on a specific geographic area, scale in or out, and display different layers.
Map Querying: Users can query specific geographic features or areas on the map to obtain information. For example, information like coordinates of a specific point or the area of a region can be retrieved.
Map Layering: WMS supports different map layers. Each layer represents a different geographic dataset, and the client can choose which layers to display or hide.
Map Styling: Users can customize the appearance of map layers. Properties such as colors, symbols, line thicknesses can be specified.
WMS has become a fundamental component for geographic information systems (GIS) and web-based mapping applications. Particularly, online map service providers and organizations utilize WMS technology to enable users to easily access various map datasets.
WMS (Web Map Service) and OGC (Open Geospatial Consortium) are important concepts in the field of Geographic Information Systems (GIS), and there is a strong connection between them.
OGC is an international consortium that develops and promotes standards for geographic data and services. WMS is a service protocol defined by OGC, enabling the web-based presentation of geographic maps.
In other words, WMS is a service developed based on the standards set by OGC. OGC provides a framework for standardizing and ensuring the interoperability of services like WMS.
Therefore, the connection between WMS and OGC lies in WMS being developed in accordance with OGC standards and OGC's role in defining and developing standards in the field of Geographic Information Systems.
Get Request Parameters Meaning
Sample Get Request URL :
http://example.com/wms?
service=WMS &
version=1.3.0 &
request=GetMap &
layers=layer1,layer2 &
styles= &
format=image/png &
transparent=true &
crs=EPSG:3857 &
bbox=xmin,ymin,xmax,ymax &
width=800 &
height=600
The basic parameters used in WMS (Web Map Service) requests are listed below:
Service: Specifies the type of WMS service. Usually indicated as "WMS".
Version: Specifies the version of the WMS protocol. For example, "1.1.1" or "1.3.0".
Request: Specifies the action requested from the server. For example, "GetMap" is used to retrieve a map, while "GetCapabilities" is used to retrieve server capabilities.
Layers: Specifies the layers to be displayed in the map request. Multiple layers are separated by commas.
Styles: Specifies the visual styles of the specified layers. Used for customizing colors, opacity settings, etc., especially for layers.
Format: Specifies the desired output format of the map data. Typically formats like "image/png", "image/jpeg", "image/gif" are used.
SRS/CRS: Specifies the coordinate reference system in which the map data should be transformed. For example,"EPSG:4326" (WGS 84) or "EPSG:3857" (Web Mercator).
BoundingBox: Specifies the boundaries of the map image. Usually contains the coordinates of the bottom-left and top-right corners.
Width: Specifies the width of the requested map image in pixels.
Height: Specifies the height of the requested map image in pixels.
Transparent: Specifies the transparency of the map layers. Can be set as **"True" **or "False"
Background Color: Specifies the background color of non-transparent areas.
These parameters are commonly used when constructing a WMS request and are essential in determining the map data requested from the server. Each parameter is crucial for processing the request in a specific manner and ensuring the correct presentation of the requested map data.
Getting Geometry Info from WMS use by Coordinate
Sample Get Request
http://example.com/wms?
service=WMS &
version=1.3.0 &
request=GetFeatureInfo &
layers=my_layer &
styles= &
format=application/json &
transparent=true &
crs=EPSG:4326 &
bbox=longitude_min,latitude_min,longitude_max,latitude_max &
width=800 &
height=600 &
query_layers=my_layer &
info_format=application/json &
feature_count=1 &
x=click_x &
y=click_y
You can follow several steps to send a WMS query using the coordinates of the clicked point and obtain data in GeoJSON format. This process can optionally be implemented within an interface or application. Here's a general approach:
Retrieve the Coordinates of the Clicked Point: Obtain the coordinates of the point clicked by the user. These coordinates are typically expressed as the x and y coordinates of a point on a map.
Create a WMS Request: Use the obtained coordinates of the point to create a WMS request. This request is usually used to retrieve map data for a specific area. The WMS request should be in URL format and be determined based on the coordinates of the clicked point.
Send the WMS Request and Receive the Response: Send the created WMS request to the server and receive the response from the server. This response typically contains map data.
Generate GeoJSON: Convert the received map data into GeoJSON format. You can use a geographic data conversion library or tool for this purpose. This process involves converting the received data into GeoJSON format, specifying geographical features, and geometries.
Utilize the GeoJSON Response: Use the transformed data in GeoJSON format as the response to your request. You can display it on a map, analyze it, or use it for other purposes.
These steps outline a general approach to sending a WMS query using the coordinates of the clicked point and obtaining data in GeoJSON format. However, depending on your application's requirements and available resources, you may need to develop a specific application or code snippet. This process is typically implemented within an interface or web application and relies on user interaction.
Getting Layer List and Infro Use by GetCapabilities
Sample URL
http://example.com/wms?
service=WMS &
request=GetCapabilities
The XML structure you will encounter when this URL is opened resembles the following:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE WMT_MS_Capabilities SYSTEM "http://schemas.opengis.net/wms/1.3.0/capabilities_1_3_0.dtd">
<WMT_MS_Capabilities version="1.3.0" xmlns="http://www.opengis.net/wms">
<Service>
<Name>OGC:WMS</Name>
<Title>Example WMS Server</Title>
</Service>
<Capability>
<Request>
<GetCapabilities>
<Format>text/xml</Format>
</GetCapabilities>
<GetMap>
<Format>image/png</Format>
<Format>image/jpeg</Format>
</GetMap>
<!-- Other request types may be listed here -->
</Request>
<Layer>
<Title>Base Maps</Title>
<Layer>
<Name>basemap1</Name>
<Title>Basemap 1</Title>
<CRS>EPSG:4326</CRS>
<BoundingBox CRS="EPSG:4326" minx="-180" miny="-90" maxx="180" maxy="90"/>
<!-- Other properties of basemap1 layer -->
</Layer>
<Layer>
<Name>basemap2</Name>
<Title>Basemap 2</Title>
<CRS>EPSG:3857</CRS>
<BoundingBox CRS="EPSG:3857" minx="-20037508.3428" miny="-20037508.3428" maxx="20037508.3428" maxy="20037508.3428"/>
<!-- Other properties of basemap2 layer -->
</Layer>
</Layer>
<!-- Other layers may be listed here -->
</Capability>
</WMT_MS_Capabilities>
You can parse use by a XML parser
How do I add a WMS layer to the map?
I have added a feature in GISLayer software for this. By watching the video below, you can easily display your WMS source on the map.
a Web Software for adding a WMS on the Map
Which software can provide WMS publishing?
The software that can provide WMS publishing includes:
ArcGIS Server: Developed by Esri, it's part of the popular Geographic Information Systems (GIS) software ArcGIS. ArcGIS Server provides WMS services, allowing users to access geographic data over the web.
GeoServer: An open-source GIS server that supports standard OGC services such as WMS, WFS (Web Feature Service), and WCS (Web Coverage Service). GeoServer facilitates the web-based sharing of geographic data.
MapServer: An open-source GIS server that provides WMS services and can be used to distribute map data over the web.
QGIS Server: A component of QGIS, QGIS Server enables the web-based presentation of geographic data. QGIS Server provides WMS services and allows sharing QGIS projects over the web.
Mapnik: An open-source map rendering engine that can provide WMS services. Mapnik can be used to create customizable maps and is useful for map visualization on the web.
These software options offer various capabilities for publishing geographic data and support the WMS protocol.
Thanks for read my blog...