[Spanish] Re: WMS Catastro + OpenLayers (Jorge Ar?valo)

Jorge de Jesus jmdj at pml.ac.uk
Mon Jun 13 04:37:30 EDT 2011


 Gracias por el "force Openlayers to use that EPSG code instead",  :-) 
 
Jorge

On 13/06/11 09:33, Ragi Burhum wrote:
>
> Hola a todos,
>
> Aquí les ago un copy/paste del mensaje:
>
> *"*As mkennedy points out, the official EPSG code for
> SphericalMercator (aka Google's projection) is 3857 and a previous
> assigned number was 3785. If you are wondering why there are so many
> numbers that refer to the same spatial reference, crschmidt's blog
> post will give you a clue
> <http://crschmidt.net/blog/archives/243/google-projection-900913/>...
>
> Ian pointed out the relevant OpenLayer's documentation section
> to force OpenLayers to use that EPSG code instead
> <http://docs.openlayers.org/library/spherical_mercator.html#sphericalmercator-and-epsg-aliases>.
>
> Since your GetCapabilities section shows 3785, the code from the OL
> documentation won't work as is, you will need to replace all the 3857
> for 3785."
>
> El servidor de Jorge si soporta la proyección de Google, sólo hay que
> forzar a OL a que use ese código (las instrucciones están en ese link).
>
> Saludos,
>
> - Ragi
>
>
> 2011/6/13 Jorge de Jesus <jmdj at pml.ac.uk <mailto:jmdj at pml.ac.uk>>
>
>     Hola a todos (Jorge y Jorge et al.)
>
>     Ayer estava mirando al libro de OpenLayers2.10, y dicia muy claro:
>
>     "Se tienes un google layer como base, y tienes que anadir un WMS,
>     el WMS tiene que esta en el mismo proyectado de google
>     (EPSG:900913)", (aun que EPSG:3785 sea +-/ el mismo.)
>
>     Tu servidor WMS tiene que suportar el EPSG:900913, y OpenLayers
>     solo va a trabajar con este proyectado.
>
>     Y por el pop up de map data, tienes que anadir el seguinte CSS:
>
>     .olLayerGoogleCopyright {
>                visibility:hidden;
>     }
>
>
>     o entonces algo como top:-10000px;
>
>     Jorge
>
>
>     On 12/06/11 19:03, Ragi Burhum wrote:
>>     Jorge y Jorge :)
>>
>>     Ya puse una respuesta a esta pregunta en GIS.SE
>>     <http://GIS.SE> http://gis.stackexchange.com/questions/10916/openlayers-weird-problem-with-googlemaps-base-layer-and-wms-overlay/10920#10920
>>
>>     Inclusive, uno de los creadores de Openlayers le dió un +1 a la
>>     respuesta, así que pueden estar seguros que es la correcta. :)
>>
>>     Saludos,
>>
>>     - Ragi
>>      
>>
>>         Message: 1
>>         Date: Sun, 12 Jun 2011 16:41:29 +0200
>>         From: Jorge Ar?valo <jorge.arevalo at deimos-space.com
>>         <mailto:jorge.arevalo at deimos-space.com>>
>>         Subject: Re: [Spanish] WMS Catastro + OpenLayers
>>         To: "Cap&amp, amp, amp, #237,   tulo Local de la comunidad
>>                hispano-hablante" <spanish at lists.osgeo.org
>>         <mailto:spanish at lists.osgeo.org>>
>>         Message-ID:
>>         <BANLkTi=2c9hYjsidC3vEPtg19Fm4WvQLtQ at mail.gmail.com
>>         <mailto:2c9hYjsidC3vEPtg19Fm4WvQLtQ at mail.gmail.com>>
>>         Content-Type: text/plain; charset=ISO-8859-1
>>
>>         Buenas,
>>
>>         Muchas gracias crack. La pena es que no me ha funcionado :-(. He
>>         probado también a usar la versión estable de OpenLayers
>>         http://openlayers.org/api/OpenLayers.js, en lugar de la
>>         versión en
>>         desarrollo, y me dice lo mismo.
>>
>>         Otra cosa algo molesta es que siempre me sale un popup con el
>>         copyright de TeleAtlas. Pero bueno, es un problema menor. Si
>>         conseguis
>>         poner el WMS del catastro sobre una capa de GoogleMaps en
>>         OpenLayers,
>>         me haréis un gran favor. Ya digo que con la API de Google Maps
>>         directamente ha sido sencillo.
>>
>>         Muchas gracias en cualquier caso :-)
>>
>>         Jorge
>>
>>         2011/6/12 Jorge Gaspar Sanz Salinas <jsanz at osgeo.org
>>         <mailto:jsanz at osgeo.org>>:
>>         > El 11/06/2011 17:41, Jorge Arévalo escribió:
>>         >> Buenas,
>>         >>
>>         >> Estoy intentando superponer una capa del WMS del catastro
>>         sobre una
>>         >> capa base de GoogleMaps en OpenLayers. Usando la API de
>>         GoogleMaps lo
>>         >> hice sin problemas, aprovechando que el WMS del catastro
>>         ofrece el
>>         >> EPSG:3785, pero al intentarlo en OpenLayers me está
>>         pasando una cosa
>>         >> rara. Me explico:
>>         >>
>>         >> Si la capa la defino así en OpenLayers
>>         >>
>>         >>       var catastro_layer = new OpenLayers.Layer.WMS(
>>         >>               "WMS Catastro",
>>         >>              
>>         "http://ovc.catastro.meh.es/Cartografia/WMS/ServidorWMS.aspx?SERVICE=WMS&VERSION=1.1.1
>>         <http://ovc.catastro.meh.es/Cartografia/WMS/ServidorWMS.aspx?SERVICE=WMS&VERSION=1.1.1>",
>>         >>               {
>>         >>                       layers: "catastro",
>>         >>                       format:"image/png",
>>         >>                       srs: "EPSG:3785",
>>         >>                       transparent: false
>>         >>               }
>>         >>       );
>>         >>
>>         >> Me aparece la capa WMS como una capa más, elegible en
>>         lugar de la de
>>         >> Google, pero NO superponible sobre ella. En esta captura
>>         se ve lo que
>>         >> quiero decir: http://dl.dropbox.com/u/6599273/capa_wms1.png
>>         >>
>>         >> En este caso, la petición WMS se genera correctamente.
>>         Aquí un ejemplo:
>>         >>
>>         >>
>>         http://ovc.catastro.meh.es/Cartografia/WMS/ServidorWMS.aspx?SERVICE=WMS&VERSION=1.1.1&LAYERS=catastro&FORMAT=image%2Fpng&SRS=EPSG%3A3785&TRANSPARENT=false&REQUEST=GetMap&STYLES=&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&BBOX=-1721973.3737,3228700.0733875,-1702405.4944625,3248267.952625&WIDTH=256&HEIGHT=256
>>         <http://ovc.catastro.meh.es/Cartografia/WMS/ServidorWMS.aspx?SERVICE=WMS&VERSION=1.1.1&LAYERS=catastro&FORMAT=image%2Fpng&SRS=EPSG%3A3785&TRANSPARENT=false&REQUEST=GetMap&STYLES=&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&BBOX=-1721973.3737,3228700.0733875,-1702405.4944625,3248267.952625&WIDTH=256&HEIGHT=256>
>>         >>
>>         >> Pero no me vale porque yo quiero la capa WMS encima de la
>>         de Google
>>         >> Maps, no en lugar de ella.
>>         >>
>>         >> En cambio, si defino la capa así (solo he cambiado el
>>         transparent de
>>         >> false a true):
>>         >>
>>         >>       var catastro_layer = new OpenLayers.Layer.WMS(
>>         >>               "WMS Catastro",
>>         >>              
>>         "http://ovc.catastro.meh.es/Cartografia/WMS/ServidorWMS.aspx?SERVICE=WMS&VERSION=1.1.1
>>         <http://ovc.catastro.meh.es/Cartografia/WMS/ServidorWMS.aspx?SERVICE=WMS&VERSION=1.1.1>",
>>         >>               {
>>         >>                       layers: "catastro",
>>         >>                       format:"image/png",
>>         >>                       srs: "EPSG:3785",
>>         >>                       transparent: true
>>         >>               }
>>         >>       );
>>         >>
>>         >> La capa WMS ya aparece como una capa superpuesta sobre la
>>         capa base
>>         >> (como si hubiera especificado "isBaseLayer:false", aunque
>>         no lo he
>>         >> hecho). En la captura se ve:
>>         >> http://dl.dropbox.com/u/6599273/capa_wms2.png
>>         >>
>>         >> Lo que sucede ahora con la petición, es que se hace de manera
>>         >> incorrecta. Me cambia el epsg:3785 por epsg:900913 (a
>>         pesar de que yo
>>         >> lo he especificado el 3785, como se puede ver, y el
>>         servidor lo
>>         >> acepta). Y al cambiarlo, el servidor me devuelve error.
>>         Aquí un
>>         >> ejemplo de las peticiones que genera en este segundo caso,
>>         devolviendo
>>         >> error por el epsg:
>>         >>
>>         >>
>>         http://ovc.catastro.meh.es/Cartografia/WMS/ServidorWMS.aspx?SERVICE=WMS&VERSION=1.1.1&LAYERS=catastro&FORMAT=image%2Fpng&SRS=EPSG%3A900913&TRANSPARENT=true&REQUEST=GetMap&STYLES=&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&BBOX=-1721973.3737,3228700.0733875,-1702405.4944625,3248267.952625&WIDTH=256&HEIGHT=256
>>         <http://ovc.catastro.meh.es/Cartografia/WMS/ServidorWMS.aspx?SERVICE=WMS&VERSION=1.1.1&LAYERS=catastro&FORMAT=image%2Fpng&SRS=EPSG%3A900913&TRANSPARENT=true&REQUEST=GetMap&STYLES=&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&BBOX=-1721973.3737,3228700.0733875,-1702405.4944625,3248267.952625&WIDTH=256&HEIGHT=256>
>>         >>
>>         >> Resumiendo lo que pasa, cuando transparent es 'false', la
>>         capa se
>>         >> interpreta como capa base, y la petición se genera
>>         correctamente. Pero
>>         >> cuando transparent es 'true', la capa se interpreta como
>>         overlay, que
>>         >> es lo que yo quiero, pero la petición se hace de manera
>>         errónea,
>>         >> porque me cambia el epsg.
>>         >>
>>         >> ¿Alguna pista de porqué pasa esto? Estoy usando esta
>>         versión de
>>         >> OpenLayers directamente
>>         http://openlayers.org/api/OpenLayers.js
>>         >>
>>         >> Muchas gracias por adelantado, un saludo
>>         >>
>>         >>
>>         >
>>         > Mira a ver si esto[1] te vale tocayo.Básicamente me he
>>         sacado de la
>>         > manga un parámetro reproject de este ejemplo[3].
>>         >
>>         > Pero cuidadín que ese parámetro esta deprecated[3] y es más
>>         bien un
>>         > hack, debería haber una forma de conseguir instanciar un
>>         mapa en 3785 y
>>         > que catastro funcione, si lo saco te aviso.
>>         >
>>         > [1] http://pastebin.com/gSVFU1id
>>         > [2] http://openlayers.org/dev/examples/google-reproject.html
>>         > [3]
>>         >
>>         http://dev.openlayers.org/releases/OpenLayers-2.6/doc/apidocs/files/OpenLayers/Layer/HTTPRequest-js.html#OpenLayers.Layer.HTTPRequest.reproject
>>         >
>>         > --
>>         > Jorge Gaspar Sanz Salinas
>>         > http://es.osgeo.org
>>         > http://jorgesanz.net
>>
>>
>>     _______________________________________________
>>     Spanish mailing list
>>     http://lists.osgeo.org/mailman/listinfo/spanish
>>     http://es.osgeo.org
>>     http://twitter.com/osgeoes
>
>
>     ------------------------------------------------------------------------
>
>     Plymouth Marine Laboratory
>     Registered Office:
>     Prospect Place
>     The Hoe
>     Plymouth PL1 3DH
>
>     Website: www.pml.ac.uk <http://www.pml.ac.uk>
>     Click here for PML Annual Review 2010
>     <http://www.pml.ac.uk/pdf/PMLAR2010.pdf>
>     Registered Charity No. 1091222
>     PML is a company limited by guarantee
>     registered in England & Wales
>     company number 4178503
>
>     Please think before you print.
>
>     ------------------------------------------------------------------------
>
>     This e-mail, its content and any file attachments are confidential.
>
>     If you have received this e-mail in error please do not copy,
>     disclose it to any third party or use the contents or attachments
>     in any way. Please notify the sender by replying to this e-mail or
>     e-mail forinfo at pml.ac.uk <mailto:forinfo at pml.ac.uk> and then
>     delete the email without making any copies or using it in any
>     other way.
>
>     The content of this message may contain personal views which are
>     not the views of Plymouth Marine Laboratory unless specifically
>     stated.
>
>     You are reminded that e-mail communications are not secure and may
>     contain viruses. Plymouth Marine Laboratory accepts no liability
>     for any loss or damage which may be caused by viruses.
>
>     ------------------------------------------------------------------------
>
>
>


--------------------------------------------------------------------------------
Plymouth Marine Laboratory
 
Registered Office:
Prospect Place 
The Hoe
Plymouth  PL1 3DH
 
Website: www.pml.ac.uk
Click here for PML Annual Review 2010
Registered Charity No. 1091222
PML is a company limited by guarantee
registered in England & Wales
company number 4178503

Please think before you print

--------------------------------------------------------------------------------
This e-mail, its content and any file attachments are confidential.

If you have received this e-mail in error please do not copy, disclose it to any third party or use the contents or attachments in any way. Please notify the sender by replying to this e-mail or e-mail forinfo at pml.ac.uk and then delete the email without making any copies or using it in any other way.

The content of this message may contain personal views which are not the views of Plymouth Marine Laboratory unless specifically stated.

You are reminded that e-mail communications are not secure and may contain viruses. Plymouth Marine Laboratory accepts no liability for any loss or damage which may be caused by viruses.
--------------------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/spanish/attachments/20110613/39663f2f/attachment-0001.html


More information about the Spanish mailing list