Shape数据GeoServer发布

数据为“全国地理信息资源目录服务系统”下载的shape数据。

一、样式准备

1.1 HYDA_Label

水系(面)

HYDA

湖泊、水库、双线河流等

注:由cite_lakes复制改造。

<?xml version="1.0" encoding="UTF-8"?>

<StyledLayerDescriptor version="1.0.0" xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc"

  xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

  xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd">

  <NamedLayer>

    <Name>Blue lake</Name>

    <UserStyle>

      <Title>Blue lake</Title>

      <Abstract>A blue fill, solid black outline style</Abstract>

      <FeatureTypeStyle>

        <Rule>

          <Name>name</Name>

          <PolygonSymbolizer>

            <Fill>

              <CssParameter name="fill">

                <ogc:Literal>#4040C0</ogc:Literal>

              </CssParameter>

              <CssParameter name="fill-opacity">

                <ogc:Literal>1.0</ogc:Literal>

              </CssParameter>

            </Fill>

            <Stroke>

              <CssParameter name="stroke">

                <ogc:Literal>#000000</ogc:Literal>

              </CssParameter>

              <CssParameter name="stroke-linecap">

                <ogc:Literal>butt</ogc:Literal>

              </CssParameter>

              <CssParameter name="stroke-linejoin">

                <ogc:Literal>miter</ogc:Literal>

              </CssParameter>

              <CssParameter name="stroke-opacity">

                <ogc:Literal>1</ogc:Literal>

              </CssParameter>

              <CssParameter name="stroke-width">

                <ogc:Literal>1</ogc:Literal>

              </CssParameter>

              <CssParameter name="stroke-dashoffset">

                <ogc:Literal>0</ogc:Literal>

              </CssParameter>

            </Stroke>

          </PolygonSymbolizer>

        </Rule>

      </FeatureTypeStyle>

    </UserStyle>

  </NamedLayer>

</StyledLayerDescriptor>

1.2 HYDL_Label

水系(线)

HYDL

线

单线河流、沟渠、河流结构线等

注:由line复制改造。

<?xml version="1.0" encoding="UTF-8"?>

<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="http://www.w3.org/1999/xlink"

 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

  <!-- a Named Layer is the basic building block of an SLD document -->

  <NamedLayer>

    <Name>default_line</Name>

    <UserStyle>

    <!-- Styles can have names, titles and abstracts -->

      <Title>Blue Line</Title>

      <Abstract>A sample style that draws a line</Abstract>

      <!-- FeatureTypeStyles describe how to render different features -->

      <!-- A FeatureTypeStyle for rendering lines -->

      <FeatureTypeStyle>

        <Rule>

          <Name>rule1</Name>

          <Title>Blue Line</Title>

          <Abstract>A solid blue line with a 1 pixel width</Abstract>

          <LineSymbolizer>

            <Stroke>

              <CssParameter name="stroke">#0000FF</CssParameter>

            </Stroke>

          </LineSymbolizer>

        </Rule>

      </FeatureTypeStyle>

    </UserStyle>

  </NamedLayer>

</StyledLayerDescriptor>

1.3 HYDP_Label

水系(点)

HYDP

泉、井等

注:由poi复制改造。

<?xml version="1.0" encoding="UTF-8"?>

<StyledLayerDescriptor version="1.0.0" xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc"

  xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

  xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd">

  <NamedLayer>

    <Name>poi</Name>

    <UserStyle>

      <Name>poi</Name>

      <Title>Points of interest</Title>

      <Abstract>Manhattan points of interest</Abstract>

      <FeatureTypeStyle>

        <Rule>

          <PointSymbolizer>

            <Graphic>

              <Mark>

                <WellKnownName>circle</WellKnownName>

                <Fill>

                  <CssParameter name="fill">#FF0000</CssParameter>

                  <CssParameter name="fill-opacity">1.0</CssParameter>

                </Fill>

              </Mark>

              <Size>11</Size>

            </Graphic>

          </PointSymbolizer>

          <PointSymbolizer>

            <Graphic>

              <Mark>

                <WellKnownName>circle</WellKnownName>

                <Fill>

                  <CssParameter name="fill">#EDE513</CssParameter>

                  <CssParameter name="fill-opacity">1.0</CssParameter>

                </Fill>

              </Mark>

              <Size>7</Size>

            </Graphic>

          </PointSymbolizer>

        </Rule>

        <Rule>

          <MaxScaleDenominator>32000</MaxScaleDenominator>

          <TextSymbolizer>

            <Label>

              <ogc:PropertyName>NAME</ogc:PropertyName>

            </Label>

            <Font>

              <CssParameter name="font-family">Arial</CssParameter>

              <CssParameter name="font-weight">Bold</CssParameter>

              <CssParameter name="font-size">14</CssParameter>

            </Font>

            <LabelPlacement>

              <PointPlacement>

                <AnchorPoint>

                  <AnchorPointX>0.5</AnchorPointX>

                  <AnchorPointY>0.5</AnchorPointY>

                </AnchorPoint>

                <Displacement>

                  <DisplacementX>0</DisplacementX>

                  <DisplacementY>-15</DisplacementY>

                </Displacement>

              </PointPlacement>

            </LabelPlacement>

            <Halo>

              <Radius>

                <ogc:Literal>2</ogc:Literal>

              </Radius>

              <Fill>

                <CssParameter name="fill">#FFFFFF</CssParameter>

              </Fill>

            </Halo>

            <Fill>

              <CssParameter name="fill">#000000</CssParameter>

            </Fill>

          </TextSymbolizer>

        </Rule>

      </FeatureTypeStyle>

    </UserStyle>

  </NamedLayer>

</StyledLayerDescriptor>

1.4 RESA_Label

居民地(面)

RESA

居民地

注:由grass复制改造。

<?xml version="1.0" encoding="UTF-8"?>

<StyledLayerDescriptor version="1.0.0" xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc"

  xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

  xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd">

  <NamedLayer>

    <Name>Grass</Name>

    <UserStyle>

      <Name>grass</Name>

      <Title>Grass fill</Title>

      <Abstract>A style filling polygons with a grass theme coming from a PNG file</Abstract>

      <FeatureTypeStyle>

        <Rule>

          <Name>Grass</Name>

          <Abstract>Grass style that uses a texture</Abstract>

          <PolygonSymbolizer>

            <Fill>

              <GraphicFill>

                <Graphic>

                  <ExternalGraphic>

                    <OnlineResource xlink:type="simple" xlink:href="grass_fill.png" />

                    <Format>image/png</Format>

                  </ExternalGraphic>

                  <Opacity>

                    <ogc:Literal>1.0</ogc:Literal>

                  </Opacity>

                </Graphic>

              </GraphicFill>

            </Fill>

            <Stroke>

              <CssParameter name="stroke">#FF0000</CssParameter>

              <CssParameter name="stroke-width">1</CssParameter>

            </Stroke>

          </PolygonSymbolizer>

        </Rule>

      </FeatureTypeStyle>

    </UserStyle>

  </NamedLayer>

</StyledLayerDescriptor>

1.5 RESP_Label

居民地(点)

RESP

普通房屋、蒙古包、放牧点等

注:由point复制改造。

<?xml version="1.0" encoding="UTF-8"?>

<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="http://www.w3.org/1999/xlink"

 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>Blue Square Point</Title>

      <Abstract>A sample style that draws a red square point</Abstract>

      <!-- FeatureTypeStyles describe how to render different features -->

      <!-- A FeatureTypeStyle for rendering points -->

      <FeatureTypeStyle>

        <Rule>

          <Name>rule1</Name>

          <Title>Red Square Point</Title>

          <Abstract>A 6 pixel square with a red fill and no stroke</Abstract>

            <PointSymbolizer>

              <Graphic>

                <Mark>

                  <WellKnownName>square</WellKnownName>

                  <Fill>

                    <CssParameter name="fill">#005eff</CssParameter>

                  </Fill>

                </Mark>

              <Size>6</Size>

            </Graphic>

          </PointSymbolizer>

        </Rule>

      </FeatureTypeStyle>

    </UserStyle>

  </NamedLayer>

</StyledLayerDescriptor>

1.6 LRDL_Label

公路

LRDL

线

国道、省道、县道、乡道、其它公路、街道、乡村道路等

注:由tiger_roads复制改造。

<?xml version="1.0" encoding="UTF-8"?>

<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="http://www.w3.org/1999/xlink"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<NamedLayer> <Name> area landmarks </Name>

    <UserStyle>

         <FeatureTypeStyle>

            <FeatureTypeName>Feature</FeatureTypeName>

<Rule>  

               <MinScaleDenominator>32000</MinScaleDenominator>

        <LineSymbolizer>

            <Stroke>

     <CssParameter name="stroke">

     <ogc:Literal>#666666</ogc:Literal>

     </CssParameter>

     <CssParameter name="stroke-width">

     <ogc:Literal>2</ogc:Literal>

     </CssParameter>

     </Stroke>

        </LineSymbolizer>

            </Rule>

            <Rule> <!-- thick line drawn first-->

<MaxScaleDenominator>32000</MaxScaleDenominator>

<LineSymbolizer>

<Stroke>

<CssParameter name="stroke">

<ogc:Literal>#666666</ogc:Literal>

</CssParameter>

<CssParameter name="stroke-width">

<ogc:Literal>7</ogc:Literal>

</CssParameter>

</Stroke>

</LineSymbolizer>

            </Rule>

        </FeatureTypeStyle>

        <FeatureTypeStyle>

           <FeatureTypeName>Feature</FeatureTypeName>

           <Rule> <!-- thin line drawn second -->

<MaxScaleDenominator>32000</MaxScaleDenominator>

            <LineSymbolizer>

            <Stroke>

     <CssParameter name="stroke">

     <ogc:Literal>#FFFFFF</ogc:Literal>

     </CssParameter>

     <CssParameter name="stroke-width">

     <ogc:Literal>4</ogc:Literal>

     </CssParameter>

     </Stroke>

</LineSymbolizer>

            </Rule>

            <!-- label -->     

<Rule>

<MaxScaleDenominator>32000</MaxScaleDenominator>

<TextSymbolizer>

<Label>

<ogc:PropertyName>NAME</ogc:PropertyName>

</Label>

<Font>

<CssParameter name="font-family">Times New Roman</CssParameter>

<CssParameter name="font-style">Normal</CssParameter>

<CssParameter name="font-size">14</CssParameter>

<CssParameter name="font-weight">bold</CssParameter>

</Font>

<LabelPlacement>

  <LinePlacement>

  </LinePlacement>

</LabelPlacement>

<Halo>

<Radius>

<ogc:Literal>2</ogc:Literal>

</Radius>

<Fill>

<CssParameter name="fill">#FFFFFF</CssParameter>

<CssParameter name="fill-opacity">0.85</CssParameter>

</Fill>

</Halo>

<Fill>

<CssParameter name="fill">#000000</CssParameter>

</Fill>

<VendorOption name="group">true</VendorOption>

</TextSymbolizer>

</Rule>

        </FeatureTypeStyle>

        

    </UserStyle>

    </NamedLayer>

</StyledLayerDescriptor>

1.7 LRRL_Label

铁路

LRRL

线

标准轨铁路、窄轨铁路等

注:由simple_roads复制改造。

<?xml version="1.0" encoding="UTF-8"?>

<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="http://www.w3.org/1999/xlink"

  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

  <NamedLayer>

    <Name>Simple Roads</Name>

    <UserStyle>

      <Title>Red Line</Title>

      <Abstract>Light red line, 2px wide</Abstract>

      <FeatureTypeStyle>

        <Rule>

          <Title>Roads</Title>

          <LineSymbolizer>

            <Stroke>

              <CssParameter name="stroke">

                <ogc:Literal>#AA3333</ogc:Literal>

              </CssParameter>

              <CssParameter name="stroke-width">

                <ogc:Literal>2</ogc:Literal>

              </CssParameter>

            </Stroke>

          </LineSymbolizer>

        </Rule>

      </FeatureTypeStyle>

    </UserStyle>

  </NamedLayer>

</StyledLayerDescriptor>

1.8 AANP_Label

自然地名(点)

AANP

交通要素名、纪念地和古迹名、山名、水系名、海洋地域名、自然地域名等

注:由capitals复制改造。

1.9 AGNP_Label

居民地地名(点)

AGNP

各级行政地名和城乡居民地名称等

注:由point复制改造。

二、发布流程

 2.1 存储仓库

  2.1.1 目录shape文件存储仓库

  2.1.2 单shape文件存储仓库

***注意:字符集设置为GBK,否则前端展示时中文乱码。

2.2 图层发布

2.2.1 数据页卡

2.2.2 发布页卡

2.3 图层预览

成果数据组织

目前提供下载的1:25万公开版基础地理数据共有4个数据集9个数据层。

数据分层的命名采用四个字符,第一个字符代表数据分类,第二三个字符是数据内容的缩写,第四个字符代表几何类型。

要素分类

数据分层

几何类型

主要要素内容

样式

水系(H)

水系(面)

HYDA

湖泊、水库、双线河流等

HYDA_Label

复制自cite_lakes

水系(线)

HYDL

线

单线河流、沟渠、河流结构线等

HYDL_Label

复制自line

水系(点)

HYDP

泉、井等

HYDP_Label

复制自poi

居民地及设施(R)

居民地(面)

RESA

居民地

HYDA_Label

复制自

居民地(点)

RESP

普通房屋、蒙古包、放牧点等

HYDA_Label

复制自

交通(L)

铁路

LRRL

线

标准轨铁路、窄轨铁路等

LRRL_Label

复制自simple_roads

公路

LRDL

线

国道、省道、县道、乡道、其它公路、街道、乡村道路等

LRDL_Label

复制自tiger_roads

地名及注记(A)

居民地地名(点)

AGNP

各级行政地名和城乡居民地名称等

HYDA_Label

复制自point

自然地名(点)

AANP

交通要素名、纪念地和古迹名、山名、水系名、海洋地域名、自然地域名等

AANP_Label

复制自capitals

  • 8
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
您可以使用以下命令发布shape文件并使用GeoServer中的样式: ``` curl -v -u username:password -XPOST -H "Content-type: text/xml" -d "<featureType><name>your_layer_name</name></featureType>" http://your_geoserver_url/rest/workspaces/your_workspace/datastores/your_datastore/featuretypes curl -v -u username:password -XPUT -H "Content-type: application/zip" --data-binary @/path/to/your_shape.zip http://your_geoserver_url/rest/workspaces/your_workspace/datastores/your_datastore/file.shp curl -v -u username:password -XPUT -H "Content-type: application/zip" --data-binary @/path/to/your_shape.zip http://your_geoserver_url/rest/workspaces/your_workspace/datastores/your_datastore/file.shx curl -v -u username:password -XPUT -H "Content-type: application/zip" --data-binary @/path/to/your_shape.zip http://your_geoserver_url/rest/workspaces/your_workspace/datastores/your_datastore/file.dbf curl -v -u username:password -XPUT -H "Content-type: application/zip" --data-binary @/path/to/your_shape.zip http://your_geoserver_url/rest/workspaces/your_workspace/datastores/your_datastore/file.prj curl -v -u username:password -XPUT -H "Content-type: text/xml" -d "<layer><defaultStyle><name>your_style_name</name></defaultStyle></layer>" http://your_geoserver_url/rest/layers/your_layer_name ``` 请替换其中的`username`、`password`、`your_layer_name`、`your_workspace`、`your_datastore`和`/path/to/your_shape.zip`为您自己的信息。其中,`/path/to/your_shape.zip`为您的shape文件路径,`your_style_name`为您在GeoServer中创建的样式名称。这样可以确保您的发布的图层使用了所需的样式。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值