[OpenLayers-Dev] reproject using vector and protocol (WFS) is not working

Tim Schaub tschaub at opengeo.org
Wed Feb 3 12:33:47 EST 2010


Matt Priour wrote:
> Steven,
> I'm also developing mapping apps using WFS provided features from servers
> only supporting odd Swedish national grid projections. If you have the
> internalProjection & externalProjection properties properly defined in the
> format reader, then it will work. However, proj4js doesn't provide all those
> national grid projections by default.
> 

Note that if you are using a vector layer with a protocol, you don't 
specify internalProjection and externalProjection on the format.

Instead, you specify the map.projection and the layer.projection.

The layer.projection is taken to mean the coordinate reference system of 
the source (features on the server).  And the map.projection is the crs 
for rendering the features.

So, if your layer.projection differs from your map.projection, the 
protocol will handle the transform.

And yes, as mentioned, you need proj4js definitions for your 
map.projection and layer.projection in order for the transforms to work 
(assuming they are different from 4326 <-> 900913).

Tim

> Do you have the EPSG:30800 definition in your proj4js defs directory? Or are
> you giving the proj4js definition to the projection object constructor?
> 
> If you don't have the def defined in one of these ways, then the projection
> operation can not properly execute.
> 
> Matt Priour
> Kestrel Computer Consulting


-- 
Tim Schaub
OpenGeo - http://opengeo.org
Expert service straight from the developers.



More information about the Dev mailing list