WMS Common Operations

Source: Internet
Author: User

Outside the question:

Since the change of work is very little time on the Internet, the new units do not let the Internet, so the blog has not been updated, although the quality of the post is generally like it, but think it is better to persist in writing, today, Beijing, rainy days, write some of the recent work in the income bar!

Overview:

The most recent work involves geoserver and openlayers content, this article summarizes some of the most common WMS operations involved in recent work for later use.


First, get the layer legend

The way the WMS service obtains the diagram is:

http://localhost:8080/geoserver/china/wms?request=getlegendgraphic&version=1.3.0&format=image/png& Layer=capital

Description

1. Request: The method must be getlegendgraphic;

2, the VERSION:WMS version, generally 1.1.0;

3, Format: formats, can be image/jpg,image/tif,image/png, etc., generally for image/png;

4, Layer: layers.

Effect:

Show effect

Legend effect


2, Cql_filter

Cql_filter is a condition-based display of a field, as follows:


Data table above, if you only need to show id>10 objects in the map, you can write this when you create a WMS layer:

var demolayer = new OpenLayers.Layer.WMS ("China", "http://localhost:8080/geoserver/china/wms", {layers: ' China: Capital ', Format: ' Image/png ', Cql_filter: "[id>10]"});

The results are shown below:


Before filtering


After filtering


The blog post will also be added and updated based on the content of the work.



WMS Common Operations

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.