gvSIG 2.0.0: Adding EPSG:900913 to the Proj4j-based plugin

Some WMS and WMTS servers offer their images in the popular coordinate reference system EPSG:900913 (also known as EPSG:3857, "Spherical Mercator", "The OpenStreetMap/Google Maps coordinate system", etc). The new Proj4j-based plugin for gvSIG 2.0.0 (which is not yet the recommended CRS plugin) supports EPSG:3857 but does not know about the alternative code EPSG:900913. With these steps, we can add EPSG:900913 to the original Proj4j library and therefore will be able to use it naturally within gvSIG 2.0.0. I am assuming you have set up an Eclipse gvSIG development workspace:
  • Download the Proj4j library from its SVN repository and re-build it after adding this line to the epsg list (I have truncated the second line just to show it here):
  • # OSM/Google Maps Spherical Mercator
    <900913> +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0
      +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext  +no_defs <>
    
  • Install the resulting jar file to your local repository:
  • mvn install:install-file -Dfile=[path-to-file] -DgroupId=org.osgeo
      -DartifactId=proj4j -Dversion=0.1.0-SNAPSHOT -Dpackaging=jar
    
  • Add EPSG:900913 to the list of supported CRS in the org.gvsig.proj library (file supportedcrs.properties).

  • Install the org.gvsig.proj library ad the org.gvsig.proj.app plugin again and your new gvSIG 2.0.0 binaries should support EPSG:900913.

We can know set EPSG:900913 as the CRS of a gvSIG view:


From now on, those popular map services can be used in our gvSIG projects and the data from different sources will be reprojected in the natural way. The red lines here are a shapefile reprojected on the fly from EPSG:4258:
In this video (click on image to play), I am adding an OpenStreetMap raster layer to the view, then an Oracle Spatial layer and finally a SHP file (both reprojected from EPSG:4258):

Comments

Post a Comment

Popular posts from this blog

Transformación de CANOA (Venezuela) a WGS84 en gvSIG mediante una rejilla que simula el método Molodensky-Badekas

Computing and applying an affine transformation to a vector layer using gvSIG and Quantum GIS