Software Introduction :
Udig is an open source desktop GIS software that can be used to edit and view shp and raster data map files, especially for the OpenGIS standard, Internet GIS, network map server and network function server. Usually used in conjunction with GeoServer, the Udig configuration of the map file style SLD Most can be fully released in GeoServer.
GeoServer to the SLD introduction: http://docs.geoserver.org/stable/en/user/styling/index.html.
Udig different versions vary greatly. The version used in this article is uDig1.5.
This article mainly describes uidg three aspects of the content: 1, Udig (emphasis), 2, geoserver Add style files, 3, udig error processing.
One: Udig configuration map:
1. Add Map File: open udig after opening file->new->new layer
2. Select data source : Udig supports local data, database data, and data services, for example, if the data is already in the GeoServer service, select Webfeature Server. After entering its WMS service address and selecting the diagram, this example uses the local shapefile file, so select files click Next and select Select Local shapefile file to open. Note: It is recommended to try to change the Shapefile file name to English name and then operate it, although there is no effect in udig, but it will appear in Chinese after making XML, but GeoServer does not support the Chinese file name and file path.
3, Layer preview: the loaded layer is shown here, the right mouse button below the layers need to configure the style of the layer, click on the change style. The anxian_l1-l15 in the diagram is the raster layer I loaded, which you can temporarily ignore.
4, the style editing interface is introduced: in Style editor, the right tree is for display operations. Lines, Points, and polygons are operated according to the layer's specific attribute point line surface. Simple feature is simply set, and filter filters which graphics for the displayed layer. Theme is the layer default theme, and you can modify the settings. XML is automatically generated by the previous modification operation. You can copy and paste the style in GeoServer. Note: However, to change the encoding format to GB2312.
It is strongly recommended that you use the theme theme here, but try not to modify it. It may not be mature, and it is prone to bugs during the modification process. The main error is to parse UTF-8 error, personally think that is because shapefiles use GBK encoding, to udig inside the software is not mature, so it is easy to make mistakes, of course, other operations will also appear such errors, but theme error high probability.
5, line layer Map Example: This article for the line layer here to do a simple example, the middle of the button is to add Display rule group and display rules, delete the display rule and display rule Group, level adjustment, here can be superimposed display rules to achieve the effect we need, the right side is the general setting, the border, Displays text callouts, as well as filter display operations. The line's border is the color of the line.
Two display rules are added here. Note that each display rule is relatively independent. Change the display scale and other settings for each rule appropriately. Adding different rules gives us most of the results we need.
5.1, Border settings : Here The default rule width is set to 1, the color is set to yellow.
Border Select page Other parameters introduced:
Grephics: You can add additional graphics so that the picture is rendered in line path, i.e. a picture appears at each image length. Note: Using an external image path is likely to make the software error-Udig software bug.
Dash: Breakpoint Distance for example: 5.
Dash offset is the breakpoint offset (note if the first setting has no effect.) You need to import an XML with a breakpoint effect SLD file or paste the breakpoint effect on the right XML. Finally, a railroad breakpoint effect is attached).
These parameters can be modified after you click on the application will be able to understand what the meaning, here do not do too much elaboration, and these parameters do not need to make too many changes, keep the default value is good.
5.2, Labeling settings: display text is Chinese must be font in the Set font font is selected as Chinese font, such as the song Body, Chinese new Wei, etc., and the "script (R)" modified to Chinese GB2312.
Label Selection page additional parameters are described:
Max displacement pixels: refers to the distance between the text and ignores the display part of the text information. The larger the value, the lower the display effect. For example 20
Perpengicular offset: Refers to the text display centerline distance line text pixel distance, 0 indicates that the callout is online. The premise is that follow line is false, that is, whether the text follows the thread direction.
Follow line is false: whether the text follows the thread direction.
Auto wrap pixels: The line wraps when the text is longer than the pixel, but the line break is not valid for Chinese. And the maximum number of rows displayed is 2.
These parameters can be modified after you click on the application will be able to understand what the meaning, here do not do too much elaboration. Other parameters do not require too much modification, so it is good to keep the default values.
6. Confirm and apply: click Apply Application. The layer ultimately shows the following effect.
This is the basic method of configuring the line layer, you can modify and enrich the style according to your own needs, there is not much to do here; configuring point and polygon layers will have one more fill property, and the settings are basically similar. Attached here I use the Udig configuration of the An County map and local maps, give everyone a visual effect feeling.
Second, geoserver add style: we only need its XML to publish the GeoServer service, we can copy the XML file into the style file. Note: When you copy an XML file into GeoServer, you modify the "GB2312" encoding method.
The rest of the work is to apply style, publish the service, here no more elaboration.
Third, error handling:
When reporting UTF-8 errors during the mapping process or other issues such as the change style cannot be opened, the general outcome scenario is to create a new project, work in the new project, or delete the folder where project is being restarted and redo. The Project default folder is: C:\Users\Administrator\udig.
Udig map and GeoServer add a style