When multiple layers are published in a shape in GeoServer, the blank call problem and solution are displayed. geoservershape

Source: Internet
Author: User

When multiple layers are published in a shape in GeoServer, the blank call problem and solution are displayed. geoservershape

GeoServer was used in a recent project. It was used in a hurry and encountered many unexpected problems, "When multiple layers are published in a shape file, the openlayers call is blank." This is one of them. I cannot explain it. I will go to the GeoServer Chinese community to check the posts and finish scanning UserManual in GeoServer.org, it took me a day and a half and I couldn't find the answer. I couldn't help but think about it when I was squatting at noon. There was no relevant information everywhere. It was definitely not a conventional problem, so I calmed down and thought, publish several key links of a layer and the principle of service rendering. Work Area> data storage> (layer + style + ......), A data layer can be published to multiple layers. After rendering data in different styles on the server side, the layer is saved to different folders and passed back to the client, later, almost at the same time, a senior technical engineer of the company and I both thought that the problem was due to the style. In fact, this is really true !!.


1. To understand the problem, you must first understand the Style File structure:


There are two key names,SLD: NameIs the style name,SLD: FeatureTypeNameIs the name of the layer applied by the style. It cannot be shown before, that is, the name of the publishing layer does not match the name in the style used, after the style is applied, the layer does not match the layer name specified in the style. (no error is reported. Is it also a weak type ,,,)

2. Problem Reproduction

The Service Release name is jzmd, The FeatureTypeName in the U_JZMD style is grid200_avg2, and the style is U_JZMD when the jzmd layer is released.


After the release, the openlayers browsing results are as follows:



3. Problem Solving

Modify the value of FeatureTypeName in the U_JZMD style to jzmd, set the style Name U_JZMD on the page to the same as that in the style file, and set SLD: Name To U_JZMD.


Submit and then browse:


4. Summary

Open-source products are easy to use because they have a lot of English and less information, but it is really difficult. But remember, when you encounter problems, you must think more about the principle and there are always more solutions than problems.

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.