geowebcache проблема с отображением слоем

Mapserver, GeoServer, MapGuide, Google и другое ПО для веб-картографии
Ответить
Djinn18
Участник
Сообщения: 76
Зарегистрирован: 29 ноя 2010, 19:35
Репутация: 0

geowebcache проблема с отображением слоем

Сообщение Djinn18 »

не могу настроить кэширование, наверное из-за такой проблемы
400: Requested horizontal resolution: 0.0042968750000000056 , best match: 0.0054931640625 exceeds 10% threshold. Perhaps the client is configured with an incorrect set of scales (resolutions), or the DPI setting is off compared to the one in GWC ?
на демо отображается http://localhost:8080/geowebcache/demo/ ... =image/png

это ссылка на рабочий кусочек который скапирован с демо
а это с вебстранице где должен отображаться этот кусочек
я не могу понять, почему не отображается
Спойлер
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Интеграция геоинформационных ресурсов Госкомимущества</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
<script src="http://localhost/openlayers/OpenLayers.js"></script>
<script src="ol-search.js"></script>
</head>
<body onLoad="init()">
<div id="top"><b>Интеграция геоинформационных ресурсов Госкомимущества на основе геосервисов</b>: используйте мышку для перетаскивания и увеличения/уменьшения изображения
<div id="sc">
<script language="JavaScript">
function pi(str) {
tmp = parent.form1.textk.value;
parent.form1.textk.value = tmp + str;
}
</script>
<!-- end РєРѕРЅС&#8218;енС&#8218;-->
</div>
Щелкните на карту и просмотрите атрибуты слоя
<select name="layerChoice" id="layerChoice" onchange="chooseLayer()"><option value="none" selected="selected">выберите слой...</option><option value="veg_pol_2">Растительность (навигационная карта)</option><option value="hydro_pol_2">Гидрография (навигационная карта)</option><option value="settle_pol">Населенные пункты (навигационная карта)</option><option value="roads_lin">Дороги (навигационная карта)</option><option value="zis_lands">Земельная информационная система</option><option value="lots">Земельные участки (ЕГРНИ)</option></select> в правом окне страницы
</div>

<div id="glavn"><a href="http://localhost/geo/geoportal.html" class="gl">Главная страница</a>
</div>
<br>
<div id="sr">тут будет поиск
<form name='form_sr'>
<input type='text' name='name' size='20' maxlength='16' value=''>

<input type="button" value="Search" onclick="getext()">
</form>
</div>
<div id="content">
<div id="map"></div>

<iframe id="queryresults">
</iframe>

<script type="text/javascript">
function init(){
bounds = new OpenLayers.Bounds(26.4,55.2,27.5,55.9);
var map = new OpenLayers.Map( 'map', {maxExtent: bounds, projection:"EPSG:4326", minScale: 35000, units: "km" } );
borders = new OpenLayers.Layer.WMS("Граница района", "http://localhost:8080/geowebcache/service/wms",
{layers: "borders"}
);
veg_pol_2 = new OpenLayers.Layer.WMS("Растительность (навигационная карта)", "http://localhost:8080/geowebcache/service/wms",
{layers: "wms_veg_pol_2",
transparent: "true", format: "image/png"}
);
hydro_pol_2 = new OpenLayers.Layer.WMS("Гидрография (навигационная карта)", "http://localhost:8080/geowebcache/service/wms",
{layers: "wms_hydro_pol_2",
transparent: "true", format: "image/png"}
);
settle_pol = new OpenLayers.Layer.WMS("Населенные пункты (навигационная карта)", "http://localhost/cgi-bin/mapserv.exe?ma ... sion=1.1.0",
{layers: "wms_settle_pol",
transparent: "true", format: "image/png"}
);
roads_lin = new OpenLayers.Layer.WMS("Дороги (навигационная карта)", "http://localhost:8080/geowebcache/service/wms&",
{layers: "wms_roads_lin",
transparent: "true", format: "image/png"}
);
zis_lands = new OpenLayers.Layer.WMS("Земельная информационная система", "http://localhost:8080/geowebcache/service/wms&",
{layers: "wms_land_br",
transparent: "true", format: "image/png"}
);
lots = new OpenLayers.Layer.WMS("Земельные участки (ЕГРНИ)", "http://localhost/cgi-bin/mapserv.exe?ma ... s_zis1.map&",
{layers: "wms_lots",
transparent: "true", format: "image/png"}
);
map.addLayers([borders, veg_pol_2, settle_pol, hydro_pol_2, roads_lin, zis_lands, lots]);
veg_pol_2.setVisibility(false);
hydro_pol_2.setVisibility(false);
roads_lin.setVisibility(false);
settle_pol.setVisibility(false);
zis_lands.setVisibility(false);
lots.setVisibility(false);
map.addControl(new OpenLayers.Control.LayerSwitcher({'ascending':true}));
var ls = map.getControlsByClass('OpenLayers.Control.LayerSwitcher')[0];
ls.maximizeControl();



/* sel = new OpenLayers.Layer.WMS("Selected", "http://gis-lab.info/cgi-bin/mapserv?",(map:"/usr/local/www/gis-lab/data/programs/mapserver/ol-search/layer.map",
layers: 'selected',sql:"select * from settlements where name='-1'",transparent:"true"},{singleTile:true});

geosample = new OpenLayers.Layer.WMS(
"Selected",
"http://niczem.zapto.org/cgi-bin/mapserv ... raslav.map"
{layers:"veg_pol_2,geosample:roads_lin,settle_pol",transparent:"false"});

map.addLayers([geosample,sel]);
var bounds = new OpenLayers.Bounds.fromString('26.4,55.2,27.5,55.9');
map.zoomToExtent(bounds);


function init_AJAX() {
try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) {} //IE
try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) {} //IE
try { return new XMLHttpRequest(); } catch(e) {} //Native Javascript
alert("XMLHttpRequest not supported");
return null;
};*/

/*function getext() {
var req = init_AJAX();
req.open("GET", "http://niczem.zapto.org/geo/ol-search-g ... ame.value));
req.onreadystatechange = function () {
if (req.readyState==4) {
if (req.status==200) {
var response = req.responseText.split("|");
sel.mergeNewParams({sql:response[0]});
var bounds = new OpenLayers.Bounds.fromString(response[1]);
map.zoomToExtent(bounds);
}
}
};
req.send(null);
}
*/




map.addControl(new OpenLayers.Control.KeyboardDefaults());
map.zoomToMaxExtent();
queryLayer = null;
map.events.register("click", map, queryResults); // map.events.register
} //function init()
function queryResults(evt) {
var cXY = evt.xy;
var cLL = this.getLonLatFromPixel(cXY);
//alert(cXY.x + "," + cXY.y + " = " + cLL.lon + "," + cLL.lat );
if (queryLayer != null) {
var url = queryLayer.getFullRequestString({
REQUEST: "GetFeatureInfo",
EXCEPTIONS: "text/html",
BBOX: queryLayer.map.getExtent().toBBOX(),
X: evt.xy.x,
Y: evt.xy.y,
INFO_FORMAT: "text/plain",
QUERY_LAYERS: queryLayer.params.LAYERS,
WIDTH: queryLayer.map.size.w,
HEIGHT: queryLayer.map.size.h}
);
var resultsDiv = document.getElementById("queryresults");
resultsDiv.src = url;
Event.stop(evt); //prevent 'bubbling up' of event...
} // if not null
} // function(evt)
function chooseLayer() {
queryLayername = document.getElementById("layerChoice").value;
if (queryLayername == "none") {queryLayer = null};
if (queryLayername == "veg_pol_2") {queryLayer = veg_pol_2};
if (queryLayername == "settle_pol") {queryLayer = settle_pol};
if (queryLayername == "hydro_pol_2") {queryLayer = hydro_pol_2};
if (queryLayername == "roads_lin") {queryLayer = roads_lin};
if (queryLayername == "lots") {queryLayer = lots};
if (queryLayername == "zis_lands") {queryLayer = zis_lands};}
</script>
</div>

</body>
</html>
а это geowebcache.xml
Спойлер
<?xml version="1.0" encoding="utf-8"?>
<gwcConfiguration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://geowebcache.org/schema/1.2.2/geowebcache.xsd"
xmlns="http://geowebcache.org/schema/1.2.2">
<version>1.2.2</version>
<backendTimeout>120</backendTimeout>
<gridSets>
<!-- Grid Set Example,
by default EPSG:900913 and EPSG:4326 are defined -->
<gridSet>
<!-- This does not have to be an EPSG code, you can also
have multiple gridSet elements per SRS -->
<name>EPSG:2163</name>
<srs><number>2163</number></srs>
<extent>
<coords>
<double>-2495667.977678598</double>
<double>-2223677.196231552</double>
<double>3291070.6104286816</double>
<double>959189.3312465074</double>
</coords>
</extent>
<scaleDenominators>
<double>25000000</double>
<double>1000000</double>
<double>100000</double>
<double>25000</double>
</scaleDenominators>
<tileHeight>200</tileHeight>
<tileWidth>200</tileWidth>
</gridSet>
</gridSets>

<layers>

<wmsLayer>
<name>topp:states</name>
<gridSubsets>
<gridSubset>
<gridSetName>EPSG:2163</gridSetName>
</gridSubset>
</gridSubsets>
<wmsUrl><string>http://atlas.openplans.org:8080/geoserv ... g></wmsUrl>
</wmsLayer>

<wmsLayer>
<name>raster test layer</name>
<mimeFormats><string>image/jpeg</string></mimeFormats>
<wmsUrl><string>http://atlas.openplans.org:8080/geoserv ... g></wmsUrl>
<wmsLayers>nurc:Img_Sample</wmsLayers>
</wmsLayer>

<wmsLayer>
<name>img states</name>
<metaInformation>
<title>Nicer title for Image States</title>
<description>This is a description. Fascinating.</description>
</metaInformation>
<mimeFormats><string>image/gif</string></mimeFormats>
<!-- Grid Subset Example -->
<gridSubsets>
<gridSubset>
<gridSetName>EPSG:4326</gridSetName>
<extent>
<coords>
<double>-129.6</double>
<double>3.45</double>
<double>-62.1</double>
<double>70.9</double>
</coords>
</extent>
</gridSubset>
</gridSubsets>
<wmsUrl>
<string>http://atlas.openplans.org:8080/geoserver/wms</string>
</wmsUrl>
<wmsLayers>nurc:Img_Sample,topp:states</wmsLayers>
<transparent>false</transparent>
<bgColor>0x0066FF</bgColor>
<expireCacheList>
<expirationRule minZoom="0" expiration="60" />
</expireCacheList>
<expireClientsList>
<expirationRule minZoom="0" expiration="500" />
</expireClientsList>
</wmsLayer>

<wmsLayer>
<name>wms_borders</name>
<mimeFormats>
<string>image/png</string>
<string>image/jpeg</string>
</mimeFormats>
<gridSubsets>
<gridSubset>
<gridSetName>EPSG:4326</gridSetName>
<extent>
<coords>
<double>26.4</double>
<double>55.2</double>
<double>27.5</double>
<double>55.9</double>
</coords>
</extent>
</gridSubset>
</gridSubsets>
<wmsUrl>
<string>http://localhost/cgi-bin/mapserv.exe?ma ... p&</string>
</wmsUrl>
<wmsLayers>borders</wmsLayers>
<!--<transparent>true</transparent>-->
<expireCacheList>
<expirationRule minZoom="0" expiration="60" />
</expireCacheList>
<expireClientsList>
<expirationRule minZoom="0" expiration="500" />
</expireClientsList>
</wmsLayer>

<wmsLayer>
<name>wms_hydro_pol_2</name>
<mimeFormats>
<string>image/png</string>
<string>image/jpeg</string>
</mimeFormats>
<gridSubsets>
<gridSubset>
<gridSetName>EPSG:4326</gridSetName>
<extent>
<coords>
<double>26.4</double>
<double>55.2</double>
<double>27.5</double>
<double>55.9</double>
</coords>
</extent>
</gridSubset>
</gridSubsets>
<wmsUrl>
<string>http://localhost/cgi-bin/mapserv.exe?ma ... p&</string>
</wmsUrl>
<wmsLayers>hydro_pol_2</wmsLayers>
<transparent>true</transparent>
<expireCacheList>
<expirationRule minZoom="0" expiration="60" />
</expireCacheList>
<expireClientsList>
<expirationRule minZoom="0" expiration="500" />
</expireClientsList>
</wmsLayer>
<wmsLayer>
<name>wms_veg_pol_2</name>
<mimeFormats>
<string>image/png</string>
<string>image/jpeg</string>
</mimeFormats>
<gridSubsets>
<gridSubset>
<gridSetName>EPSG:4326</gridSetName>
<extent>
<coords>
<double>26.4</double>
<double>55.2</double>
<double>27.5</double>
<double>55.9</double>
</coords>
</extent>
</gridSubset>
</gridSubsets>
<wmsUrl>
<string>http://localhost/cgi-bin/mapserv.exe?ma ... p&</string>
</wmsUrl>
<wmsLayers>veg_pol_2</wmsLayers>
<transparent>true</transparent>
<expireCacheList>
<expirationRule minZoom="0" expiration="60" />
</expireCacheList>
<expireClientsList>
<expirationRule minZoom="0" expiration="500" />
</expireClientsList>
</wmsLayer>

<wmsLayer>
<name>wms_settle_pol</name>
<mimeFormats>
<string>image/png</string>
<string>image/jpeg</string>
</mimeFormats>
<gridSubsets>
<gridSubset>
<gridSetName>EPSG:4326</gridSetName>
<extent>
<coords>
<double>26.4</double>
<double>55.2</double>
<double>27.5</double>
<double>55.9</double>
</coords>
</extent>
</gridSubset>
</gridSubsets>
<wmsUrl>
<string>http://localhost/cgi-bin/mapserv.exe?ma ... p&</string>
</wmsUrl>
<wmsLayers>settle_pol</wmsLayers>
<transparent>true</transparent>
<expireCacheList>
<expirationRule minZoom="0" expiration="60" />
</expireCacheList>
<expireClientsList>
<expirationRule minZoom="0" expiration="500" />
</expireClientsList>
</wmsLayer>

<wmsLayer>
<name>wms_roads_lin</name>
<mimeFormats>
<string>image/png</string>
<string>image/jpeg</string>
</mimeFormats>
<gridSubsets>
<gridSubset>
<gridSetName>EPSG:4326</gridSetName>
<extent>
<coords>
<double>26.4</double>
<double>55.2</double>
<double>27.5</double>
<double>55.9</double>
</coords>
</extent>
</gridSubset>
</gridSubsets>
<wmsUrl>
<string>http://localhost/cgi-bin/mapserv.exe?ma ... p&</string>
</wmsUrl>
<wmsLayers>roads_lin</wmsLayers>
<transparent>true</transparent>
<expireCacheList>
<expirationRule minZoom="0" expiration="60" />
</expireCacheList>
<expireClientsList>
<expirationRule minZoom="0" expiration="500" />
</expireClientsList>
</wmsLayer>

<wmsLayer>
<name>wms_lots</name>
<mimeFormats>
<string>image/png</string>
<string>image/jpeg</string>
</mimeFormats>
<gridSubsets>
<gridSubset>
<gridSetName>EPSG:4326</gridSetName>
<extent>
<coords>
<double>26.4</double>
<double>55.2</double>
<double>27.5</double>
<double>55.9</double>
</coords>
</extent>
</gridSubset>
</gridSubsets>
<wmsUrl>
<string>http://localhost/cgi-bin/mapserv.exe?ma ... p&</string>
</wmsUrl>
<wmsLayers>lots</wmsLayers>
<transparent>true</transparent>
<expireCacheList>
<expirationRule minZoom="0" expiration="60" />
</expireCacheList>
<expireClientsList>
<expirationRule minZoom="0" expiration="500" />
</expireClientsList>
</wmsLayer>

<wmsLayer>
<name>wms_land_br</name>
<mimeFormats>
<string>image/png</string>
<string>image/jpeg</string>
</mimeFormats>
<gridSubsets>
<gridSubset>
<gridSetName>EPSG:4326</gridSetName>
<extent>
<coords>
<double>26.4</double>
<double>55.2</double>
<double>27.5</double>
<double>55.9</double>
</coords>
</extent>
</gridSubset>
</gridSubsets>
<wmsUrl>
<string>http://localhost/cgi-bin/mapserv.exe?ma ... p&</string>
</wmsUrl>
<wmsLayers>land_br</wmsLayers>
<transparent>true</transparent>
<expireCacheList>
<expirationRule minZoom="0" expiration="60" />
</expireCacheList>
<expireClientsList>
<expirationRule minZoom="0" expiration="500" />
</expireClientsList>
</wmsLayer>

</layers>
</gwcConfiguration>
а это файл настройки кэша
Спойлер
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>

<bean id="gwcAppCtx" class="org.geowebcache.util.ApplicationContextProvider" />

<!-- The location of a static configuration file for GeoWebCache.
By default this lives in WEB-INF/classes/geowebcache.xml -->
<bean id="gwcXmlConfig" class="org.geowebcache.config.XMLConfiguration">
<constructor-arg ref="gwcAppCtx" />
<constructor-arg ref="gwcGridSetBroker"/>
<constructor-arg ref="gwcDefaultStorageFinder" />
<!-- Other examples: -->
<!--property name="relativePath"><value>../resources</value></property -->
<!--property name="relativePath"><value>/WEB-INF/classes</value></property-->
<!--property name="absolutePath"><value>/etc/geowebcache/conf</value></property-->
</bean>

<!-- If you like to automatically configure GWC from a WMS Getcapabilities document,
change the values below. The last constructor-arg lets you specify parameters
that are appended to every WMS request to the backed, for example:
"format_options=regionate_by:auto&bgcolor=0x112233" -->
<bean id="gwcWMSConfig" class="org.geowebcache.config.GetCapabilitiesConfiguration">
<constructor-arg ref="gwcGridSetBroker"/>
<!-- The URL to the WMS GetCapabilities document -->
<constructor-arg value="http://localhost:8080/geowebcache/wms"/>
<!-- The formats to support for all layers read for the above document -->
<constructor-arg value="image/png,image/jpeg"/>
<!-- Metatiling factors, 3x3 is usually a good compromise for vector data -->
<constructor-arg value="3x3"/>
<!-- Vendor parameters, these are appended to every request sent to the backend.
If you use MapServer you probably want to set this to "map=name" -->
<constructor-arg value="map=name"/>
<!-- Whether to allow cached=false to specificed for certain requests -->
<constructor-arg value="false"/>
</bean>

<!-- For each configuration bean above, add them below to activate -->
<bean id="gwcTLDispatcher" class="org.geowebcache.layer.TileLayerDispatcher">
<constructor-arg ref="gwcGridSetBroker"/>
<constructor-arg>
<list>
<ref bean="gwcWMSConfig" />
<ref bean="gwcXmlConfig" />
</list>
</constructor-arg>
</bean>

<bean id="gwcDefaultStorageFinder" class="org.geowebcache.storage.DefaultStorageFinder">
<constructor-arg ref="gwcAppCtx" />
</bean>

<bean id="gwcMetaStore" class="org.geowebcache.storage.metastore.jdbc.JDBCMetaBackend" destroy-method="destroy">
<constructor-arg ref="gwcDefaultStorageFinder" />
</bean>

<!-- Static definition of where to put the metastore.
Note that the directory is AUTOMATICALLY CREATED if it does not exist. -->
<!-- bean id="gwcMetaStore" class="org.geowebcache.storage.metastore.jdbc.JDBCMetaBackend" destroy-method="destroy">
<constructor-arg value="org.h2.Driver" />
<constructor-arg value="jdbc:h2:file:/tmp/gwc_metastore/h2_metastore;TRACE_LEVEL_FILE=0" />
<constructor-arg value="username" />
<constructor-arg value="password" />
</bean -->

<bean id="gwcBlobStore" class="org.geowebcache.storage.blobstore.file.FileBlobStore" destroy-method="destroy">
<constructor-arg ref="gwcDefaultStorageFinder" />
</bean>

<!-- Static definition of where to put the blobstore.
Note that the directory MUST EXIST when GWC is started. -->
<!-- bean id="gwcBlobStore" class="org.geowebcache.storage.blobstore.file.FileBlobStore" destroy-method="destroy">
<constructor-arg value="/tmp/gwc_blobstore" />
</bean -->

<bean id="gwcStorageBroker" class="org.geowebcache.storage.StorageBroker" destroy-method="destroy">
<constructor-arg ref="gwcMetaStore" />
<constructor-arg ref="gwcBlobStore" />
<property name="verifyFileSize" value="TRUE"/>
</bean>


<bean id="gwcGridSetBroker" class="org.geowebcache.grid.GridSetBroker">
<!-- Should we used EPSG:900913 instead of EPSG:3857 ? -->
<constructor-arg type="boolean" value="TRUE" />
<!--
Should the default grids be named EPSG:4326 and EPSG:900913 (TRUE),
or (FALSE) use the new names similar to what WMTS suggests,
GlobalCRS84Geometric and GoogleMapsCompatible ?

If you say FALSE here, you have to manually
rename the directories and entries in the H2 database.
-->
<constructor-arg type="boolean" value="TRUE" />
</bean>

<bean id="gwcRuntimeStats" class="org.geowebcache.stats.RuntimeStats" destroy-method="destroy">
<!-- The poll interval, the number of seconds until counters are aggregated -->
<constructor-arg type="int" value="3" />
<!-- The intervals (in seconds) for which aggregates are reported.
Each interval must be a multiple of the poll interval above and
listed in ascending order. For example, for a maximum interval
of 60 seconds and 3 second poll interval from above, the amount
of memory consumed is (60 / 3) * 8 = 160 bytes
-->
<constructor-arg>
<list>
<value>3</value>
<value>15</value>
<value>60</value>
</list>
</constructor-arg>
<!-- Descriptive texts for each of the intervals above -->
<constructor-arg>
<list>
<value>3 seconds</value>
<value>15 seconds</value>
<value>60 seconds</value>
</list>
</constructor-arg>
</bean>

<!-- controller for handling all incoming requests -->
<bean id="geowebcacheDispatcher" class="org.geowebcache.GeoWebCacheDispatcher" destroy-method="destroy">
<constructor-arg ref="gwcTLDispatcher"/>
<constructor-arg ref="gwcGridSetBroker"/>
<constructor-arg ref="gwcStorageBroker"/>
<constructor-arg ref="gwcXmlConfig"/>
<constructor-arg ref="gwcRuntimeStats"/>
<property name="defaultStorageFinder" ref="gwcDefaultStorageFinder"/>
</bean>

<!-- WMS based services -->
<bean id="gwcServiceWMS"
class="org.geowebcache.service.wms.WMSService">
<constructor-arg ref="gwcStorageBroker"/>
<constructor-arg ref="gwcTLDispatcher"/>
<constructor-arg ref="gwcRuntimeStats"/>
<!-- Set the next line to true to enable full WMS support,
i.e. recombining tiles to serve arbitrary WMS requests -->
<property name="fullWMS"><value>FALSE</value></property>
<!-- Proxy unknown requests -->
<property name="proxyRequests"><value>TRUE</value></property>
</bean>
<bean id="gwcServiceGMaps"
class="org.geowebcache.service.gmaps.GMapsConverter">
<constructor-arg ref="gwcStorageBroker"/>
<constructor-arg ref="gwcTLDispatcher"/>
<constructor-arg ref="gwcGridSetBroker"/>
</bean>
<bean id="gwcServiceMGMaps"
class="org.geowebcache.service.mgmaps.MGMapsConverter">
<constructor-arg ref="gwcStorageBroker"/>
<constructor-arg ref="gwcTLDispatcher"/>
<constructor-arg ref="gwcGridSetBroker"/>
</bean>
<bean id="gwcServiceVE"
class="org.geowebcache.service.ve.VEConverter">
<constructor-arg ref="gwcStorageBroker"/>
<constructor-arg ref="gwcTLDispatcher"/>
<constructor-arg ref="gwcGridSetBroker"/>
</bean>
<bean id="gwcServiceKML"
class="org.geowebcache.service.kml.KMLService">
<constructor-arg ref="gwcStorageBroker"/>
<constructor-arg ref="gwcTLDispatcher"/>
<constructor-arg ref="gwcGridSetBroker"/>
<constructor-arg ref="gwcRuntimeStats"/>
</bean>
<bean id="gwcServiceTMS"
class="org.geowebcache.service.tms.TMSService">
<constructor-arg ref="gwcStorageBroker"/>
<constructor-arg ref="gwcTLDispatcher"/>
<constructor-arg ref="gwcGridSetBroker"/>
<constructor-arg ref="gwcRuntimeStats"/>
<!-- Optionally you can set the base URL for the service -->
<!-- <property name="baseURL" value="http://localhost:8080/geowebcache" /> -->
</bean>
<bean id="gwcServiceWMTS"
class="org.geowebcache.service.wmts.WMTSService">
<constructor-arg ref="gwcStorageBroker"/>
<constructor-arg ref="gwcTLDispatcher"/>
<constructor-arg ref="gwcGridSetBroker"/>
<constructor-arg ref="gwcRuntimeStats"/>
</bean>

<!-- WFS based services -->
<bean id="gwcServiceWFS"
class="org.geowebcache.service.wfs.WFSService">
<constructor-arg ref="gwcStorageBroker"/>
<constructor-arg value="http://localhost:8080/geoserver/wfs" />
<constructor-arg value="" />
<constructor-arg value="600" />
</bean>

<!-- Thread pool for seeding -->
<bean id="gwcSeederThreadPoolExec"
class="org.geowebcache.rest.seed.SeederThreadPoolExecutor">
<constructor-arg value="16"/><!-- Size of core pool -->
<constructor-arg value="32"/><!-- Maximum size of pool -->
</bean>

<!-- GeoRSS feeds poller for georss update sources on layers
Uncomment the bean to enable it

The third argument is the number of seconds to delay before starting up.
Useful if you depend on other servlets running in the same container.
-->
<!--
<bean id="gwcGeoRSSPoller" class="org.geowebcache.georss.GeoRSSPoller" destroy-method="destroy">
<constructor-arg ref="gwcTLDispatcher" />
<constructor-arg ref="gwcSeedRestlet"/>
<constructor-arg value="10" />
</bean>-->

<!-- Restlets -->
<bean id="gwcSeedRestlet" class="org.geowebcache.rest.seed.SeedRestlet">
<property name="tileLayerDispatcher" ref="gwcTLDispatcher"/>
<property name="threadPoolExecutor" ref="gwcSeederThreadPoolExec"/>
<property name="storageBroker" ref="gwcStorageBroker"/>
</bean>

<bean id="gwcSeedFormRestlet" class="org.geowebcache.rest.seed.SeedFormRestlet">
<property name="tileLayerDispatcher" ref="gwcTLDispatcher"/>
<property name="threadPoolExecutor" ref="gwcSeederThreadPoolExec"/>
<property name="storageBroker" ref="gwcStorageBroker"/>
<property name="seedRestlet" ref="gwcSeedRestlet"/>
</bean>
<bean id="gwcReloadRestlet" class="org.geowebcache.rest.reload.ReloadRestlet">
<property name="tileLayerDispatcher" ref="gwcTLDispatcher"/>
</bean>
<bean id="gwcTileLayerRestlet" class="org.geowebcache.rest.layers.TileLayerRestlet">
<property name="XMLConfiguration" ref="gwcXmlConfig"/>
<property name="tileLayerDispatcher" ref="gwcTLDispatcher"/>
</bean>
<bean id="gwcBoundsRestlet" class="org.geowebcache.rest.bounds.BoundsRestlet">
<property name="tileLayerDispatcher" ref="gwcTLDispatcher"/>
</bean>
<bean id="gwcFilterUpdateRestlet" class="org.geowebcache.rest.filter.FilterUpdateRestlet">
<constructor-arg ref="gwcTLDispatcher"/>
</bean>
<bean id="gwcByteStreamerRestlet" class="org.geowebcache.rest.webresources.ByteStreamerRestlet" />

<!-- REST Dispatcher -->
<bean id="gwcRestDispatcher" class="org.geowebcache.rest.RESTDispatcher">
<constructor-arg type="java.util.Map">
<map>
<entry>
<key><value>/seed/{layer}.{extension}</value></key>
<ref bean="gwcSeedRestlet" />
</entry>
<entry>
<key><value>/seed/{layer}</value></key>
<ref bean="gwcSeedFormRestlet" />
</entry>
<entry>
<key><value>/reload</value></key>
<ref bean="gwcReloadRestlet" />
</entry>
<entry>
<key><value>/layers/{layer}.{extension}</value></key>
<ref bean="gwcTileLayerRestlet" />
</entry>
<entry>
<key><value>/bounds/{layer}/{srs}/{type}</value></key>
<ref bean="gwcBoundsRestlet" />
</entry>
<entry>
<key><value>/filter/{filterName}/update/{updateType}</value></key>
<ref bean="gwcFilterUpdateRestlet" />
</entry>
<entry>
<key><value>/web/{filename}</value></key>
<ref bean="gwcByteStreamerRestlet" />
</entry>
</map>
</constructor-arg>
</bean>

<bean id="gwcProxyDispatcher"
class="org.geowebcache.proxy.ProxyDispatcher"/>

<bean id="gwcUrlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="alwaysUseFullPath" value="true"/>
<property name="mappings">
<props>
<prop key="/rest/**">gwcRestDispatcher</prop>
<prop key="/service/**">geowebcacheDispatcher</prop>
<prop key="/demo/**">geowebcacheDispatcher</prop>
<prop key="/proxy/**">gwcProxyDispatcher</prop>
<prop key="/home">geowebcacheDispatcher</prop>
</props>
</property>
</bean>

</beans>
не могу найти ошибку
Аватара пользователя
Mavka
Гуру
Сообщения: 2060
Зарегистрирован: 14 мар 2008, 17:36
Репутация: 9

Re: geowebcache проблема с отображением слоем

Сообщение Mavka »

Кэш создается под конкретное кол-во зумов. У вас и в кэше не совпадают значения масштабов (увеличений).
Про это он и говорит - нестыковка больше 10%. Нужно в параметрах карты (map) заполнить массив resolutions. Поищите готовый в примерах demo. Или сами посчитайте (путанное занятие).

Вот почему все берут GWC? Есть же GeoJazzy - простой, без этой мороки с resolutions. Для новичков самое то.

Если будет время, то завтра ваш код посмотрю внимательнее.
лангольеры под окном жрали время ом-ном-ном
Djinn18
Участник
Сообщения: 76
Зарегистрирован: 29 ноя 2010, 19:35
Репутация: 0

Re: geowebcache проблема с отображением слоем

Сообщение Djinn18 »

спасибо за ответ, буду пытаться исправить

а GWC берут, потому что пример в статьях есть))) правда устаревший уже как я понял
Аватара пользователя
Mavka
Гуру
Сообщения: 2060
Зарегистрирован: 14 мар 2008, 17:36
Репутация: 9

Re: geowebcache проблема с отображением слоем

Сообщение Mavka »

Про GWC статья немного устарела, да и описание там минимальное. GeoJazzy тоже есть в статьях. Он очень простой, продвинутых фич в нем не хватает, но для первого знакомства - рекомендую.
лангольеры под окном жрали время ом-ном-ном
Djinn18
Участник
Сообщения: 76
Зарегистрирован: 29 ноя 2010, 19:35
Репутация: 0

Re: geowebcache проблема с отображением слоем

Сообщение Djinn18 »

отображаются, но как то крива, а при увеличении может не отображать часть клеток
<gridSets>
<gridSet>
<name>EPSG:4326</name>
<srs><number>4326</number></srs>
<extent>
<coords>
<double>-180</double>
<double>-90</double>
<double>180</double>
<double>90</double>
</coords>
</extent>
<!--<scaleDenominators>
<double>560000</double>
<double>280000</double>
<double>140000</double>
<double>70000</double>
<double>35000</double>
</scaleDenominators>
<resolutions>
<double>0.08789</double>
<double>0.04395</double>
<double>0.021975</double>
<double>0.0109875</double>
<double>0.00549316</double>
</resolutions>-->
<tileHeight>256</tileHeight>
<tileWidth>256</tileWidth>
</gridSet>
</gridSets
а в слоях:
<double>26.4</double>
<double>55.2</double>
<double>27.5</double>
<double>55.9</double>

где-то я явно что-то не то прописал

если самому просчитать, как тут resolution = scale / 39.3701 / 72
['m'] = 39.3701
но у меня 'km', это сколько?
и dpi, всегда 72?
а почему в другой теме писалось( /256)
Аватара пользователя
Mavka
Гуру
Сообщения: 2060
Зарегистрирован: 14 мар 2008, 17:36
Репутация: 9

Re: geowebcache проблема с отображением слоем

Сообщение Mavka »

Формула - resolution = scale / OpenLayers.INCHES_PER_UNIT[units] / OpenLayers.DOTS_PER_INCH
Константы:

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

OpenLayers.INCHES_PER_UNIT = { 
'inches': 1.0,
'ft': 12.0,
'mi': 63360.0,
'm': 39.3701,
'km': 39370.1,
'dd': 4374754,
'yd': 36
};

OpenLayers.DOTS_PER_INCH = 72;
лангольеры под окном жрали время ом-ном-ном
Djinn18
Участник
Сообщения: 76
Зарегистрирован: 29 ноя 2010, 19:35
Репутация: 0

Re: geowebcache проблема с отображением слоем

Сообщение Djinn18 »

Я просчитал и подставил
когда начал увеличивать вышло так как на скриншоте

это код рабочего тайла %1

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

http://localhost:8080/geowebcache/service/wms?LAYERS=wms_borders&FORMAT=image/png&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=application/vnd.ogc.se_inimage&SRS=EPSG:4326&BBOX=26.618609518377,55.318149451843,26.708757253769,55.408297187235&WIDTH=256&HEIGHT=256
а это нет, №2

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

http://localhost:8080/geowebcache/service/wms?LAYERS=wms_borders&FORMAT=image/png&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=application/vnd.ogc.se_inimage&SRS=EPSG:4326&BBOX=26.528461782985,55.318149451843,26.618609518377,55.408297187235&WIDTH=256&HEIGHT=256
должен отображаться, но пишет

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

400: Empty metatile, error message: MimeType mismatch, expected image/png but got application/vnd.ogc.se_xml from http://localhost/cgi-bin/mapserv.exe?map=C:/ms4w/apps/wms_navigation.map&?SERVICE=WMS&REQUEST=GetMap&VERSION=1.1.0&LAYERS=borders&EXCEPTIONS=application/vnd.ogc.se_xml&STYLES=&TRANSPARENT=TRUE&FORMAT=image/png&SRS=EPSG:4326&WIDTH=768&HEIGHT=768&BBOX=26.3481663122015,55.228001716451104,26.618609518377383,55.49844492262699 null
Вложения
demo_geowebcache.png
demo_geowebcache.png (61.67 КБ) 13956 просмотров
Аватара пользователя
Mavka
Гуру
Сообщения: 2060
Зарегистрирован: 14 мар 2008, 17:36
Репутация: 9

Re: geowebcache проблема с отображением слоем

Сообщение Mavka »

А эта ссылка что говорит:

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

http://localhost/cgi-bin/mapserv.exe?map=C:/ms4w/apps/wms_navigation.map&?SERVICE=WMS&REQUEST=GetMap&VERSION=1.1.0&LAYERS=borders&EXCEPTIONS=application/vnd.ogc.se_xml&STYLES=&TRANSPARENT=TRUE&FORMAT=image/png&SRS=EPSG:4326&WIDTH=768&HEIGHT=768&BBOX=26.3481663122015,55.228001716451104,26.618609518377383,55.49844492262699
лангольеры под окном жрали время ом-ном-ном
Djinn18
Участник
Сообщения: 76
Зарегистрирован: 29 ноя 2010, 19:35
Репутация: 0

Re: geowebcache проблема с отображением слоем

Сообщение Djinn18 »

по этой ссылке мне выдало это:
<?xml version='1.0' encoding="ISO-8859-1" standalone="no" ?>
<!DOCTYPE ServiceExceptionReport SYSTEM "http://schemas.opengeospatial.net/wms/1 ... _1_1_0.dtd">
<ServiceExceptionReport version="1.1.0">
<ServiceException>
msDrawMap(): Image handling error. Failed to draw layer named 'borders'.
prepare_database(): Query error. Error declaring cursor: ERROR: relation "granica" does not exist
LINE 1: ...lection(force_2d(the_geom)),'NDR'),gid::text from granica WH...
^

With query string: DECLARE mycursor BINARY CURSOR FOR SELECT asbinary(force_collection(force_2d(the_geom)),'NDR'),gid::text from granica WHERE the_geom && setSRID('BOX3D(26.3483423819972 55.2281777862468,26.6184334485817 55.4982688528313)'::BOX3D, 4326 )

</ServiceException>
</ServiceExceptionReport>
Аватара пользователя
Mavka
Гуру
Сообщения: 2060
Зарегистрирован: 14 мар 2008, 17:36
Репутация: 9

Re: geowebcache проблема с отображением слоем

Сообщение Mavka »

Слой 'borders' у вас хорошо работает? Судя по ошибкам это проблемы UMN MapServer, а не GWC.
лангольеры под окном жрали время ом-ном-ном
Djinn18
Участник
Сообщения: 76
Зарегистрирован: 29 ноя 2010, 19:35
Репутация: 0

Re: geowebcache проблема с отображением слоем

Сообщение Djinn18 »

с этим разобрался, все отлично кэширует

но теперь появился такой вопрос
вот мой файл
<?xml version="1.0" encoding="utf-8"?>
<gwcConfiguration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://geowebcache.org/schema/1.2.2/geowebcache.xsd"
xmlns="http://geowebcache.org/schema/1.2.2">
<version>1.2.2</version>
<backendTimeout>120</backendTimeout>
<gridSets>
<gridSet>
<!-- This does not have to be an EPSG code, you can also
have multiple gridSet elements per SRS -->
<name>EPSG:4326</name>
<srs><number>4326</number></srs>
<extent>
<coords>
<double>26.4</double>
<double>55.2</double>
<double>27.5</double>
<double>55.9</double>
</coords>
</extent>
<alignTopLeft>false</alignTopLeft>
<resolutions>
<double>0.703125</double>
<double>0.3515625</double>
<double>0.17578125</double>
<double>0.087890625</double>
<double>0.0439453125</double>
<double>0.02197265625</double>
<double>0.010986328125</double>
<double>0.0054931640625</double>
<double>0.00274658203125</double>
<double>0.001373291015625</double>
<double>6.866455078125E-4</double>
<double>3.4332275390625E-4</double>
<double>1.71661376953125E-4</double>
<double>8.58306884765625E-5</double>
<double>4.291534423828125E-5</double>
<double>2.1457672119140625E-5</double>
<double>1.0728836059570312E-5</double>
<double>5.364418029785156E-6</double>
<double>2.682209014892578E-6</double>
<double>1.341104507446289E-6</double>
<double>6.705522537231445E-7</double>
<double>3.3527612686157227E-7</double>
<double>1.6763806343078613E-7</double>
<double>8.381903171539307E-8</double>
<double>4.190951585769653E-8</double>
<double>2.0954757928848267E-8</double>
<double>1.0477378964424133E-8</double>
<double>5.238689482212067E-9</double>
<double>2.6193447411060333E-9</double>
<double>1.3096723705530167E-9</double>
<double>6.548361852765083E-10</double>
</resolutions>
<tileHeight>256</tileHeight>
<tileWidth>256</tileWidth>

</gridSet>
</gridSets>


<layers>

<wmsLayer>
<name>wms_borders</name>
<gridSubsets>
<gridSubset>
<gridSetName>EPSG:4326</gridSetName>
<extent>
<coords>
<double>26.4</double>
<double>55.2</double>
<double>27.5</double>
<double>55.9</double>
</coords>
</extent>
</gridSubset>
</gridSubsets>
<wmsUrl><string>http://localhost/cgi-bin/mapserv.exe?ma ... g></wmsUrl>
<wmsLayers>borders</wmsLayers>
<transparent>true</transparent>
</wmsLayer>

</layers>
</gwcConfiguration>
как теперь мне добавить в этот файл другие слои с другой системой координат, вот такой epsg:28405 (ведь нужно еще прописать параметры для epsg:28405)?
Аватара пользователя
Mavka
Гуру
Сообщения: 2060
Зарегистрирован: 14 мар 2008, 17:36
Репутация: 9

Re: geowebcache проблема с отображением слоем

Сообщение Mavka »

Написать второй GridSet. Посмотрите в оригинальном файле из дистрибутива, там были сетки и слои на разные СК.
лангольеры под окном жрали время ом-ном-ном
Djinn18
Участник
Сообщения: 76
Зарегистрирован: 29 ноя 2010, 19:35
Репутация: 0

Re: geowebcache проблема с отображением слоем

Сообщение Djinn18 »

Такой СК не было
а после того как добавил второй GridSet выдало ошибку
HTTP ERROR 503

Problem accessing /geowebcache/demo. Reason:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'gwcXmlConfig' defined in ServletContext resource [/WEB-INF/geowebcache-servlet.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.geowebcache.config.XMLConfiguration]: Constructor threw exception; nested exception is com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$DuplicateFieldException: gridSets
---- Debugging information ----
duplicate-field : gridSets
class : org.geowebcache.config.GeoWebCacheConfiguration
required-type : org.geowebcache.config.GeoWebCacheConfiguration
-------------------------------
Аватара пользователя
Mavka
Гуру
Сообщения: 2060
Зарегистрирован: 14 мар 2008, 17:36
Репутация: 9

Re: geowebcache проблема с отображением слоем

Сообщение Mavka »

В оригинале, насколько я помню, были две сетки - на epsg:4326 и 900913.
Судя по логу вы продублировали gridSets, а не gridSet.
лангольеры под окном жрали время ом-ном-ном
Djinn18
Участник
Сообщения: 76
Зарегистрирован: 29 ноя 2010, 19:35
Репутация: 0

Re: geowebcache проблема с отображением слоем

Сообщение Djinn18 »

спасибо
немного неправильно сделал сразу
Ответить

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

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

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