Skip to content

GNIP 48 Supports for any spatial reference system in viewers

Paolo Corti edited this page Oct 6, 2016 · 4 revisions

============================================================== GNIP 48 - Supports-for-any-spatial-reference-system-in-viewers

It is desirable that GeoNode should support rendering of datasets using any supported SRS by GeoServer (currently the viewers included in core based on GeoExt and Leaflet supports only 900913 and 4326).

Proposed By

Josh Lieberman, Ben Lewis, Paolo Corti

Assigned to Release

2.6

State

Voting +1 from Paolo Corti

Initial considerations

Current GeoNode version (2.4) supports visualization only for 900913 and 4326 (default is 900913, and is specified by the DEFAULT_MAP_CRS setting), though it can ingest any shapefile or raster with any supported SRS from GeoServer.

I made a test to support a polar projection (EPSG:3408 in this case).

The source code that needs some modifications for having a GeoNode supporting any SRS is here and [here] (https://github.com/GeoNode/geonode/blob/master/geonode/layers/views.py#L232).

  1. is pretty trivial, we need to have a _viewer_projection_lookup key for any SRS we want to support (possibly one for each item in the PROJ.4 database). The list of keys can be easily generated from the PROJ.4 database, or we can find a different and cleaner way to handle that (for example with a query to PROJ.4).

  2. is where the layer is sent to the map configuration: GeoNode stores layer extent with EPSG:4326. In the case or a different projection best thing would be to project the extent using GDAL (that is already part of GeoNode). It is just a couple of lines of code for such an operation.

Obviously the [MAP_BASELAYERS setting] (https://github.com/GeoNode/geonode/blob/master/geonode/settings.py#L642) must be configured properly with base maps exposed in the desired projection.

My observations are for using with the default viewer (GeoExplorer), but similar considerations may apply to the Leaflet viewer.

Clone this wiki locally