[OpenLayers-Users] How to use OpenLayers requesting WFS with
Spatial Operations
Kris Geusebroek
kgeusebroek at xebia.com
Mon Apr 27 08:18:04 EDT 2009
Hi Myeonghun,
I think with the rectangle used as a BBOx you could create a BBOX filter
and create a WFS layer for your buildings with that BBOX filter
This layer could have a separate style so the features are highlighted.
Within this layer all information about the highlighted features is
available (if you set extractAttributes to true of course)
So you could show a popup on hover or so
Cheers
Kris
From: Myeong Hun Jeong [mailto:mhjeong74 at gmail.com]
Sent: Monday, April 27, 2009 2:09 PM
To: Kris Geusebroek
Cc: users at openlayers.org
Subject: Re: [OpenLayers-Users] How to use OpenLayers requesting WFS
with Spatial Operations
Thanks Kris Geusebroek.
In my case, I loaded WMS building layer because WFS layer loading time
is big.
After loading WMS layer, I draw rectangle on the map.
After drawing rectangle, what I want to do is that
I want to get information for building features within the rectangle and
I also would like to select or highlight features within the rectangle.
What shoul I do?
Best regards,
Myeonghun Jeong.
2009/4/25 Myeong Hun Jeong <mhjeong74 at gmail.com>
Hi Roald,
There are two things I want to know.
1. How to send WFS requests to server with openlayers? I know the way to
load WFS layers when I initialize map, but after loading layers, I don't
know how to request WFS with Spatial Operations in OpenLayers.
2. I also want to know the way to display a WFS layer on my map that
automatically requests the correct features within the BBOX of the
viewport?
Thanks in advance.
Best Regrards,
Myeonghun Jeong.
2009/4/25 Roald de Wit <roald.dewit at lisasoft.com>
Hi Myeonghun Jeong,
Can you explain what you try to do? Do you want to display a WFS
layer on your map that automatically requests the correct features
within the BBOX of the viewport or do you want to have control over what
BBOX you send to the WFS server and send your WFS 'manually'?
Maybe it is good to have a look at some examples (type WFS in
the search box): [1].
Regards, Roald
[1] http://www.openlayers.org/dev/examples/
Myeong Hun Jeong wrote:
Dear list.
I want to know how to use openlayers when I request WFS with
Spatial Operations.
For example, at GeoServer Demo Request page, I can fin
WFS_getFeatureBBox01.1.url and WFS_getFeatureBBox01.1.xml samples.
So, the request is that
http://localhost:8888/geoserver/wfs?request=GetFeature&version=1.0.0&typ
eName=topp:states&propertyName=STATE_NAME,PERSONS&BBOX=-75.102613,40.212
597,-72.361859,41.512517
<http://localhost:8888/geoserver/wfs?request=GetFeature&version=1.0.0&ty
peName=topp:states&propertyName=STATE_NAME,PERSONS&BBOX=-75.102613,40.21
2597,-72.361859,41.512517>
or
http://localhost:8888/geoserver/wfs
<wfs:GetFeature service="WFS" version="1.1.0"
xmlns:topp="http://www.openplans.org/topp"
xmlns:wfs="http://www.opengis.net/wfs"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:gml="http://www.opengis.net/gml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/wfs
http://schemas.opengis.net/wfs/1.1.0/wfs.xsd">
<wfs:Query typeName="topp:states">
<wfs:PropertyName>topp:STATE_NAME</wfs:PropertyName>
<wfs:PropertyName>topp:PERSONS</wfs:PropertyName>
<ogc:Filter>
<ogc:BBOX>
<ogc:PropertyName>the_geom</ogc:PropertyName>
<gml:Envelope
srsName="http://www.opengis.net/gml/srs/epsg.xml#4326">
<gml:lowerCorner>-75.102613
40.212597</gml:lowerCorner>
<gml:upperCorner>-72.361859
41.512517</gml:upperCorner>
</gml:Envelope>
</ogc:BBOX>
</ogc:Filter>
</wfs:Query>
</wfs:GetFeature>
But when I use openlayers, how to request thses requests
exactly?
For instance, when I request GetFeatureInfo with openlayers.
// support GetFeatureInfo
map.events.register('click', map, function (e) {
document.getElementById('nodelist').innerHTML =
"Loading... please wait...";
var url = map.layers[0].getFullRequestString(
{
REQUEST: "GetFeatureInfo",
EXCEPTIONS: "application/vnd.ogc.se_xml",
BBOX: map.getExtent().toBBOX(),
X: e.xy.x,
Y: e.xy.y,
INFO_FORMAT: 'text/html',
QUERY_LAYERS:
map.layers[0].params.LAYERS,
FEATURE_COUNT: 50,
WIDTH: map.size.w,
HEIGHT: map.size.h
},
"http://localhost:8888/geoserver/wms"
);
OpenLayers.loadURL(url, '', this, setHTML,
setHTML);
OpenLayers.Event.stop(e);
});
}
Please, give me a piece of information.
Best regards,
Myeonghun Jeong.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20090427/a8c48f31/attachment.html
More information about the Users
mailing list