[Geoserver-users] Can WFS request within a specific coordinate system?

Hello dear everyone,
A problem is boring me for a long time. I have a shapefile with Xi’an 1980 Gauss-Kruger projected coordinate system. I have added it into Geoserver1.5.3. So I can visit in and in EPSG:2345(Xi’an80).But when I difine a Openlayers map using EPSG:4326, I send a WFS request,it cannot return data in EPSG:4326(e.g.115.92437,40.33868),it only return data in EPSG:2345(e.g.456144.21976956,360540.12626545).Can WFS request within a specific coordinate system?Could you please give me some suggestion?Thank you very much!

My data bounds of EPSG:2345(Xi’an80)—[408505.601730307,243130.22127576193,609189.9534386132,442162.4009358797]
My data bounds of EPSG:4326(WGS84)—[115.39341152279792,39.42177996274203,117.51208150066472,41.04546517139397]

Sincerely yours,
Yang


1分钟,让眼睛享受春天的清润SPA

Yang Zhaohui <yangzhaozhao2008 <at> 163.com> writes:

Hello dear everyone, A problem is boring me for a long time. I have a

shapefile with Xi'an 1980 Gauss-Kruger projected coordinate system. I have added
it into Geoserver1.5.3. So I can visit in and in EPSG:2345(Xi'an80).But when I
difine a Openlayers map using EPSG:4326, I send a WFS request,it cannot return
data in EPSG:4326(e.g.115.92437,40.33868),it only return data in
EPSG:2345(e.g.456144.21976956,360540.12626545).Can WFS request within a specific
coordinate system?Could you please give me some suggestion?Thank you very much!

Hi,

Geoserver 1.5 supports only WFS version 1.0 and it means that only one
projection is supported at a time. You can select with Geoserver Feature
type editor which projection is used for output, put if you change it to
epsg:4326 you cannot use the native epsg:2345 any more for that
featuretype. However, you can make another featuretype from the same
data with a different name and deliver that in another projection.

Geoserver 1.6 has an option to use WFS 1.1 which supports requesting
data in different projections. At the same time WFS 1.1 is changing
many other things, too.

-Jukka Rahkonen-

Jukka Rahkonen ha scritto:

Yang Zhaohui <yangzhaozhao2008 <at> 163.com> writes:

Hello dear everyone, A problem is boring me for a long time. I have a

shapefile with Xi'an 1980 Gauss-Kruger projected coordinate system. I have added
it into Geoserver1.5.3. So I can visit in and in EPSG:2345(Xi'an80).But when I
difine a Openlayers map using EPSG:4326, I send a WFS request,it cannot return
data in EPSG:4326(e.g.115.92437,40.33868),it only return data in
EPSG:2345(e.g.456144.21976956,360540.12626545).Can WFS request within a specific
coordinate system?Could you please give me some suggestion?Thank you very much!

Hi,

Geoserver 1.5 supports only WFS version 1.0 and it means that only one
projection is supported at a time. You can select with Geoserver Feature
type editor which projection is used for output, put if you change it to
epsg:4326 you cannot use the native epsg:2345 any more for that featuretype. However, you can make another featuretype from the same data with a different name and deliver that in another projection.

Geoserver 1.6 has an option to use WFS 1.1 which supports requesting
data in different projections. At the same time WFS 1.1 is changing many other things, too.

A little secret is that while we added support for projection change in wfs 1.1, we did the same for 1.0. Of course this is a vendor extension
to wfs 1.0, it's not standard but...
while this wfs GetFeature will return data in 4326 (native):
http://geo.openplans.org:8080/geoserver/wfs?request=GetFeature&version=1.1.0&typeName=topp:states&outputFormat=GML2&FEATUREID=states.3
this one will give you back the same in the Google projection (900913):
http://geo.openplans.org:8080/geoserver/wfs?request=GetFeature&version=1.1.0&typeName=topp:states&outputFormat=GML2&FEATUREID=states.3&srsName=epsg:900913

Cheers
Andrea

Andrea Aime <aaime <at> openplans.org> writes:

A little secret is that while we added support for projection change in
wfs 1.1, we did the same for 1.0. Of course this is a vendor extension
to wfs 1.0, it's not standard but...
while this wfs GetFeature will return data in 4326 (native):

http://geo.openplans.org:8080/geoserver/wfs?request=GetFeature&version=1.1.0&typeName=topp:states&outputFormat=GML2&FEATUREID=states.3

this one will give you back the same in the Google projection (900913):

http://geo.openplans.org:8080/geoserver/wfs?request=GetFeature&version=1.1.0&typeName=topp:states&outputFormat=GML2&FEATUREID=states.3&srsName=epsg:900913

Good news. I must have a try with the WFS clients I am using. I they work with
this additional vendor parameter I will stay in WFS 1.0. For me projection
change is the only real improvement in WFS 1.1.

-Jukka-

Jukka Rahkonen ha scritto:

Andrea Aime <aaime <at> openplans.org> writes:

A little secret is that while we added support for projection change in wfs 1.1, we did the same for 1.0. Of course this is a vendor extension
to wfs 1.0, it's not standard but...
while this wfs GetFeature will return data in 4326 (native):

http://geo.openplans.org:8080/geoserver/wfs?request=GetFeature&version=1.1.0&typeName=topp:states&outputFormat=GML2&FEATUREID=states.3

this one will give you back the same in the Google projection (900913):

http://geo.openplans.org:8080/geoserver/wfs?request=GetFeature&version=1.1.0&typeName=topp:states&outputFormat=GML2&FEATUREID=states.3&srsName=epsg:900913

Good news. I must have a try with the WFS clients I am using. I they work with
this additional vendor parameter I will stay in WFS 1.0. For me projection
change is the only real improvement in WFS 1.1.

There's sorting too :wink: (but yeah, not much else...)
Cheers
Andrea