GeoServer не применяет стиль из внешнего SLD

Mapserver, GeoServer, MapGuide, Google и другое ПО для веб-картографии
Ответить
im4LF
Новоприбывший
Сообщения: 6
Зарегистрирован: 19 окт 2011, 01:11
Репутация: 0

GeoServer не применяет стиль из внешнего SLD

Сообщение im4LF »

Доброго времени суток.

Установлен GeoServer - 2.1.2, загружен shp файл, создан store в активном workspace.

Отображение через openlayer

Код: Выделить всё

tiled = new OpenLayers.Layer.WMS(
				"topp:mymap - Tiled", "http://XX.XX.XX.XX:8080/geoserver/topp/wms",
				{
					LAYERS: 'topp:mymap',
					SLD: 'http://XX.XX.XX.XX/sld/polygon_simplepolygon.sld',
					STYLES: '',
					format: 'image/png',
					tiled: true,
					tilesOrigin : map.maxExtent.left + ',' + map.maxExtent.bottom
				}
			);
	
			map.addLayers([tiled]);
Сам SLD:

Код: Выделить всё

<?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_polygon</Name>
    <UserStyle>
    <!-- Styles can have names, titles and abstracts -->
      <Title>Default Polygon</Title>
      <Abstract>A sample style that draws a polygon</Abstract>
      <!-- FeatureTypeStyles describe how to render different features -->
      <!-- A FeatureTypeStyle for rendering polygons -->
      <FeatureTypeStyle>
		 <Rule>
		   <PolygonSymbolizer>
			 <Fill>
			   <CssParameter name="fill">#FF0000</CssParameter>
			 </Fill>
			 <Stroke>
			   <CssParameter name="stroke">#FFFFFF</CssParameter>
			   <CssParameter name="stroke-width">2</CssParameter>
			 </Stroke>
		   </PolygonSymbolizer>
		 </Rule>
	   </FeatureTypeStyle>
    </UserStyle>
  </NamedLayer>
</StyledLayerDescriptor>
В результате отдаются все тайлы со стилизацией по умолчанию выбранной в настройках слоя (закладка Publishing / Default Style).

По логам GeoServer'a видно что происходит подгрузка SLD и его парсинг, но стиль не подключается

Код: Выделить всё

18 Oct 17:59:10 DEBUG [geoserver.ows] - Getting layers and styles from reomte SLD
18 Oct 17:59:10 DEBUG [geoserver.ows] - Getting layers and styles from reomte SLD
18 Oct 17:59:10 DEBUG [geoserver.ows] - Getting layers and styles from reomte SLD
18 Oct 17:59:10 DEBUG [geoserver.ows] - Getting layers and styles from reomte SLD
18 Oct 17:59:10 DEBUG [geoserver.requests] - First 4 bytes of XML doc are : 3C ('<') 3F ('?') 78 ('x') 6D ('m')
18 Oct 17:59:10 DEBUG [geoserver.requests] - First 4 bytes of XML doc are : 3C ('<') 3F ('?') 78 ('x') 6D ('m')
18 Oct 17:59:10 DEBUG [geoserver.requests] - Charset detection phase 1. Inferred encoding: UTF-8
18 Oct 17:59:10 DEBUG [geoserver.requests] - First 4 bytes of XML doc are : 3C ('<') 3F ('?') 78 ('x') 6D ('m')
18 Oct 17:59:10 DEBUG [geoserver.requests] - Charset detection phase 1. Inferred encoding: UTF-8
18 Oct 17:59:10 DEBUG [geoserver.requests] - Charset detection phase 1. Inferred encoding: UTF-8
18 Oct 17:59:10 DEBUG [geoserver.requests] - First 4 bytes of XML doc are : 3C ('<') 3F ('?') 78 ('x') 6D ('m')
18 Oct 17:59:10 DEBUG [geoserver.requests] - Charset detection phase 2. Charset in XML declaration is `UTF-8`.
18 Oct 17:59:10 DEBUG [geoserver.requests] - Charset detection phase 2. Charset in XML declaration is `UTF-8`.
18 Oct 17:59:10 DEBUG [geoserver.requests] - Charset detection phase 1. Inferred encoding: UTF-8
18 Oct 17:59:10 DEBUG [geoserver.requests] - Charset detection phase 2. Charset in XML declaration is `UTF-8`.
18 Oct 17:59:10 DEBUG [geoserver.requests] - Trying to create reader basing on existing charset information: `UTF-8`.
18 Oct 17:59:10 DEBUG [geoserver.requests] - Trying to create reader basing on existing charset information: `UTF-8`.
18 Oct 17:59:10 DEBUG [geoserver.requests] - Trying to create reader basing on existing charset information: `UTF-8`.
18 Oct 17:59:10 DEBUG [geoserver.requests] - Charset detection phase 2. Charset in XML declaration is `UTF-8`.
18 Oct 17:59:10 DEBUG [geoserver.requests] - Trying to create reader basing on existing charset information: `UTF-8`.
18 Oct 17:59:10 DEBUG [geotools.filter] - parsingExpression CssParameter
18 Oct 17:59:10 DEBUG [geotools.filter] - parsingExpression CssParameter
18 Oct 17:59:10 DEBUG [geotools.filter] - processing root CssParameter
18 Oct 17:59:10 DEBUG [geotools.filter] - parsingExpression CssParameter
18 Oct 17:59:10 DEBUG [geotools.filter] - processing root CssParameter
18 Oct 17:59:10 DEBUG [geotools.filter] - parsingExpression CssParameter
18 Oct 17:59:10 DEBUG [geotools.filter] - parsingExpression CssParameter
18 Oct 17:59:10 DEBUG [geotools.filter] - processing root CssParameter
18 Oct 17:59:10 DEBUG [geotools.filter] - processing root CssParameter
18 Oct 17:59:10 DEBUG [geotools.filter] - parsingExpression CssParameter
18 Oct 17:59:10 DEBUG [geotools.filter] - processing root CssParameter
18 Oct 17:59:10 DEBUG [geotools.filter] - parsingExpression CssParameter
18 Oct 17:59:10 DEBUG [geotools.filter] - processing root CssParameter
18 Oct 17:59:10 DEBUG [geotools.filter] - processing root CssParameter
18 Oct 17:59:10 DEBUG [geotools.filter] - parsingExpression CssParameter
18 Oct 17:59:10 DEBUG [geotools.filter] - processing root CssParameter
18 Oct 17:59:10 DEBUG [geotools.filter] - parsingExpression CssParameter
18 Oct 17:59:10 DEBUG [geotools.filter] - processing root CssParameter
18 Oct 17:59:10 DEBUG [geotools.filter] - parsingExpression CssParameter
18 Oct 17:59:10 DEBUG [geotools.filter] - processing root CssParameter
18 Oct 17:59:10 DEBUG [geotools.styling] - number of fts set 1
18 Oct 17:59:10 DEBUG [geotools.styling] - number of fts set 1
18 Oct 17:59:10 DEBUG [geotools.styling] - number of fts set 1
18 Oct 17:59:10 DEBUG [geotools.styling] - number of fts set 1
Подскажите что может перекрывать подключаемый SLD?
Аватара пользователя
Mavka
Гуру
Сообщения: 2060
Зарегистрирован: 14 мар 2008, 17:36
Репутация: 9

Re: GeoServer не применяет стиль из внешнего SLD

Сообщение Mavka »

Серверы WMS и фильтрация данных, раздел 2
Заметьте, что имя слоя в параметре LAYERS и в документе SLD должно совпадать
лангольеры под окном жрали время ом-ном-ном
Ответить

Вернуться в «Веб-картография»

Кто сейчас на конференции

Сейчас этот форум просматривают: нет зарегистрированных пользователей и 8 гостей