[OpenLayers-Users] [Geoserver-users] wfs, state plane, and spherical mercator

Andrea Aime aaime at opengeo.org
Tue Apr 7 03:36:23 EDT 2009


David Hollema ha scritto:
> Here’s my dilemma.  I have a map with projection defined as spherical 
> Mercator, EPSG 900913.  I have a geoserver WMS layer whose native 
> projection is state plane Colorado north (EPSG 2231).  With help from 
> the lists, I’m able to overlay the WMS fine on a Virtual Earth map.  
> When I add a new WFS layer (pointing at the same geoserver data) using 
> similar constructor as the WMS, the WFS layer does not overlay fine, 
> it’s shifted way off.  That’s problem 1.  I can’t figure out how to get 
> the WFS to overlay.

Please share the request you're making. The WFS and WMS reprojection
syntaxes are not equal. Also, what is the SRS handling you chose
in your feature type configuration?

> Next question.  I want to recenter the map based on a feature created 
> from a separate WFS request.   I use OL.Format.GML and the read method 
> to create a new feature from the responseXML.  When I look at the 
> geometry of the point feature, the x,y cords are in the native 
> coordinates.  I tried point.transform(“EPSG:2231”,”EPSG:900913”) but the 
> transformation never works properly.  All the examples I see go from 
> 4326 to 900913.  My data are in State Plane.  I would expect that the 
> underlying transformation library could handle this transformation but 
> maybe not?

You can also have GeoServer do the reprojection for you. You just
have to add &srsName=EPSG:900913 to your request, keeping the eventual
bbox in 2231, or have the bbox in 900913 too, but state it explicitly
with &bbox=x0,y0,x1,y1,EPSG:900913

Cheers
Andrea

-- 
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.



More information about the Users mailing list