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

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.

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?

Thanks,

Dave

David A. Hollema

GIS Analyst

United Power, Inc.

On Mon, Apr 06, 2009 at 02:56:42PM -0600, David Hollema wrote:

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?

1. The GML layer supports reprojection as a layer option, just specify
the projection:

  Layer.GML("", "", {projection: new
  OpenLayers.Projection("EPSG:2231")});

2. In order to use anything other than 900913 and 4326, yu'll need
to include proj4js support (seperately from OpenLayers).
http://proj4js.org / http://trac.osgeo.org/proj4js/ may help you here.

-- Chris

Thanks,

Dave

David A. Hollema

GIS Analyst

United Power, Inc.

_______________________________________________
Users mailing list
Users@anonymised.com
http://openlayers.org/mailman/listinfo/users

--
Christopher Schmidt
MetaCarta

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.

Here is my code. WMS reprojects fine b/c my understanding is geoserver
receives the base map projection (900913) and reprojects accordingly. I
would figure that geoserver would do the same thing to the WFS but it
doesn't. My SRS handling in geoserver is set to force declared (default
setting) and my declared is correct, 2231 in this case. For WMS, it's
not even necessary to set the srs in the layer constructor b/c geoserver
just figures it out.

It's important to note that I even tried with my source data in 4326
(lat/long) and WMS still worked fine but WFS fails. It doesn't seem to
be due to State Plane issues but it's more fundamental than that.

        var bounds = new OpenLayers.Bounds
(-20037508.34, -20037508.34, 20037508.34, 20037508.34);
        var options2 = {
                    units: 'm',
          projection: 'EPSG:900913',
          maxExtent: bounds
                };
        format = 'image/gif';

        map2 = new OpenLayers.Map('map2',
options2);
        
        velayer = new
OpenLayers.Layer.VirtualEarth( "VE",
        { 'type': VEMapStyle.Roads,
'sphericalMercator': true});
        
        layerWMS = new OpenLayers.Layer.WMS(
"Joint Use Photos",
                    "http://upigis:8080/geoserver/wms",
           {layers: 'sde:jointusepicture',
            format: format,
            transparent: true
            },
            {opacity: 1.0,
isBaseLayer: false, 'singleTile': true
            });
              
        layerWFS = new OpenLayers.Layer.WFS(
"Joint Use Photos WFS",
                    "http://upigis:8080/geoserver/wfs",
          {
          typename:
"sde:jointusepicture"},
          {extractAttributes: true}
          );

David A. Hollema
GIS Analyst

United Power, Inc.

-----Original Message-----
From: users-bounces@anonymised.com [mailto:users-bounces@anonymised.com]
On Behalf Of Andrea Aime
Sent: Tuesday, April 07, 2009 1:36 AM
To: David Hollema
Cc: users@anonymised.com; geoserver-users@lists.sourceforge.net
Subject: Re: [OpenLayers-Users] [Geoserver-users] wfs, state plane,and
spherical mercator

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.
_______________________________________________
Users mailing list
Users@anonymised.com
http://openlayers.org/mailman/listinfo/users

After some debugging, I figured out some of the problem. It's due to
the axis order spec in WFS 1.0 versus WFS 1.1. On the GML feature
geometry in my app, originally x was assigned the latitude and y was
assigned the longitude. I changed my WFS version in the
GetFeatureRequest to WMS 1.0 from 1.1 and it works! Next question is
how do I specify that WFS version in the OpenLayers.WFS constructor? I
tried the same syntax as in my GetFeatureRequest params with no success.

David A. Hollema
GIS Analyst

United Power, Inc.

-----Original Message-----
From: users-bounces@anonymised.com [mailto:users-bounces@anonymised.com]
On Behalf Of David Hollema
Sent: Wednesday, April 08, 2009 12:48 PM
To: Andrea Aime
Cc: users@anonymised.com; geoserver-users@lists.sourceforge.net
Subject: Re: [OpenLayers-Users] [Geoserver-users] wfs, state plane,and
spherical mercator

Here is my code. WMS reprojects fine b/c my understanding is geoserver
receives the base map projection (900913) and reprojects accordingly. I
would figure that geoserver would do the same thing to the WFS but it
doesn't. My SRS handling in geoserver is set to force declared (default
setting) and my declared is correct, 2231 in this case. For WMS, it's
not even necessary to set the srs in the layer constructor b/c geoserver
just figures it out.

It's important to note that I even tried with my source data in 4326
(lat/long) and WMS still worked fine but WFS fails. It doesn't seem to
be due to State Plane issues but it's more fundamental than that.

        var bounds = new OpenLayers.Bounds
(-20037508.34, -20037508.34, 20037508.34, 20037508.34);
        var options2 = {
                    units: 'm',
          projection: 'EPSG:900913',
          maxExtent: bounds
                };
        format = 'image/gif';

        map2 = new OpenLayers.Map('map2',
options2);
        
        velayer = new
OpenLayers.Layer.VirtualEarth( "VE",
        { 'type': VEMapStyle.Roads,
'sphericalMercator': true});
        
        layerWMS = new OpenLayers.Layer.WMS(
"Joint Use Photos",
                    "http://upigis:8080/geoserver/wms",
           {layers: 'sde:jointusepicture',
            format: format,
            transparent: true
            },
            {opacity: 1.0,
isBaseLayer: false, 'singleTile': true
            });
              
        layerWFS = new OpenLayers.Layer.WFS(
"Joint Use Photos WFS",
                    "http://upigis:8080/geoserver/wfs",
          {
          typename:
"sde:jointusepicture"},
          {extractAttributes: true}
          );

David A. Hollema
GIS Analyst

United Power, Inc.

-----Original Message-----
From: users-bounces@anonymised.com [mailto:users-bounces@anonymised.com]
On Behalf Of Andrea Aime
Sent: Tuesday, April 07, 2009 1:36 AM
To: David Hollema
Cc: users@anonymised.com; geoserver-users@lists.sourceforge.net
Subject: Re: [OpenLayers-Users] [Geoserver-users] wfs, state plane,and
spherical mercator

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.
_______________________________________________
Users mailing list
Users@anonymised.com
http://openlayers.org/mailman/listinfo/users
_______________________________________________
Users mailing list
Users@anonymised.com
http://openlayers.org/mailman/listinfo/users

Hi david!

for wfs I make this:

var France = new OpenLayers.Layer.WFS(
“France WFS”,“http://localhost:8080/geoserver/wfs”,
{
typeName: ‘dep’,
featureNS: ‘http://www.openplans.org/topp’,
//style:fStyle,
extractAttributes: true ,
srsName: “EPSG:900913”
},
{‘reproject’: true}
);

or

var wfs = new OpenLayers.Layer.Vector(
“France2 wfs”,
{
strategies: [new OpenLayers.Strategy.BBOX(), saveStrategy],
projection: new OpenLayers.Projection(“EPSG:900913”),
protocol: new OpenLayers.Protocol.WFS({
srsName: “EPSG:900913”,
url: “http://localhost:8080/geoserver/wfs”,
featureType: “dep”,
version:‘1.1.0’,
featureNS: “http://www.openplans.org/topp”,
})
}
);

try and tell me if it’s works.

Jim

2009/4/8 David Hollema <dhollema@anonymised.com>

Here is my code. WMS reprojects fine b/c my understanding is geoserver
receives the base map projection (900913) and reprojects accordingly. I
would figure that geoserver would do the same thing to the WFS but it
doesn’t. My SRS handling in geoserver is set to force declared (default
setting) and my declared is correct, 2231 in this case. For WMS, it’s
not even necessary to set the srs in the layer constructor b/c geoserver
just figures it out.

It’s important to note that I even tried with my source data in 4326
(lat/long) and WMS still worked fine but WFS fails. It doesn’t seem to
be due to State Plane issues but it’s more fundamental than that.

var bounds = new OpenLayers.Bounds
(-20037508.34, -20037508.34, 20037508.34, 20037508.34);
var options2 = {
units: ‘m’,
projection: ‘EPSG:900913’,
maxExtent: bounds
};
format = ‘image/gif’;

map2 = new OpenLayers.Map(‘map2’,
options2);

velayer = new
OpenLayers.Layer.VirtualEarth( “VE”,
{ ‘type’: VEMapStyle.Roads,
‘sphericalMercator’: true});

layerWMS = new OpenLayers.Layer.WMS(
“Joint Use Photos”,
http://upigis:8080/geoserver/wms”,
{layers: ‘sde:jointusepicture’,
format: format,
transparent: true
},
{opacity: 1.0,
isBaseLayer: false, ‘singleTile’: true
});

layerWFS = new OpenLayers.Layer.WFS(
“Joint Use Photos WFS”,
http://upigis:8080/geoserver/wfs”,
{
typename:
“sde:jointusepicture”},
{extractAttributes: true}
);

David A. Hollema
GIS Analyst

United Power, Inc.

-----Original Message-----
From: users-bounces@anonymised.com [mailto:users-bounces@anonymised.com80…]
On Behalf Of Andrea Aime
Sent: Tuesday, April 07, 2009 1:36 AM
To: David Hollema
Cc: users@anonymised.com; geoserver-users@anonymised.comge.net
Subject: Re: [OpenLayers-Users] [Geoserver-users] wfs, state plane,and
spherical mercator

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.


Users mailing list
Users@anonymised.com
http://openlayers.org/mailman/listinfo/users


This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com


Geoserver-users mailing list
Geoserver-users@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

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?

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?

David A. Hollema

GIS Analyst

United Power, Inc.

From: Jimmy Aumard [mailto:jimmy.aumard@anonymised.com]
Sent: Thursday, April 09, 2009 1:06 AM
To: David Hollema
Cc: Andrea Aime; users@anonymised.com; geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] [OpenLayers-Users] wfs, state plane, and spherical mercator

Hi david!

for wfs I make this:

var France = new OpenLayers.Layer.WFS(
“France WFS”,“http://localhost:8080/geoserver/wfs”,
{
typeName: ‘dep’,
featureNS: ‘http://www.openplans.org/topp’,
//style:fStyle,
extractAttributes: true ,
srsName: “EPSG:900913”
},
{‘reproject’: true}
);

or

var wfs = new OpenLayers.Layer.Vector(
“France2 wfs”,
{
strategies: [new OpenLayers.Strategy.BBOX(), saveStrategy],
projection: new OpenLayers.Projection(“EPSG:900913”),
protocol: new OpenLayers.Protocol.WFS({
srsName: “EPSG:900913”,
url: “http://localhost:8080/geoserver/wfs”,
featureType: “dep”,
version:‘1.1.0’,
featureNS: “http://www.openplans.org/topp”,
})
}
);

try and tell me if it’s works.

Jim

2009/4/8 David Hollema <dhollema@anonymised.com>

Here is my code. WMS reprojects fine b/c my understanding is geoserver
receives the base map projection (900913) and reprojects accordingly. I
would figure that geoserver would do the same thing to the WFS but it
doesn’t. My SRS handling in geoserver is set to force declared (default
setting) and my declared is correct, 2231 in this case. For WMS, it’s
not even necessary to set the srs in the layer constructor b/c geoserver
just figures it out.

It’s important to note that I even tried with my source data in 4326
(lat/long) and WMS still worked fine but WFS fails. It doesn’t seem to
be due to State Plane issues but it’s more fundamental than that.

var bounds = new OpenLayers.Bounds
(-20037508.34, -20037508.34, 20037508.34, 20037508.34);
var options2 = {
units: ‘m’,
projection: ‘EPSG:900913’,
maxExtent: bounds
};
format = ‘image/gif’;

map2 = new OpenLayers.Map(‘map2’,
options2);

velayer = new
OpenLayers.Layer.VirtualEarth( “VE”,
{ ‘type’: VEMapStyle.Roads,
‘sphericalMercator’: true});

layerWMS = new OpenLayers.Layer.WMS(
“Joint Use Photos”,
http://upigis:8080/geoserver/wms”,
{layers: ‘sde:jointusepicture’,
format: format,
transparent: true
},
{opacity: 1.0,
isBaseLayer: false, ‘singleTile’: true
});

layerWFS = new OpenLayers.Layer.WFS(
“Joint Use Photos WFS”,
http://upigis:8080/geoserver/wfs”,
{
typename:
“sde:jointusepicture”},
{extractAttributes: true}
);

David A. Hollema
GIS Analyst

United Power, Inc.

-----Original Message-----
From: users-bounces@anonymised.com [mailto:users-bounces@anonymised.com.]
On Behalf Of Andrea Aime
Sent: Tuesday, April 07, 2009 1:36 AM
To: David Hollema
Cc: users@anonymised.com; geoserver-users@anonymised.com.sourceforge.net
Subject: Re: [OpenLayers-Users] [Geoserver-users] wfs, state plane,and
spherical mercator

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.


Users mailing list
Users@anonymised.com
http://openlayers.org/mailman/listinfo/users


This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com


Geoserver-users mailing list
Geoserver-users@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

I have the same problem with the first method sorry :s

But the second method (with Protocol.WFS) work but you want to use this library

If you find the problem for the first method give me the response please.

Cheers , Jim

2009/4/9 David Hollema <dhollema@anonymised.com>

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?

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?

David A. Hollema

GIS Analyst

United Power, Inc.

From: Jimmy Aumard [mailto:jimmy.aumard@anonymised.com]
Sent: Thursday, April 09, 2009 1:06 AM
To: David Hollema
Cc: Andrea Aime; users@anonymised.com; geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] [OpenLayers-Users] wfs, state plane, and spherical mercator

Hi david!

for wfs I make this:

var France = new OpenLayers.Layer.WFS(
“France WFS”,“http://localhost:8080/geoserver/wfs”,
{
typeName: ‘dep’,
featureNS: ‘http://www.openplans.org/topp’,
//style:fStyle,
extractAttributes: true ,
srsName: “EPSG:900913”
},
{‘reproject’: true}
);

or

var wfs = new OpenLayers.Layer.Vector(
“France2 wfs”,
{
strategies: [new OpenLayers.Strategy.BBOX(), saveStrategy],
projection: new OpenLayers.Projection(“EPSG:900913”),
protocol: new OpenLayers.Protocol.WFS({
srsName: “EPSG:900913”,
url: “http://localhost:8080/geoserver/wfs”,
featureType: “dep”,
version:‘1.1.0’,
featureNS: “http://www.openplans.org/topp”,
})
}
);

try and tell me if it’s works.

Jim

2009/4/8 David Hollema <dhollema@anonymised.com>

Here is my code. WMS reprojects fine b/c my understanding is geoserver
receives the base map projection (900913) and reprojects accordingly. I
would figure that geoserver would do the same thing to the WFS but it
doesn’t. My SRS handling in geoserver is set to force declared (default
setting) and my declared is correct, 2231 in this case. For WMS, it’s
not even necessary to set the srs in the layer constructor b/c geoserver
just figures it out.

It’s important to note that I even tried with my source data in 4326
(lat/long) and WMS still worked fine but WFS fails. It doesn’t seem to
be due to State Plane issues but it’s more fundamental than that.

var bounds = new OpenLayers.Bounds
(-20037508.34, -20037508.34, 20037508.34, 20037508.34);
var options2 = {
units: ‘m’,
projection: ‘EPSG:900913’,
maxExtent: bounds
};
format = ‘image/gif’;

map2 = new OpenLayers.Map(‘map2’,
options2);

velayer = new
OpenLayers.Layer.VirtualEarth( “VE”,
{ ‘type’: VEMapStyle.Roads,
‘sphericalMercator’: true});

layerWMS = new OpenLayers.Layer.WMS(
“Joint Use Photos”,
http://upigis:8080/geoserver/wms”,
{layers: ‘sde:jointusepicture’,
format: format,
transparent: true
},
{opacity: 1.0,
isBaseLayer: false, ‘singleTile’: true
});

layerWFS = new OpenLayers.Layer.WFS(
“Joint Use Photos WFS”,
http://upigis:8080/geoserver/wfs”,
{
typename:
“sde:jointusepicture”},
{extractAttributes: true}
);

David A. Hollema
GIS Analyst

United Power, Inc.

-----Original Message-----
From: users-bounces@anonymised.com [mailto:users-bounces@anonymised.com]
On Behalf Of Andrea Aime
Sent: Tuesday, April 07, 2009 1:36 AM
To: David Hollema
Cc: users@anonymised.com; geoserver-users@lists.sourceforge.net
Subject: Re: [OpenLayers-Users] [Geoserver-users] wfs, state plane,and
spherical mercator

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.


Users mailing list
Users@anonymised.com
http://openlayers.org/mailman/listinfo/users


This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com


Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users