gvSIG bugs #1649

Problems with a WMTS server

Added by Ignacio Brodín about 11 years ago. Updated about 10 years ago.

Status:Closed% Done:

0%

Priority:NormalSpent time:-
Assignee:Ignacio Brodín
Category:WMTS
Target version:2.0.0-final
Severity: Add-on version:
gvSIG version:2.0.0 Add-on build:
gvSIG build: Add-on resolve version:
Operative System: Add-on resolve build:
Keywords: Proyecto:
Has patch:No Hito:
Add-on name:Unknown

Description

This server cause an exception
http://www.geoportaligm.gob.ec/orto/gwc/service/wmts?REQUEST=GetCapabilities

java.lang.NullPointerException
at org.gvsig.raster.wmts.io.WMTSProvider.getPixelSizeByLevel(WMTSProvider.java:804)
at org.gvsig.raster.wmts.io.downloader.WMTSCacheStruct.<init>(WMTSCacheStruct.java:59)
at org.gvsig.raster.wmts.io.downloader.WMTSTileServer.getStruct(WMTSTileServer.java:63)
at org.gvsig.raster.tilecache.io.TileProvider.getZoomLevels(TileProvider.java:396)
at org.gvsig.raster.tilecache.io.TileProvider.getPixelSizeByLevel(TileProvider.java:421)
at org.gvsig.raster.tilecache.io.TileProvider.getNearestLevel(TileProvider.java:405)
at org.gvsig.raster.impl.store.DefaultRasterStore.getNearestLevel(DefaultRasterStore.java:1429)
at org.gvsig.raster.wmts.app.wmtsclient.layer.FLyrWMTS.draw(FLyrWMTS.java:310)
at org.gvsig.fmap.mapcontext.impl.DefaultMapContextDrawer$DrawList.drawLayer(DefaultMapContextDrawer.java:516)
at org.gvsig.fmap.mapcontext.impl.DefaultMapContextDrawer$DrawList.draw(DefaultMapContextDrawer.java:497)
at org.gvsig.fmap.mapcontext.impl.DefaultMapContextDrawer$DrawList.drawLayers(DefaultMapContextDrawer.java:436)
at org.gvsig.fmap.mapcontext.impl.DefaultMapContextDrawer.draw(DefaultMapContextDrawer.java:114)
at org.gvsig.fmap.mapcontext.MapContext.draw(MapContext.java:1083)
at org.gvsig.fmap.mapcontrol.MapControl$PaintingRequest.paint(MapControl.java:1353)
at org.gvsig.fmap.mapcontrol.MapControl$Drawer$Worker.run(MapControl.java:1573)
at java.lang.Thread.run(Unknown Source)

bug1649.patch Magnifier (2.04 KB) Ignacio Brodín, 03/14/2013 09:23 AM

History

#1 Updated by Ignacio Brodín about 11 years ago

El problema era que en la definición de los tileMatrix los identificadores son EPSG:4326:XX

<TileMatrixSet>
<ows:Identifier>EPSG:4326</ows:Identifier>
<ows:SupportedCRS>urn:ogc:def:crs:EPSG::4326</ows:SupportedCRS>
<TileMatrix>
<ows:Identifier>EPSG:4326:0</ows:Identifier>
<ScaleDenominator>2.795411320143589E8</ScaleDenominator>
<TopLeftCorner>90.0 -180.0</TopLeftCorner>
<TileWidth>256</TileWidth>
<TileHeight>256</TileHeight>
<MatrixWidth>2</MatrixWidth>
<MatrixHeight>1</MatrixHeight>
</TileMatrix>

.................

&lt;TileMatrix&gt;
&lt;ows:Identifier&gt;EPSG:4326:20&lt;/ows:Identifier&gt;
&lt;ScaleDenominator&gt;266.591197981223&lt;/ScaleDenominator&gt;
&lt;TopLeftCorner&gt;90.0 -180.0&lt;/TopLeftCorner&gt;
&lt;TileWidth&gt;256&lt;/TileWidth&gt;
&lt;TileHeight&gt;256&lt;/TileHeight&gt;
&lt;MatrixWidth&gt;2097152&lt;/MatrixWidth&gt;
&lt;MatrixHeight&gt;1048576&lt;/MatrixHeight&gt;
&lt;/TileMatrix&gt;
&lt;TileMatrix&gt;
&lt;ows:Identifier&gt;EPSG:4326:21&lt;/ows:Identifier&gt;
&lt;ScaleDenominator&gt;133.2955989906115&lt;/ScaleDenominator&gt;
&lt;TopLeftCorner&gt;90.0 -180.0&lt;/TopLeftCorner&gt;
&lt;TileWidth&gt;256&lt;/TileWidth&gt;
&lt;TileHeight&gt;256&lt;/TileHeight&gt;
&lt;MatrixWidth&gt;4194304&lt;/MatrixWidth&gt;
&lt;MatrixHeight&gt;2097152&lt;/MatrixHeight&gt;
&lt;/TileMatrix&gt;
&lt;/TileMatrixSet&gt;

En la definición de TileMatrixLimits el último identificador no corresponde con ningún identificador definido sino que pone "null"

<TileMatrixSetLink>
<TileMatrixSet>EPSG:4326</TileMatrixSet>
<TileMatrixSetLimits>
<TileMatrixLimits>
<TileMatrix>EPSG:4326:0</TileMatrix>
<MinTileRow>1</MinTileRow>
<MaxTileRow>1</MaxTileRow>
<MinTileCol>0</MinTileCol>
<MaxTileCol>0</MaxTileCol>
</TileMatrixLimits>

...................

&lt;TileMatrixLimits&gt;
&lt;TileMatrix&gt;EPSG:4326:20&lt;/TileMatrix&gt;
&lt;MinTileRow&gt;535456&lt;/MinTileRow&gt;
&lt;MaxTileRow&gt;537466&lt;/MaxTileRow&gt;
&lt;MinTileCol&gt;580736&lt;/MinTileCol&gt;
&lt;MaxTileCol&gt;582944&lt;/MaxTileCol&gt;
&lt;/TileMatrixLimits&gt;
&lt;TileMatrixLimits&gt;
&lt;TileMatrix&gt;null&lt;/TileMatrix&gt;
&lt;MinTileRow&gt;1070911&lt;/MinTileRow&gt;
&lt;MaxTileRow&gt;1074931&lt;/MaxTileRow&gt;
&lt;MinTileCol&gt;1161472&lt;/MinTileCol&gt;
&lt;MaxTileCol&gt;1165888&lt;/MaxTileCol&gt;
&lt;/TileMatrixLimits&gt;
&lt;/TileMatrixSetLimits&gt;
&lt;/TileMatrixSetLink&gt;

Esto hacia que el último nivel no tuviera ninguna referencia a un TileMatrix y no cargara nada. He hecho más resistente la librería a este tipo de fallos para poder cargar los niveles que si estén definidos. En este caso eliminaría el nivel de resolución al no encontrar la referencia. No se si puede haber una solución más adecuada, si tiene sentido tiene este null o simplemente es un fallo en el capabilities.

Adjunto parche y dejo el bug abierto mientras no pueda "comitarse" en el svn

#2 Updated by Ignacio Brodín about 11 years ago

Ignacio Brodín wrote:

El problema era que en la definición de los tileMatrix los identificadores son EPSG:4326:XX

<TileMatrixSet>
<ows:Identifier>EPSG:4326</ows:Identifier>
<ows:SupportedCRS>urn:ogc:def:crs:EPSG::4326</ows:SupportedCRS>
<TileMatrix>
<ows:Identifier>EPSG:4326:0</ows:Identifier>
<ScaleDenominator>2.795411320143589E8</ScaleDenominator>
<TopLeftCorner>90.0 -180.0</TopLeftCorner>
<TileWidth>256</TileWidth>
<TileHeight>256</TileHeight>
<MatrixWidth>2</MatrixWidth>
<MatrixHeight>1</MatrixHeight>
</TileMatrix>

Más niveles

<TileMatrix>
<ows:Identifier>EPSG:4326:20</ows:Identifier>
<ScaleDenominator>266.591197981223</ScaleDenominator>
<TopLeftCorner>90.0 -180.0</TopLeftCorner>
<TileWidth>256</TileWidth>
<TileHeight>256</TileHeight>
<MatrixWidth>2097152</MatrixWidth>
<MatrixHeight>1048576</MatrixHeight>
</TileMatrix>
<TileMatrix>
<ows:Identifier>EPSG:4326:21</ows:Identifier>
<ScaleDenominator>133.2955989906115</ScaleDenominator>
<TopLeftCorner>90.0 -180.0</TopLeftCorner>
<TileWidth>256</TileWidth>
<TileHeight>256</TileHeight>
<MatrixWidth>4194304</MatrixWidth>
<MatrixHeight>2097152</MatrixHeight>
</TileMatrix>
</TileMatrixSet>

En la definición de TileMatrixLimits el último identificador no corresponde con ningún identificador definido sino que pone "null"

<TileMatrixSetLink>
<TileMatrixSet>EPSG:4326</TileMatrixSet>
<TileMatrixSetLimits>
<TileMatrixLimits>
<TileMatrix>EPSG:4326:0</TileMatrix>
<MinTileRow>1</MinTileRow>
<MaxTileRow>1</MaxTileRow>
<MinTileCol>0</MinTileCol>
<MaxTileCol>0</MaxTileCol>
</TileMatrixLimits>

Más niveles

<TileMatrixLimits>
<TileMatrix>EPSG:4326:20</TileMatrix>
<MinTileRow>535456</MinTileRow>
<MaxTileRow>537466</MaxTileRow>
<MinTileCol>580736</MinTileCol>
<MaxTileCol>582944</MaxTileCol>
</TileMatrixLimits>
<TileMatrixLimits>
<TileMatrix>null</TileMatrix>
<MinTileRow>1070911</MinTileRow>
<MaxTileRow>1074931</MaxTileRow>
<MinTileCol>1161472</MinTileCol>
<MaxTileCol>1165888</MaxTileCol>
</TileMatrixLimits>
</TileMatrixSetLimits>
</TileMatrixSetLink>

Esto hacia que el último nivel no tuviera ninguna referencia a un TileMatrix y no cargara nada. He hecho más resistente la librería a este tipo de fallos para poder cargar los niveles que si estén definidos. En este caso eliminaría el nivel de resolución al no encontrar la referencia. No se si puede haber una solución más adecuada, si tiene sentido tiene este null o simplemente es un fallo en el capabilities.

Adjunto parche y dejo el bug abierto mientras no pueda "comitarse" en el svn

#4 Updated by Ignacio Brodín about 11 years ago

  • Status changed from New to Fixed

#5 Updated by Álvaro Anguix about 10 years ago

  • Status changed from Fixed to Closed

Also available in: Atom PDF