2

I have an issue where I have a large amount of data stored in EPSG:27700 (OSGB) that needs to be mapped. I have already developed a mapper to do this using OpenLayers and for a base layer, OpenSpace from the UK Ordinance Survey (http://www.ordnancesurvey.co.uk/oswebsite/web-services/os-openspace/api/index.html). However this baselayer is projected in 27700, so I've not had an issue up until this point as all the projections (from mapserver and the base layer) were the same.

There is now a requirement to zoom further into the layers than the free Ordinance Survey allows (even with a loss of quality). I've found its possible to use OpenLayers to zoom further into layers where they are tile based such as OSM. The issue I am having is trying to get OpenLayers to display OSM data AND my layer in projection EPSG:27700.

Is this even possible?

Thanks.

4

2 回答 2

3

OpenLayers cannot reproject image layers. The reason for this is that OpenLayers uses CSS to overlay your image layer and CSS is not rich enough to fulfill complex geometric operations needed for a spatial transformation.

As a solution you need to reproject your data from EPSG:27700 to your base layer projection (EPSG:900913 if you use OpenStreetMap) in your WMS server. You can do this on the fly with MapServer or GeoServer.

Another solution is to use WFS for your overlay layer: Then OpenLayers can reproject the position of each vector feature in your overlay. Have a look at the WFS reproejction example.

Finally, there is an experimental solution for raster transformation using HTML5 Canvas and a JavaScript version of GDAL:

http://dev.openlayers.org/sandbox/camptocamp/canvas/openlayers/examples/raster-reprojection.html

于 2012-08-24T12:07:07.303 回答
0

OSM data are usually served in EPSG:900913 as tiles so there is no possibility to transform tiles to other projection (you can try but quality will fall down as tines have small resolution). What you can do is download all OSM data and run your own tileservice in EPSG you like.

But first of all, check out all properities of map object in openLayers documentation. You can set zoom levels of map. If you do not, map object by default take zoom levels from first loaded layer and probably it is your problem as UK OS layers probably work with few zoom level.

于 2012-08-24T11:49:58.133 回答