Use SVG technology to implement the special map function of WebGIS

Source: Internet
Author: User

Topic map is an important function of GIS. It intuitively expresses one or more types of data related to a topic, making the data more convincing. There are two ways to create a special map: one is to change the existing layer, for example, to change the color of each area in a layer, and different colors represent the size of the data volume; another way is to add a new layer based on an existing layer, for example, adding a new layer, including some graphical symbols (pie chart, bar chart, and so on ), add a new layer to an existing map and use these graphical symbols to show the size of the data volume.

Generally, data can be connected to an SVG file in two ways. One method is to separate attribute data from graphic files. SVG files only contain graphical data information of geographical information, attribute data is stored in the database on the server or in text files such as XML. The two are connected by a unique geographical identifier. Another method is to include attribute data and graphic information under the same group element of the SVG file. Although the SVG specification does not contain tags for attribute data, SVG is highly scalable and can use custom tags in SVG documents based on specific needs. In this way, the ID attribute in the group element is the identifier of the geographical information, and the attribute data is represented by the custom tag. The geographical information and attribute data are connected together.

There are several methods to implement the special map function in SVG. One method can be implemented using XSLT technology. Because the SVG file complies with the XML standard, you can first compile the XSL style label file according to different requirements, and then apply the style table to the original SVG file to generate a new SVG file and return it to the user. Another method is to write Javascript script code to perform operations on SVG files. The third method is that because SVG is also an XML file, you can use the C # language to write code to operate on it, open the SVG file, and analyze the file according to your needs, then, the modified SVG file is returned to the user.

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.