3

I have an OpenLayers map setup with several base layer options (some served by my own GeoServer) and many optional layers served by my own GeoServer. I've selected Google's EPSG:900913 as the map's projection. And I've specified specific resolutions to optimize use of the GeoWebCache (see below for explanation). Here are the relevant portions of the map's options when created in OpenLayers:

 options = {
    projection: new OpenLayers.Projection("EPSG:900913"),
    displayProjection: new OpenLayers.Projection("EPSG:4326"),
    numZoomLevels: 12,
    resolutions: [152.8740566, 76.43702829, 38.21851414, 19.10925707, 9.554628536, 4.777314268, 2.388657134, 1.194328567, 0.597164283, 0.29858214, 0.14929107, 0.07564554],
 ...

These resolutions come from looking at the Tile Matrix Set for GridSet EPSG:900913 in GeoServer. These correspond to zoom levels 10 through 22. I did this to optimize the tile requests to match the seeded cached tiles in GeoWebCache.

Turns out that many of my layers, served by my GeoServer, have native projection of EPSG:2234 (NAD83 / Connecticut (ftUS)). I see that I can, if I wish, create a new GridSet for caching tiles in this projection. If I just let it create default Tile Matrix resolutions, they will be different from the resolutions for EPSG:900913 GridSet. At least I believe so - these will be in feet rather than in meters, so I'm comparing apples to oranges anyway. But now I'm thinking this whole step is completely unnecessary...

Can I still simply seed my native EPSG:2234 layers with the EPSG:900913 Tile GridSet, and then expect tiles requested by OpenLayers to the GWC service using srs:'EPSG:900913' will get created and cached properly? Or should I force reprojection at the layer level, so it is both published and cached at the same projections? I don't want to go through this step if it is completely unnecessary...

1 Answer 1

2

Don't force the projection at the layer level as that will confuse GeoServer - it implies your data source has lied about it's projection and you are overriding it.

Everything will work fine the way you have it set up, but for maximum speed you should reproject your base datasets to 900913 (or 3857 in more modern language) as otherwise each time a tile is drawn you will have to reproject the data to draw it.

It's probably not worth it but if you need every last erg of speed then that might be worth considering.

1
  • I have openlayers use srs of 900913 for all requests, and all requests go to the geowebcache (gwc/service/wms...) url. So this reprojects and saves in the cache (or I seed the cache - even better). So now I understand why the map resolutions are for the 900913, because all requests to my geoserver will also be in that projection. Seems to be working pretty well. When I zoom in too close though, GWC gives me some errors - but that is another topic...
    – Brian B
    Commented Apr 22, 2014 at 1:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.