Geoserver中预览图层时放大到某一层级不显示(样式Styles中未设置对应比例尺的样式)

news2024/11/27 18:46:56

场景

GeoServer简介、下载、配置启动、发布shapefile全流程(图文实践):

GeoServer简介、下载、配置启动、发布shapefile全流程(图文实践)_霸道流氓气质的博客-CSDN博客_geoserver简介

geoserver在预览图层时,当发大图层时内容不显示。

比如文字text图层,放大到指定层级(比例尺变小时)不显示文字内容。

 

这是因为该图层对应的样式文件为自定义的Style,这个样式文件中未设置放大即比例尺缩小范围时对应的样式,

所以文字图层在该比例尺下不显示。

比例尺为预览时左下角的Scale = 1:5000

查看图层对应的样式文件,在图层-发布-WMS Setting-Deafult Style下

 

在Styles中找到该样式的具体代码

补充样式中缺失比例尺下的样式设置。

Geoserver的Style的样式中MinScaleDenominator与MaxScaleDenominator分别代表最小比例尺和最大比例尺下

的样式设置。

示例代码如下:

         <Rule>
          <MinScaleDenominator>5000</MinScaleDenominator>
          <MaxScaleDenominator>11000</MaxScaleDenominator>
          <Name>rule1</Name>
          <Title>Red Square</Title>
          <Abstract>A 6 pixel square with a red fill and no stroke</Abstract>
            <PointSymbolizer>
              <Graphic>
                <Mark>
                  <WellKnownName>square</WellKnownName>
                  <Fill>
                    <CssParameter name="fill">#CCCCCC</CssParameter>
                      <CssParameter   name="fill-opacity">0</CssParameter>
                  </Fill>
                </Mark>
              <Size>6</Size>
            </Graphic>
          </PointSymbolizer>
           <TextSymbolizer>
            <Label>
              <ogc:PropertyName>TEXTSTRING</ogc:PropertyName>
            </Label>
            <Font>
              <CssParameter name="font-family">宋体</CssParameter>
              <CssParameter name="font-size">18</CssParameter>
              <CssParameter name="font-style">normal</CssParameter>
              <CssParameter name="font-weight">bold</CssParameter>
            </Font>
            <LabelPlacement>
              <PointPlacement>
                 <Rotation>             
                 <ogc:PropertyName>TEXT_ANGLE</ogc:PropertyName>
                 </Rotation>
              </PointPlacement>
            </LabelPlacement>
            <Fill>
              <CssParameter name="fill">#CCCCCC</CssParameter>
            </Fill>
             <VendorOption name="spaceAround">15</VendorOption>
             <VendorOption name="group">yes</VendorOption>   
            <VendorOption name="autoWrap">200</VendorOption>
            <VendorOption name="maxDisplacement">5</VendorOption>
          </TextSymbolizer>
        </Rule>

比如这里的

          <MinScaleDenominator>5000</MinScaleDenominator>
          <MaxScaleDenominator>11000</MaxScaleDenominator>

就代表设置比例尺在5000到11000下的样式。

具体样式的属性说明可自行搜索。

下面附完整样式示例:

​
<?xml version="1.0" encoding="GBK"?>
<StyledLayerDescriptor version="1.0.0"
 xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd"
    xmlns="http://www.opengis.net/sld"
    xmlns:ogc="http://www.opengis.net/ogc"
    xmlns:xlink="XLink namespace"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <!-- a Named Layer is the basic building block of an SLD document -->
    <NamedLayer>
        <Name>default_point</Name>
        <UserStyle>
            <!-- Styles can have names, titles and abstracts -->
            <Title>Default Point</Title>
            <Abstract>A sample style that draws a point</Abstract>
            <!-- FeatureTypeStyles describe how to render different features -->
            <!-- A FeatureTypeStyle for rendering points -->
            <FeatureTypeStyle>
                <Rule>
                    <MinScaleDenominator>11000</MinScaleDenominator>
                    <MaxScaleDenominator>16500</MaxScaleDenominator>
                    <Name>rule1</Name>
                    <Title>Red Square</Title>
                    <Abstract>A 6 pixel square with a red fill and no stroke</Abstract>
                    <PointSymbolizer>
                        <Graphic>
                            <Mark>
                                <WellKnownName>square</WellKnownName>
                                <Fill>
                                    <CssParameter name="fill">#CCCCCC</CssParameter>
                                    <CssParameter   name="fill-opacity">0</CssParameter>
                                </Fill>
                            </Mark>
                            <Size>6</Size>
                        </Graphic>
                    </PointSymbolizer>
                    <TextSymbolizer>
                        <Label>
                            <ogc:PropertyName>TEXTSTRING</ogc:PropertyName>
                        </Label>
                        <Font>
                            <CssParameter name="font-family">宋体</CssParameter>
                            <CssParameter name="font-size">16</CssParameter>
                            <CssParameter name="font-style">normal</CssParameter>
                            <CssParameter name="font-weight">bold</CssParameter>
                        </Font>
                        <LabelPlacement>
                            <PointPlacement>
                                <Rotation>
                                    <ogc:PropertyName>TEXT_ANGLE</ogc:PropertyName>
                                </Rotation>
                            </PointPlacement>
                        </LabelPlacement>
                        <Fill>
                            <CssParameter name="fill">#CCCCCC</CssParameter>
                        </Fill>
                        <VendorOption name="spaceAround">15</VendorOption>
                        <VendorOption name="group">yes</VendorOption>
                        <VendorOption name="autoWrap">200</VendorOption>
                        <VendorOption name="maxDisplacement">5</VendorOption>
                    </TextSymbolizer>
                </Rule>
                <Rule>
                    <MinScaleDenominator>5000</MinScaleDenominator>
                    <MaxScaleDenominator>11000</MaxScaleDenominator>
                    <Name>rule1</Name>
                    <Title>Red Square</Title>
                    <Abstract>A 6 pixel square with a red fill and no stroke</Abstract>
                    <PointSymbolizer>
                        <Graphic>
                            <Mark>
                                <WellKnownName>square</WellKnownName>
                                <Fill>
                                    <CssParameter name="fill">#CCCCCC</CssParameter>
                                    <CssParameter   name="fill-opacity">0</CssParameter>
                                </Fill>
                            </Mark>
                            <Size>6</Size>
                        </Graphic>
                    </PointSymbolizer>
                    <TextSymbolizer>
                        <Label>
                            <ogc:PropertyName>TEXTSTRING</ogc:PropertyName>
                        </Label>
                        <Font>
                            <CssParameter name="font-family">宋体</CssParameter>
                            <CssParameter name="font-size">18</CssParameter>
                            <CssParameter name="font-style">normal</CssParameter>
                            <CssParameter name="font-weight">bold</CssParameter>
                        </Font>
                        <LabelPlacement>
                            <PointPlacement>
                                <Rotation>
                                    <ogc:PropertyName>TEXT_ANGLE</ogc:PropertyName>
                                </Rotation>
                            </PointPlacement>
                        </LabelPlacement>
                        <Fill>
                            <CssParameter name="fill">#CCCCCC</CssParameter>
                        </Fill>
                        <VendorOption name="spaceAround">15</VendorOption>
                        <VendorOption name="group">yes</VendorOption>
                        <VendorOption name="autoWrap">200</VendorOption>
                        <VendorOption name="maxDisplacement">5</VendorOption>
                    </TextSymbolizer>
                </Rule>
                <Rule>
                    <MaxScaleDenominator>5000</MaxScaleDenominator>
                    <Name>rule1</Name>
                    <Title>Red Square</Title>
                    <Abstract>A 6 pixel square with a red fill and no stroke</Abstract>
                    <PointSymbolizer>
                        <Graphic>
                            <Mark>
                                <WellKnownName>square</WellKnownName>
                                <Fill>
                                    <CssParameter name="fill">#CCCCCC</CssParameter>
                                    <CssParameter   name="fill-opacity">0</CssParameter>
                                </Fill>
                            </Mark>
                            <Size>6</Size>
                        </Graphic>
                    </PointSymbolizer>
                    <TextSymbolizer>
                        <Label>
                            <ogc:PropertyName>TEXTSTRING</ogc:PropertyName>
                        </Label>
                        <Font>
                            <CssParameter name="font-family">宋体</CssParameter>
                            <CssParameter name="font-size">22</CssParameter>
                            <CssParameter name="font-style">normal</CssParameter>
                            <CssParameter name="font-weight">bold</CssParameter>
                        </Font>
                        <LabelPlacement>
                            <PointPlacement>
                                <Rotation>
                                    <ogc:PropertyName>TEXT_ANGLE</ogc:PropertyName>
                                </Rotation>
                            </PointPlacement>
                        </LabelPlacement>
                        <Fill>
                            <CssParameter name="fill">#CCCCCC</CssParameter>
                        </Fill>
                        <VendorOption name="spaceAround">15</VendorOption>
                        <VendorOption name="group">yes</VendorOption>
                        <VendorOption name="autoWrap">200</VendorOption>
                        <VendorOption name="maxDisplacement">40</VendorOption>
                    </TextSymbolizer>
                </Rule>
                <Rule>
                    <MinScaleDenominator>16500</MinScaleDenominator>
                    <MaxScaleDenominator>17500</MaxScaleDenominator>
                    <Name>rule1</Name>
                    <Title>Red Square</Title>
                    <Abstract>A 6 pixel square with a red fill and no stroke</Abstract>
                    <PointSymbolizer>
                        <Graphic>
                            <Mark>
                                <WellKnownName>square</WellKnownName>
                                <Fill>
                                    <CssParameter name="fill">#CCCCCC</CssParameter>
                                    <CssParameter   name="fill-opacity">0</CssParameter>
                                </Fill>
                            </Mark>
                            <Size>6</Size>
                        </Graphic>
                    </PointSymbolizer>
                    <TextSymbolizer>
                        <Label>
                            <ogc:PropertyName>TEXTSTRING</ogc:PropertyName>
                        </Label>
                        <Font>
                            <CssParameter name="font-family">宋体</CssParameter>
                            <CssParameter name="font-size">12</CssParameter>
                            <CssParameter name="font-style">normal</CssParameter>
                            <CssParameter name="font-weight">bold</CssParameter>
                        </Font>
                        <LabelPlacement>
                            <PointPlacement>
                                <Rotation>
                                    <ogc:PropertyName>TEXT_ANGLE</ogc:PropertyName>
                                </Rotation>
                            </PointPlacement>
                        </LabelPlacement>
                        <Fill>
                            <CssParameter name="fill">#CCCCCC</CssParameter>
                        </Fill>
                        <VendorOption name="spaceAround">25</VendorOption>
                        <VendorOption name="group">yes</VendorOption>
                        <VendorOption name="autoWrap">200</VendorOption>
                        <VendorOption name="maxDisplacement">5</VendorOption>
                    </TextSymbolizer>
                </Rule>
                <Rule>
                    <MinScaleDenominator>17500</MinScaleDenominator>
                    <MaxScaleDenominator>35000</MaxScaleDenominator>
                    <Name>rule1</Name>
                    <Title>Red Square</Title>
                    <Abstract>A 6 pixel square with a red fill and no stroke</Abstract>
                    <PointSymbolizer>
                        <Graphic>
                            <Mark>
                                <WellKnownName>square</WellKnownName>
                                <Fill>
                                    <CssParameter name="fill">#CCCCCC</CssParameter>
                                    <CssParameter   name="fill-opacity">0</CssParameter>
                                </Fill>
                            </Mark>
                            <Size>6</Size>
                        </Graphic>
                    </PointSymbolizer>
                    <TextSymbolizer>
                        <Label>
                            <ogc:PropertyName>TEXTSTRING</ogc:PropertyName>
                        </Label>
                        <Font>
                            <CssParameter name="font-family">宋体</CssParameter>
                            <CssParameter name="font-size">10</CssParameter>
                            <CssParameter name="font-style">normal</CssParameter>
                            <CssParameter name="font-weight">bold</CssParameter>
                        </Font>
                        <LabelPlacement>
                            <PointPlacement>
                                <Rotation>
                                    <ogc:PropertyName>TEXT_ANGLE</ogc:PropertyName>
                                </Rotation>
                            </PointPlacement>
                        </LabelPlacement>
                        <Fill>
                            <CssParameter name="fill">#CCCCCC</CssParameter>
                        </Fill>
                        <VendorOption name="spaceAround">25</VendorOption>
                        <VendorOption name="group">yes</VendorOption>
                        <VendorOption name="autoWrap">200</VendorOption>
                        <VendorOption name="maxDisplacement">5</VendorOption>
                    </TextSymbolizer>
                </Rule>
                <Rule>
                    <MinScaleDenominator>35000</MinScaleDenominator>
                    <MaxScaleDenominator>135000</MaxScaleDenominator>
                    <Name>rule1</Name>
                    <Title>Red Square</Title>
                    <Abstract>A 6 pixel square with a red fill and no stroke</Abstract>
                    <PointSymbolizer>
                        <Graphic>
                            <Mark>
                                <WellKnownName>square</WellKnownName>
                                <Fill>
                                    <CssParameter name="fill">#CCCCCC</CssParameter>
                                    <CssParameter   name="fill-opacity">0</CssParameter>
                                </Fill>
                            </Mark>
                            <Size>6</Size>
                        </Graphic>
                    </PointSymbolizer>
                    <TextSymbolizer>
                        <Label>
                            <ogc:PropertyName>TEXTSTRING</ogc:PropertyName>
                        </Label>
                        <Font>
                            <CssParameter name="font-family">宋体</CssParameter>
                            <CssParameter name="font-size">8</CssParameter>
                            <CssParameter name="font-style">normal</CssParameter>
                            <CssParameter name="font-weight">bold</CssParameter>
                        </Font>
                        <LabelPlacement>
                            <PointPlacement>
                                <Rotation>
                                    <ogc:PropertyName>TEXT_ANGLE</ogc:PropertyName>
                                </Rotation>
                            </PointPlacement>
                        </LabelPlacement>
                        <Fill>
                            <CssParameter name="fill">#CCCCCC</CssParameter>
                        </Fill>
                        <VendorOption name="spaceAround">25</VendorOption>
                        <VendorOption name="group">yes</VendorOption>
                        <VendorOption name="autoWrap">200</VendorOption>
                        <VendorOption name="maxDisplacement">0</VendorOption>
                    </TextSymbolizer>
                </Rule>
            </FeatureTypeStyle>
        </UserStyle>
    </NamedLayer>
</StyledLayerDescriptor>

​

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/88480.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

智能门驱动光耦合器与集成的反馈控制器

介绍 新的ACPL-302J是一种改进的智能门驱动光耦合器隔离电源和简化门驱动的设计。 ACPL-302J具有一个集成的反控制器为DC-DC转换器和一个完整一套故障安全的IGBT诊断、保护和故障报告&#xff0c;提供一个完整的成本有效的门驱动解决方案&#xff08;图1&#xff09;。带2.5A…

网络工程毕业设计题目100例

文章目录0 简介1 如何选题2 最新网络工程选题2.1 Java web - SSM 系统2.2 大数据方向2.3 人工智能方向2.4 其他方向4 最后0 简介 丹成学长&#xff0c;搜集分享最新的网络工程专业毕设毕设选题&#xff0c;难度适中&#xff0c;适合作为毕业设计&#xff0c;大家参考。 学长整…

Cuda __CUDA_ARCH__宏

__CUDA_ARCH__属于NVCC的宏 5.7.4. Virtual Architecture Macros 给出说明 The architecture identification macro __CUDA_ARCH__ is assigned a three-digit value string xy0 (ending in a literal 0) during each nvcc compilation stage 1 that compiles for compute_xy…

多标签分类怎么做?教你4招

首先简单介绍下&#xff0c;多标签分类与多分类、多任务学习的关系&#xff1a; 多分类学习&#xff08;Multi-class&#xff09;&#xff1a;分类器去划分的类别是多个的&#xff0c;但对于每一个样本只能有一个类别&#xff0c;类别间是互斥的。例如&#xff1a;分类器判断这…

在vue的v-for中,key为什么不能用index?

写在前面 在前端中&#xff0c;主要涉及的基本上就是 DOM的相关操作 和 JS&#xff0c;我们都知道 DOM 操作是比较耗时的&#xff0c;那么在我们写前端相关代码的时候&#xff0c;如何减少不必要的 DOM 操作便成了前端优化的重要内容。 虚拟DOM(virtual DOM) 在 jQuery 时代…

Yolov3目标检测BS交互式框架——火焰识别为例

每个模块都具有可扩展性&#xff0c;可以根据需求自行扩展。本例子仅用火焰识别&#xff0c;可以自行训练新的权重实现检测不同目标。可以进行内网搭建&#xff0c;无需要安装程序 B/S模式 VS B/S模式&#xff1a; /B/SC/S跨平台√&#xff08;要写多种&#xff09;维护成本低…

51单片机点亮LED灯

LED 灯 发光二极管&#xff08;Light Emitting Diode&#xff09;&#xff0c;主要用于照明、广告灯、指引灯、屏幕等场景。 LED 原理图 VCC 表示电源正极&#xff0c;当二极管的正极对应电源的正极&#xff0c;并且二极管的负极对应电源的负极时&#xff0c;二极管就会亮灯。…

反义寡核苷酸/司盘修饰/载米铂与核酸miR-34a/冰片修饰的丹参酮ⅡA阳离子脂质体的合成

小编今天这里分享的内容是反义寡核苷酸/司盘修饰/载米铂与核酸miR-34a/冰片修饰的丹参酮ⅡA阳离子脂质体的合成方法&#xff0c;一起来看&#xff01; 冰片(BO)修饰的丹参酮ⅡA(TA)阳离子脂质体TA-BCLPs方法&#xff1a; 采用乙醇注入法制备阳离子脂质体,通过正交设计,以粒径,…

SpringSecurity[5]-基于表达式的访问控制/基于注解的访问控制/Remember Me功能实现

上一篇:SpringSecurity[4]-访问控制url匹配/内置访问控制方法介绍/角色权限判断 链接:SpringSecurity[4]-访问控制url匹配/内置访问控制方法介绍/角色权限判断_豆虫儿的博客-CSDN博客 十一、基于表达式的访问控制 1.access()方法使用 之前学习的登录用户权限判断实际上底层…

Spring Security进阶学习

Spring Security整体架构 认证 认证核心组件的大体关系如下&#xff1a; Spring Security 中的认证工作主要由 AuthenticationManager 接口来负责&#xff0c;它处理来自框架其他部分的身份验证请求。其中还涉及到一些关键类&#xff0c;比如&#xff1a;AuthenticationProvi…

同城预约小程序上门服务上门理疗推拿按摩系统养生美容行业程序源码

在这个工作生活压力巨大的社会&#xff0c;大家恨不得一分钟掰成两半过&#xff0c;别提什么休闲娱乐了&#xff0c;能睡个饱觉就已经是奢侈了&#xff01;工作固然重要&#xff0c;身心的放松也需要重视&#xff0c;好在随着互联网&#xff0b;的发展&#xff0c;越来越多的行…

PMO在企业项目管理中的五个重要作用

PMO项目管理办公室是成功企业的关键管理工具。它对于推动项目的发展至关重要&#xff0c;以下是PMO的五个重要作用&#xff1a; 1、项目管理过程的标准化 PMO的主要目标在于方法、流程和工具的创建和标准化。 PMO 可能创建的模板包括&#xff1a; • 项目建议书模板。这有…

Java Optional 实用判空实用实战,优雅永不过时

平时我们很多实体类里面会嵌套实体类&#xff0c;实体里面还嵌套实体。 那么我们有时为了取出最里面的实体的某个值的时候&#xff0c;我们就不得不一层层剥开这个 让人流泪的洋葱&#xff0c; 一层层判断。 举例&#xff08;随便举的&#xff09;&#xff1a; 就像这么一个…

关于迭代器遍历及auto关键词

在使用vector容器或者字符串时&#xff0c;很经常会用到一些遍历操作&#xff0c;除了使用下标遍历之外&#xff0c;使用迭代器遍历也是超级方便&#xff0c;但是迭代器也有有一些小坑&#xff0c;一不注意就会编译出错&#xff0c;所以特意总结一下。 迭代器 迭代器很很多接口…

性能测试之nginx监控系统搭建

不同tomcat服务器的负载均衡 在Nginx服务器192.168.43.138上安装Nginx&#xff0c;&#xff08;安装教程在前几篇文章有详细描述 &#xff09;实现反向代理tomcat负载均衡 执行一下命令&#xff0c;关闭防火墙 systemctl disable firewalld.service systemctl stop firewall…

[附源码]Node.js计算机毕业设计防疫科普微课堂Express

项目运行 环境配置&#xff1a; Node.js最新版 Vscode Mysql5.7 HBuilderXNavicat11Vue。 项目技术&#xff1a; Express框架 Node.js Vue 等等组成&#xff0c;B/S模式 Vscode管理前后端分离等等。 环境需要 1.运行环境&#xff1a;最好是Nodejs最新版&#xff0c;我…

从外包被裁到拿到阿里Offer,多亏P8架构师的全套面试文档

引言 又是一年跳槽季&#xff0c;在疫情的影响下&#xff0c;今年的金三银四冷清不少。但无论如何&#xff0c;2020年招聘市场已经显示出了一个清晰的趋势&#xff0c;java开发岗面试越来越难&#xff0c;需求越来越少&#xff01;也更增加了游戏的“难度系数”。 跳槽时时刻刻…

99-数据结构与算法(上篇)

数据结构与算法数据结构和算法&#xff0c;一个非常古老的课题&#xff0c;工作的时候&#xff0c;一般只求程序能跑&#xff0c;并不太关注性能 一般情况下&#xff0c;我们尽量避坑&#xff0c;即避免这样&#xff1a;ArrayList Or LinkedList&#xff0c;哪个简单用哪个 实…

【Kubernetes】一主二从环境搭建,详细的图文描述

kubernetes&#xff0c;是一个全新的基于容器技术的分布式架构领先方案&#xff0c;是谷歌严格保密十几年的秘密武器----Borg系统的一个开源版本&#xff0c;于2014年9月发布第一个版本&#xff0c;2015年7月发布第一个正式版本。 kubernetes的本质是一组服务器集群&#xff0…

使用Java API操作HDFS

提示&#xff1a;文章写完后&#xff0c;目录可以自动生成&#xff0c;如何生成可参考右边的帮助文档 文章目录学习目标&#xff08;一&#xff09;了解HDFS Java API1、HDFS常见类与接口2、FileSystem的常用方法&#xff08;二&#xff09;编写Java程序访问HDFS1、创建Maven项…