udig download, installation and localization, generate geoserver layer style sld file

uDig is an open source and free desktop geographic information system framework software. The Chinese version of uDig is mainly built with RCP technology. It has built-in multi-professional hydrological tools and complex professional analysis capabilities. It can be run as a stand-alone program or as a plug-in.

uDig is an open source (EPL and BSD) desktop application framework, a desktop GIS (Geographic Information System) built on Eclipse RCP and GeoTools (an open source Java GIS toolkit); it is an open source desktop GIS software based on Java And Eclipse platform, can edit and view shp format map files; it is an open source spatial data viewer/editor, which has special enhancements to the OpenGIS standard, Internet GIS, network map server and network function server. uDig provides a general java platform to build spatial applications with open source components.

Table of contents

1. Download, install and localize

1 Download and install

2 Download the Sinicization plug-in of udig2.0

2. uDig generates geoserver layer style


1. Download, install and localize

1 Download and install

(1) Open the browser, enter udig.refractions.net/download/ in the browser address to open the download page, select the download version and download it, as shown in the figure below,

Download link: udig.refractions.net/download/

(2) Find the downloaded file and the folder obtained after decompression. The red circled file is the main program file for the software to open. After double-clicking, you can directly open Udig.

(3) Here I have installed udig locally after decompressing it directly (install it if you download the installation version, and decompress it if you decompress the version),

The installed directory is shown in the figure below.

2 Download the Sinicization plug-in of udig2.0

(1) Open the download link below and download the Sinicization plug-in of udig2.0,

Download address: gitee.com/jjxliu306/udig_zh/blob/master/target/udig2.0_nl_zh.zip,

to decompress,

(2) Unzip the downloaded UDIG2.0 Sinicization plug-in, copy the "plugins" directory in it, and paste it to the /dropins directory under the udig installation directory,

(3) Finally, start UDIG, double-click "udig_internal.exe",

2. uDig generates geoserver layer style

The geoserver layer style can be defined through xml data, but the style xml is complicated to write, and the style can be generated by the uDig tool.

(1) Select the data source: import the shp layer into the software layer, generate the layer, select the layer,

(2) Layer preview: The loaded layer is displayed here. Right-click the layer that needs to be styled under Layers, and click Change Style to enter the interface.

Introduction to the style editing interface:

  • In Style Editor, the directory tree on the right is for display operations.
  • Lines, Points, and Polygons are operated according to the specific properties of the layer.
  • Simple feature is a simple setting,
  • Filter is to filter which graphics of the displayed layer.
  • Theme is the default theme of the layer, and the settings can be modified.
  • Xml is automatically generated by the previous modification operation. You can copy and paste styles in GeoServer. Note: But the encoding format should be changed to GB2312.

This is the basic method of configuring the line layer, and you can modify and enrich the style according to your needs.

For example, use Udig to modify the railway style to black and white, the style xml code is in the XML option, and can also be directly pasted into geoserver for use.

<?xml version="1.0" encoding="UTF-8"?><sld:StyledLayerDescriptor xmlns="http://www.opengis.net/sld" xmlns:sld="http://www.opengis.net/sld" xmlns:gml="http://www.opengis.net/gml" xmlns:ogc="http://www.opengis.net/ogc" version="1.0.0">
    <sld:UserLayer>
        <sld:LayerFeatureConstraints>
            <sld:FeatureTypeConstraint/>
        </sld:LayerFeatureConstraints>
        <sld:UserStyle>
            <sld:Name>gis osm roads trunk free 1</sld:Name>
            <sld:FeatureTypeStyle>
                <sld:Name>group0</sld:Name>
                <sld:FeatureTypeName>Feature</sld:FeatureTypeName>
                <sld:SemanticTypeIdentifier>generic:geometry</sld:SemanticTypeIdentifier>
                <sld:SemanticTypeIdentifier>simple</sld:SemanticTypeIdentifier>
                <sld:Rule>
                    <sld:Name>default rule</sld:Name>
                    <sld:LineSymbolizer>
                    <sld:Stroke>
                        <sld:CssParameter name="stroke">
                            <ogc:Literal>#666666</ogc:Literal>
                            </sld:CssParameter>
                            <sld:CssParameter name="stroke-linecap">
                            <ogc:Literal>butt</ogc:Literal>
                            </sld:CssParameter>
                            <sld:CssParameter name="stroke-linejoin">
                            <ogc:Literal>miter</ogc:Literal>
                            </sld:CssParameter>
                            <sld:CssParameter name="stroke-opacity">
                            <ogc:Literal>1</ogc:Literal>
                            </sld:CssParameter>
                            <sld:CssParameter name="stroke-width">
                            <ogc:Literal>5</ogc:Literal>
                            </sld:CssParameter>
                            <sld:CssParameter name="stroke-dashoffset">
                            <ogc:Literal>0</ogc:Literal>
                        </sld:CssParameter>
                    </sld:Stroke>
                    </sld:LineSymbolizer>
                </sld:Rule>
            </sld:FeatureTypeStyle>
            <sld:FeatureTypeStyle>
                <sld:Name>group0</sld:Name>
                <sld:FeatureTypeName>Feature</sld:FeatureTypeName>
                <sld:SemanticTypeIdentifier>generic:geometry</sld:SemanticTypeIdentifier>
                <sld:SemanticTypeIdentifier>simple</sld:SemanticTypeIdentifier>
                <sld:Rule>
                    <sld:Name>default rule</sld:Name>
                    <sld:LineSymbolizer>
                        <sld:Stroke>
                            <sld:CssParameter name="stroke">
                                <ogc:Literal>#FFFFFF</ogc:Literal>
                                </sld:CssParameter>
                                <sld:CssParameter name="stroke-linecap">
                                <ogc:Literal>butt</ogc:Literal>
                                </sld:CssParameter>
                                <sld:CssParameter name="stroke-linejoin">
                                <ogc:Literal>miter</ogc:Literal>
                                </sld:CssParameter>
                                <sld:CssParameter name="stroke-opacity">
                                <ogc:Literal>1</ogc:Literal>
                                </sld:CssParameter>
                                <sld:CssParameter name="stroke-width">
                                <ogc:Literal>3</ogc:Literal>
                                </sld:CssParameter>
                                <sld:CssParameter name="stroke-dashoffset">
                                <ogc:Literal>0</ogc:Literal>
                            </sld:CssParameter>
                        </sld:Stroke>
                    </sld:LineSymbolizer>
                </sld:Rule>
            </sld:FeatureTypeStyle>
            <sld:FeatureTypeStyle>
                <sld:Name>group0</sld:Name>
                <sld:FeatureTypeName>Feature</sld:FeatureTypeName>
                <sld:SemanticTypeIdentifier>generic:geometry</sld:SemanticTypeIdentifier>
                <sld:SemanticTypeIdentifier>simple</sld:SemanticTypeIdentifier>
                <sld:Rule>
                    <sld:Name>default rule</sld:Name>
                    <sld:LineSymbolizer>
                        <sld:Stroke>
                            <sld:CssParameter name="stroke">
                                <ogc:Literal>#000000</ogc:Literal>
                                </sld:CssParameter>
                                <sld:CssParameter name="stroke-linecap">
                                <ogc:Literal>butt</ogc:Literal>
                                </sld:CssParameter>
                                <sld:CssParameter name="stroke-linejoin">
                                <ogc:Literal>miter</ogc:Literal>
                                </sld:CssParameter>
                                <sld:CssParameter name="stroke-opacity">
                                <ogc:Literal>1</ogc:Literal>
                                </sld:CssParameter>
                                <sld:CssParameter name="stroke-width">
                                <ogc:Literal>3</ogc:Literal>
                                </sld:CssParameter>
                                <sld:CssParameter name="stroke-dashoffset">
                                <ogc:Literal>0</ogc:Literal>
                            </sld:CssParameter>
                            <sld:CssParameter name="stroke-dasharray">15.0 15.0 </sld:CssParameter>
                        </sld:Stroke>
                    </sld:LineSymbolizer>
                </sld:Rule>
            </sld:FeatureTypeStyle>
        </sld:UserStyle>
    </sld:UserLayer>
</sld:StyledLayerDescriptor>

(3) Confirmation and application: Click Apply to apply. The final display effect of this layer is as follows,

Guess you like

Origin blog.csdn.net/qq_45956730/article/details/129924511