[OpenLayers-Users] Vector Layer, WFS Protocol and BBOX strategy problem

Pedro Baracho pedropbaracho at gmail.com
Tue Nov 10 08:06:38 EST 2009


Hey again,

thanks a lot for the help Andreas.

I didn't have proj4js loaded. I thought it came along with OL. :P

It is working great now.

I just have a minor issue that is the first load of the page.
On firebug, the BBOX filter of the first request doesn't get reprojected to
29193, but from the second request on, the BBOX gets reprojected and the
data is drawn.

This might have something to do with the request being sent before proj4js
is completely loaded. I used the complete version with all EPSG projections
on it, and it is a 70kb compressed js file.

I will try removing all the other projections from it and initializing only
EPSG:29193 using "Proj4js.defs" and see if that solves the problem.

Do you have any suggestion regarding this?

On Tue, Nov 10, 2009 at 10:37 AM, Andreas Hocevar <ahocevar at opengeo.org>wrote:

> Hi,
>
> do you have proj4js.js included in your html page? See
> http://trac.openlayers.org/wiki/Documentation/Dev/proj4js
>
> OpenLayers out of the box can only transform between EPSG:4326 and
> EPSG:900913.
>
> Regards,
> Andreas.
>
> On 11/10/09, Pedro Baracho <pedropbaracho at gmail.com> wrote:
> > Thanks for the reply.
> >
> > I changed to 1.1.0, but I am still having problems with projections.
> >
> > The BBOX filter of the request is being built with weird numbers on it:
> >
> > <ogc:BBOX><ogc:PropertyName>GEOLOC</ogc:PropertyName><gml:Envelope
> > xmlns:gml="http://www.opengis.net/gml"
> > srsName="EPSG:29193"><gml:lowerCorner>-4987936.2379319
> > -2307634.0730985</gml:lowerCorner><gml:upperCorner>-4797149.4153663
> > -2213769.4023813</gml:upperCorner></gml:Envelope></ogc:BBOX>
> >
> > Those numbers don't make any sense in EPSG:29193 (
> > http://spatialreference.org/ref/epsg/29193/)
> > The bounds should be limited to: 166020.2387, 7087605.5418, 833979.7613,
> > 10000000.0000, and I am seeing some negative numbers.
> >
> > I also changed the displayProjection on the map to EPSG:29193 and those
> > weird numbers are confirmed by OpenLayers.Control.MousePosition.
> >
> > My guess is that there is some problem with the reprojection routine from
> > 900913 to 29193. I am also guessing this may be because 29193 is limited
> to
> > a region of the globe while 900913 is a world-wide projection. Does it
> make
> > sense? I don't know much about cartography and projections and I didn't
> dig
> > in OpenLayers code yet.
> >
> > Do you have any other hint for me?
> >
> > On Mon, Nov 9, 2009 at 6:40 PM, Andreas Hocevar <ahocevar at opengeo.org
> >wrote:
> >
> >> Hi,
> >>
> >> WFS 1.0.0 does not support on-the-fly reprojection. You have to use WFS
> >> 1.1.0, which is e.g. supported by GeoServer. And you have to specify the
> >> version on the protocol:
> >>
> >> Pedro Baracho wrote:
> >> > var layer = new OpenLayers.Layer.Vector("WFS", {
> >> >                     strategies: [new OpenLayers.Strategy.BBOX(),
> >> > saveStrategy],
> >> >                     protocol: new OpenLayers.Protocol.WFS({
> >>                             version: "1.1.0",
> >> >                         url:  "http://localhost:8080/geoserver/wfs",
> >> >                         featureType: "Regional",
> >> >                         featureNS: "http://prodabel1062.pbh:8080/avis
> ",
> >> >                         geometryName: "GEOLOC",
> >> >                         srsName: "EPSG:29193"
> >> >                     }),
> >> >                     projection: new
> OpenLayers.Projection("EPSG:29193")
> >> >             });
> >> >
> >>
> >>
> >> Regards,
> >> Andreas.
> >>
> >> --
> >> Andreas Hocevar
> >> OpenGeo - http://opengeo.org/
> >> Expert service straight from the developers.
> >>
> >>
> >
>
>
> --
> Andreas Hocevar
> OpenGeo - http://opengeo.org/
> Expert service straight from the developers.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20091110/dcfad660/attachment.html


More information about the Users mailing list