<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=EN-US link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>I tried #1 below and it works sometimes. The key was setting
the srsName. That was the whole trick. Are those options like ‘typeName’, ‘srsName’,
etc. case sensitive?<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Trouble is, my WFS layer only shows at small scales but not when
zoomed in…what other things can I check. Is that a server side issue?<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>David A. Hollema<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>GIS Analyst<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> <o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:#1F497D'>United Power, Inc.</span><span style='color:#1F497D'><o:p></o:p></span></p>
<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>
<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Jimmy Aumard
[mailto:jimmy.aumard@gmail.com] <br>
<b>Sent:</b> Thursday, April 09, 2009 1:06 AM<br>
<b>To:</b> David Hollema<br>
<b>Cc:</b> Andrea Aime; users@openlayers.org;
geoserver-users@lists.sourceforge.net<br>
<b>Subject:</b> Re: [Geoserver-users] [OpenLayers-Users] wfs, state plane, and
spherical mercator<o:p></o:p></span></p>
</div>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal style='margin-bottom:12.0pt'>Hi david!<br>
<br>
for wfs I make this:<br>
<br>
var France = new OpenLayers.Layer.WFS(<br>
"France WFS","<a
href="http://localhost:8080/geoserver/wfs">http://localhost:8080/geoserver/wfs</a>",<br>
{<br>
typeName: 'dep',<br>
featureNS: '<a href="http://www.openplans.org/topp">http://www.openplans.org/topp</a>',
<br>
//style:fStyle,<br>
extractAttributes: true ,<br>
srsName: "EPSG:900913"<br>
},<br>
{'reproject': true}<br>
);<br>
<br>
or<br>
<br>
var wfs = new OpenLayers.Layer.Vector(<br>
"France2 wfs",<br>
{<br>
strategies: [new OpenLayers.Strategy.BBOX(), saveStrategy],<br>
projection:
new OpenLayers.Projection("EPSG:900913"),<br>
protocol:
new OpenLayers.Protocol.WFS({<br>
srsName: "EPSG:900913",<br>
url: "<a href="http://localhost:8080/geoserver/wfs">http://localhost:8080/geoserver/wfs</a>",<br>
featureType: "dep",<br>
version:'1.1.0',<br>
featureNS: "<a href="http://www.openplans.org/topp">http://www.openplans.org/topp</a>",<br>
})<br>
}<br>
);<br>
<br>
try and tell me if it's works.<br>
<br>
Jim<o:p></o:p></p>
<div>
<p class=MsoNormal>2009/4/8 David Hollema <<a
href="mailto:dhollema@unitedpower.com">dhollema@unitedpower.com</a>><o:p></o:p></p>
<p class=MsoNormal>Here is my code. WMS reprojects fine b/c my
understanding is geoserver<br>
receives the base map projection (900913) and reprojects accordingly. I<br>
would figure that geoserver would do the same thing to the WFS but it<br>
doesn't. My SRS handling in geoserver is set to force declared (default<br>
setting) and my declared is correct, 2231 in this case. For WMS, it's<br>
not even necessary to set the srs in the layer constructor b/c geoserver<br>
just figures it out.<br>
<br>
It's important to note that I even tried with my source data in 4326<br>
(lat/long) and WMS still worked fine but WFS fails. It doesn't seem to<br>
be due to State Plane issues but it's more fundamental than that.<br>
<br>
var bounds = new OpenLayers.Bounds<br>
(-20037508.34, -20037508.34, 20037508.34, 20037508.34);<br>
var options2 = {<br>
units:
'm',<br>
projection:
'EPSG:900913',<br>
maxExtent: bounds<br>
};<br>
format = 'image/gif';<br>
<br>
map2 = new OpenLayers.Map('map2',<br>
options2);<br>
<br>
velayer = new<br>
OpenLayers.Layer.VirtualEarth( "VE",<br>
{ 'type': VEMapStyle.Roads,<br>
'sphericalMercator': true});<br>
<br>
layerWMS = new OpenLayers.Layer.WMS(<br>
"Joint Use Photos",<br>
"<a
href="http://upigis:8080/geoserver/wms" target="_blank">http://upigis:8080/geoserver/wms</a>",<br>
{layers:
'sde:jointusepicture',<br>
format: format,<br>
transparent: true<br>
},<br>
{opacity: 1.0,<br>
isBaseLayer: false, 'singleTile': true<br>
});<br>
<br>
layerWFS = new OpenLayers.Layer.WFS(<br>
"Joint Use Photos WFS",<br>
"<a
href="http://upigis:8080/geoserver/wfs" target="_blank">http://upigis:8080/geoserver/wfs</a>",<br>
{<br>
typename:<br>
"sde:jointusepicture"},<br>
{extractAttributes: true}<br>
);<o:p></o:p></p>
<div>
<p class=MsoNormal style='margin-bottom:12.0pt'><br>
David A. Hollema<br>
GIS Analyst<br>
<br>
United Power, Inc.<o:p></o:p></p>
</div>
<div>
<div>
<p class=MsoNormal>-----Original Message-----<br>
From: <a href="mailto:users-bounces@openlayers.org">users-bounces@openlayers.org</a>
[mailto:<a href="mailto:users-bounces@openlayers.org">users-bounces@openlayers.org</a>]<br>
On Behalf Of Andrea Aime<br>
Sent: Tuesday, April 07, 2009 1:36 AM<br>
To: David Hollema<br>
Cc: <a href="mailto:users@openlayers.org">users@openlayers.org</a>; <a
href="mailto:geoserver-users@lists.sourceforge.net">geoserver-users@lists.sourceforge.net</a><br>
Subject: Re: [OpenLayers-Users] [Geoserver-users] wfs, state plane,and<br>
spherical mercator<br>
<br>
David Hollema ha scritto:<br>
> Here's my dilemma. I have a map with projection defined as spherical<br>
> Mercator, EPSG 900913. I have a geoserver WMS layer whose native<br>
> projection is state plane Colorado north (EPSG 2231). With help from<br>
> the lists, I'm able to overlay the WMS fine on a Virtual Earth map.<br>
> When I add a new WFS layer (pointing at the same geoserver data) using<br>
<br>
> similar constructor as the WMS, the WFS layer does not overlay fine,<br>
> it's shifted way off. That's problem 1. I can't figure out how
to<br>
get<br>
> the WFS to overlay.<br>
<br>
Please share the request you're making. The WFS and WMS reprojection<br>
syntaxes are not equal. Also, what is the SRS handling you chose<br>
in your feature type configuration?<br>
<br>
> Next question. I want to recenter the map based on a feature created<br>
> from a separate WFS request. I use OL.Format.GML and the read
method<br>
<br>
> to create a new feature from the responseXML. When I look at the<br>
> geometry of the point feature, the x,y cords are in the native<br>
> coordinates. I tried
point.transform("EPSG:2231","EPSG:900913") but<br>
the<br>
> transformation never works properly. All the examples I see go from<br>
> 4326 to 900913. My data are in State Plane. I would expect
that the<br>
> underlying transformation library could handle this transformation but<br>
<br>
> maybe not?<br>
<br>
You can also have GeoServer do the reprojection for you. You just<br>
have to add &srsName=EPSG:900913 to your request, keeping the eventual<br>
bbox in 2231, or have the bbox in 900913 too, but state it explicitly<br>
with &bbox=x0,y0,x1,y1,EPSG:900913<br>
<br>
Cheers<br>
Andrea<br>
<br>
--<br>
Andrea Aime<br>
OpenGeo - <a href="http://opengeo.org" target="_blank">http://opengeo.org</a><br>
Expert service straight from the developers.<o:p></o:p></p>
</div>
</div>
<p class=MsoNormal>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@openlayers.org">Users@openlayers.org</a><br>
<a href="http://openlayers.org/mailman/listinfo/users" target="_blank">http://openlayers.org/mailman/listinfo/users</a><o:p></o:p></p>
<div>
<div>
<p class=MsoNormal><br>
------------------------------------------------------------------------------<br>
This SF.net email is sponsored by:<br>
High Quality Requirements in a Collaborative Environment.<br>
Download a free trial of Rational Requirements Composer Now!<br>
<a href="http://p.sf.net/sfu/www-ibm-com" target="_blank">http://p.sf.net/sfu/www-ibm-com</a><br>
_______________________________________________<br>
Geoserver-users mailing list<br>
<a href="mailto:Geoserver-users@lists.sourceforge.net">Geoserver-users@lists.sourceforge.net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/geoserver-users"
target="_blank">https://lists.sourceforge.net/lists/listinfo/geoserver-users</a><o:p></o:p></p>
</div>
</div>
</div>
<p class=MsoNormal><o:p> </o:p></p>
</div>
</body>
</html>