gvSIG feature requests #1371

Support for CRS EPSG:3857, EPSG:3785, EPSG:900913

Added by Alexander Karandeev over 11 years ago. Updated almost 10 years ago.

Status:Closed% Done:

0%

Priority:NormalSpent time:-
Assignee:Joaquín del Cerro Murciano
Category:CRS
Target version:2.1.0-2239-testing
gvSIG version:2.0.0 Add-on resolve version:
Keywords: Add-on resolve build:
Has patch:No Proyecto:
Add-on name:Unknown Hito:
Add-on version:

Description

Support for CRS EPSG:3857, EPSG:3785, EPSG:900913
This CSR is requirement for the many public WMS.


Related issues

Related to Application: gvSIG desktop - gvSIG bugs #466: Soportar proyección EPSG:900913 Closed 03/23/2012
Related to Application: gvSIG desktop - gvSIG feature requests #2306: Update the EPSG database Closed 02/08/2014

History

#1 Updated by Álvaro Anguix over 10 years ago

  • Assignee changed from Alexander Karandeev to Juan Lucas Domínguez

#2 Updated by Álvaro Anguix over 10 years ago

Temporal solution:
gvSIG doesn’t include this projection originally. It’s possible to create it manually if we have the WKT string, but it’s not easy. In this case, the OSM plugin will do it for us. Everytime it’s executed it will check if this EPSG exists in the gvSIG database and if it’s not included it will be created as a user projection. At this way we will be able to change the view to this projection for loading the cartography.

#3 Updated by Álvaro Anguix about 10 years ago

  • Assignee deleted (Juan Lucas Domínguez)

#4 Updated by Antonio Falciano almost 10 years ago

#2306 fixes this feature request only partially: EPSG:3857 and EPSG:3785 are available in the latest version of EPSG Registry, however there's a warning message that says "CRS not supported ======". Instead, EPSG:900913 (that is equivalent to the first two codes) is not an official EPSG code and it can be skipped.

#5 Updated by Antonio Falciano almost 10 years ago

When we try to add a WMTS layer, this error always happens:

java.lang.Exception: The projection'Popular_Visualisation_Pseudo_Mercator' is not a proj4 projection.
     org.gvsig.crs.Proj4.exportToProj4(Proj4.java:3170)
     org.gvsig.crs.Crs.getProj4String(Crs.java:706)
     org.gvsig.crs.Crs.getCrsProj(Crs.java:462)
     org.gvsig.crs.Crs.isProjected(Crs.java:577)
     org.gvsig.raster.wmts.io.WMTSDataParametersImpl.isProjected(WMTSDataParametersImpl.java:265)
     org.gvsig.raster.wmts.io.WMTSProvider.getExtentByResolutionLevel(WMTSProvider.java:532)
     org.gvsig.raster.wmts.io.WMTSProvider.getExtent(WMTSProvider.java:465)
     org.gvsig.raster.wmts.io.WMTSProvider.getAffineTransform(WMTSProvider.java:419)
     org.gvsig.raster.tilecache.io.TileProvider.init(TileProvider.java:326)
     org.gvsig.raster.tilecache.io.TileProvider. (TileProvider.java:262)
    [...]

So the projection 'Popular_Visualisation_Pseudo_Mercator' (used by EPSG:3857) is not recognized as a PROJ.4 projection. Furthermore, 'Popular_Visualisation_Pseudo_Mercator' has not an alias (see EPSG:1024), i.e. there's not an equivalent projection in Proj.4, due to its particular definition (it uses a sphere, but it's also associated to an ellipsoid, WGS84). However, it could be parsed as 'Mercator (1SP)' declaring both semiaxis (see http://www.geotoolkit.org/modules/referencing/faq.html#Google), if possible. For instance, GeoServer uses a specific Mercator1SPGoogle class which extends the Mercator projection (https://github.com/geoserver/geoserver/blob/master/src/main/src/main/java/org/geotools/referencing/operation/projection/Mercator1SPGoogle.java).

#6 Updated by Antonio Falciano almost 10 years ago

See also: http://jira.codehaus.org/browse/GEOT-1511
The approach suggested here consists into allow the definition of minor semiaxis (in place of 1/f which is infinite in this case), just like the "User CRS" wizard is able to do. Then EPSG:3857 is like '"WGS 84 / World Mercator" WKT, except that the "semi_major" and "semi_minor" parameters are explicitly defined.'

#7 Updated by Joaquín del Cerro Murciano almost 10 years ago

Hola Antonio,
He intetado dar de alta la proyeccion 'Popular_Visualisation_Pseudo_Mercator' en la libreria de jcrs.
Se me escapan muchas cosas, pero he creado algo :)
No se como probar si lo que he metido hace algo.
Lo subo al SVN y en el siguiente build de jcrs estara.

gvsig-jcrs:r246

#8 Updated by Antonio Falciano almost 10 years ago

Thank you very much, Joaquín. I think we are very close to the solution. If we will be able to manage correctly this weird projection using the latest EPSG Registry, several new functionalities will unlock their true potential (WMTS and OSM layers above all). ;)

#9 Updated by Álvaro Anguix almost 10 years ago

  • Target version set to 2.1.0-2259-rc3
  • Status changed from New to Fixed

Por lo que comenta Joaquín lo paso a fixed y lo asigno a la RC2 para tenerlo controlado y que no se nos escape testearlo

#10 Updated by Antonio Falciano almost 10 years ago

Hi all,
I think that this ticket it's not completely fixed yet. Assuming that Joaquín has implemented something like a Mercator1SPGoogle class (like GeoTools did in the past), we have to consider that 'Popular_Visualisation_Pseudo_Mercator' is defined as an "Operation Method" by EPSG (see EPSG:1024). Consequentely it needs to be enabled in the CRS panels, otherwise it's not recognized as a supported one and then it cannot be assigned to a view or a layer. More specifically, we should add its code (1024) to the valid_method_code arrays in the CRSMainTrPanelListener and CRSSelectionDialogListener classes of org.gvsig.crs.gui.listeners package and in the EPSGpanel class of org.gvsig.crs.gui.panels package (...if I don't miss other ones :) ):
int[] valid_method_code = { 1024, 9800, 9801, 9802, 9803, 9804, 9805, 9806, 9807, 9809, 9810, 9811, 9812, 9813, 9814, 9815, 9602, 9659, 9818, 9819, 9820, 9821, 9822, 9823, 9827, 9829 };

A simple test could consist in the following steps:
  1. create a view and set its CRS as EPSG:3857 (not the "User CRS" already available, but the EPSG official one introduced by the update of EPSG Registry, see #2306);
  2. if successfully, try to add a WMTS (or a OSM) layer to the view;
  3. finally, if successfully again, add a layer defined in EPSG:4326 and verify if it matches with the WMTS (or OSM) one.

#11 Updated by Álvaro Anguix almost 10 years ago

  • Target version deleted (2.1.0-2259-rc3)
  • Status changed from Fixed to New

#12 Updated by Joaquín del Cerro Murciano almost 10 years ago

  • Target version set to 2.1.0-2259-rc3
  • Assignee set to Joaquín del Cerro Murciano

Upss....
No habia visto el ultimo comentario (10), lo siento.
Vere su puedo meterlo y lo saco esta semana.

#13 Updated by Joaquín del Cerro Murciano almost 10 years ago

  • Target version changed from 2.1.0-2259-rc3 to 2.1.0-2239-testing
  • Status changed from New to Fixed

Aaayyyy
La habia hecho buena.
Me habia dejado por incluir la ultima version del plugin de jcrs en la distribucion 2233.
He metido este cambio y he rehecho la distribucion, asi que entrara en la 2233.

#14 Updated by Álvaro Anguix almost 10 years ago

  • Status changed from Fixed to Closed

#15 Updated by Antonio Falciano almost 10 years ago

This is the actual situation (BN2239) using the EPSG Registry v. 8.5:
  • EPSG:3857 (WGS 84 / Pseudo-Mercator) is well recognized now and can be used with the OSM layers at least.
  • EPSG:3785 (Popular Visualization CRS / Mercator) is not supported yet (but it should be, even if it's a deprecated code). Although it's recommended to use EPSG:3857 in place of it. Furthermore, in epsg-registry.org is not shown anymore.
  • EPSG:900913 (aka Spherical Mercator or Google Projection) is not an official EPSG code, so it can be skipped or defined as "User CRS" starting from EPSG:3857.

Also available in: Atom PDF