Tiled WFS layer (need feedback)

6 messages Options
Embed this post
Permalink
Martijn van Oosterhout-2

Tiled WFS layer (need feedback)

Reply Threaded More More options
Print post
Permalink
[Not for 2.6]. I've finally gotten around to doing tiled WFS "the
right way" as some would put it. After some discussion on IRC it was
decided the best way would be to have a new "singleTile: false" option
to support the tiled mode. A couple of points which relate to
compatability:

- WFS will now inherit from Vector, Markers and Grid

so instead of having WFS doing its own tile loading stuff, it reuses
the singletile mode from Grid. This removes a bit of duplicate code.

- The url argument of Tile.WFS is basically unused

After this the tiles (even in singleTile mode) will use the getURL
function of the layer with the bounds to determine the URL, just like
TMS does. The URL is slated for removal in 3.0 so I doubt anyone will
be bothered by this.

- Feature lifecycle management

Currently the Tile.WFS fetches features and passes them to the layer
and forgets about them. For tiled mode you can't really do this, since
you need to know which features go away when a tile moves out of
range. So in tiled mode the tile manage their own features, adding and
removing from the layer as appropriate. What I would like to do is
that even in singleTile mode the tile manages the features: this opens
up the path of, when dragging/zooming in singleTile mode, a new tile
is created and populated before deleting the old one, to avoid
flickering (I beleive something similar is planned for TMS?).

This is a API change and I'd like to know what people think on this point.

- Managing of duplication between WFS tiles

One of the harder parts of tiled WFS is that a single feature can
exist in multiple tiles. The way this is managed is by reference
counting the features based on the fid of the feature. Anonymous
features (fid==null) are assumed unique. I beleive this fits with most
people's expectations. It does assume that server will always pass
complete features and won't require the client to merge multiple
results.

- Adding internal/external projection support

The script I was using on the server isn't really a WFS server so I
needed to adjust the URL generation to reproject the bounding boxes
based on the external projection. This is perhaps an orthoginal
feature and should be submitted seperately.

- The refresh function

WFS has a refresh function that no-one else has. I'm unclear as to
what it's supposed to do. It appears to remove all the features and
the call the tile to readd them or something. It doesn't appear to
want to refresh from the server though, so what's the point. Can
someone enlighten me?

- Tile size

For TMS the tilesize is fixed by the size of the images. For WFS the
tilesize is essentially arbitrary. On the one hand you could say the
tilesize size should be a fixed portion of the map, so zooming doesn't
need to go to the server at all. OTOH, a server may want to return
different details depending on the zoom-level. For the moment I've
punted on this and pretended it's just like TMS but it's something to
consider.

Looking forward to your responses,
--
Martijn van Oosterhout <[hidden email]> http://svana.org/kleptog/
_______________________________________________
Dev mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/dev
Christopher Schmidt-2

Re: Tiled WFS layer (need feedback)

Reply Threaded More More options
Print post
Permalink
On Tue, Feb 12, 2008 at 10:10:04AM +0100, Martijn van Oosterhout wrote:
> - Adding internal/external projection support
>
> The script I was using on the server isn't really a WFS server so I
> needed to adjust the URL generation to reproject the bounding boxes
> based on the external projection. This is perhaps an orthoginal
> feature and should be submitted seperately.

Yeah; this is something I actually should have added a bit ago. If a
projection is set on the map, and there's a different projection set on
the layer, we should reproject the coordinates before requesting them
(to the projection of the layer) if possible. This makes sense to have
in 2.6 if we can get a sane patch quickly; I had forgotten to take this
into account with my earlier Layer projection work.

Regards,
--
Christopher Schmidt
MetaCarta
_______________________________________________
Dev mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/dev
Tim Schaub-3

Re: Tiled WFS layer (need feedback)

Reply Threaded More More options
Print post
Permalink
In reply to this post by Martijn van Oosterhout-2
Hey-

Martijn van Oosterhout wrote:
> [Not for 2.6]. I've finally gotten around to doing tiled WFS "the
> right way" as some would put it. After some discussion on IRC it was
> decided the best way would be to have a new "singleTile: false" option
> to support the tiled mode. A couple of points which relate to
> compatability:

Sounds great.  Is this available to take a look at somewhere?

> - Feature lifecycle management
>
> Currently the Tile.WFS fetches features and passes them to the layer
> and forgets about them. For tiled mode you can't really do this, since
> you need to know which features go away when a tile moves out of
> range. So in tiled mode the tile manage their own features, adding and
> removing from the layer as appropriate. What I would like to do is
> that even in singleTile mode the tile manages the features: this opens
> up the path of, when dragging/zooming in singleTile mode, a new tile
> is created and populated before deleting the old one, to avoid
> flickering (I beleive something similar is planned for TMS?).

I think it also makes sense to allow users to only remove features that
are outside the viewport - even in singleTile mode.  This can be done
with an option to removeFeatures that checks bounds on features and only
ditches features with bounds that do not intersect the viewport bounds.

>
> This is a API change and I'd like to know what people think on this point.
>
> - Managing of duplication between WFS tiles
>
> One of the harder parts of tiled WFS is that a single feature can
> exist in multiple tiles. The way this is managed is by reference
> counting the features based on the fid of the feature. Anonymous
> features (fid==null) are assumed unique. I beleive this fits with most
> people's expectations. It does assume that server will always pass
> complete features and won't require the client to merge multiple
> results.

I think it makes sense to add an option to layer.addFeatures so only
unique features are added.  I've done this by managing a "fids" property
on the vector layer, relying on that mapping to determine which features
are on a layer by fid.  How did you handle this?

Thanks for working on this.

Tim
_______________________________________________
Dev mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/dev
Martijn van Oosterhout-2

Re: Tiled WFS layer (need feedback)

Reply Threaded More More options
Print post
Permalink
On Feb 12, 2008 4:47 PM, Tim Schaub <[hidden email]> wrote:
> Sounds great.  Is this available to take a look at somewhere?

Here, but it's slow as molasses, so be gentle:
http://tile.openstreetmap.nl/testwfs.html

> I think it also makes sense to allow users to only remove features that
> are outside the viewport - even in singleTile mode.  This can be done
> with an option to removeFeatures that checks bounds on features and only
> ditches features with bounds that do not intersect the viewport bounds.

But then how do you handle the destroying of the features when the
layer is destroyed? Destroy the tile and then destroy what's left.
That what I called bad lifecycle management...

> I think it makes sense to add an option to layer.addFeatures so only
> unique features are added.  I've done this by managing a "fids" property
> on the vector layer, relying on that mapping to determine which features
> are on a layer by fid.  How did you handle this?

Basically that, only I called it featureIndex.

Have a nice day,
--
Martijn van Oosterhout <[hidden email]> http://svana.org/kleptog/
_______________________________________________
Dev mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/dev
rdewit

Re: Tiled WFS layer (need feedback)

Reply Threaded More More options
Print post
Permalink
Hi Martijn,

I'm interested in the work you've done on WFS tiling. Have you got your
code in a sandbox too or can you please create a ticket and a patch for
this, so people can have a look at it?

Kind regards, Roald

On Tue, 2008-02-12 at 21:08 +0100, Martijn van Oosterhout wrote:

> On Feb 12, 2008 4:47 PM, Tim Schaub <[hidden email]> wrote:
> > Sounds great.  Is this available to take a look at somewhere?
>
> Here, but it's slow as molasses, so be gentle:
> http://tile.openstreetmap.nl/testwfs.html
>
> > I think it also makes sense to allow users to only remove features that
> > are outside the viewport - even in singleTile mode.  This can be done
> > with an option to removeFeatures that checks bounds on features and only
> > ditches features with bounds that do not intersect the viewport bounds.
>
> But then how do you handle the destroying of the features when the
> layer is destroyed? Destroy the tile and then destroy what's left.
> That what I called bad lifecycle management...
>
> > I think it makes sense to add an option to layer.addFeatures so only
> > unique features are added.  I've done this by managing a "fids" property
> > on the vector layer, relying on that mapping to determine which features
> > are on a layer by fid.  How did you handle this?
>
> Basically that, only I called it featureIndex.
>
> Have a nice day,
--
Roald de Wit
Software Engineer
[hidden email]

Commercial Support for Open Source GIS Software
http://lisasoft.com/LISAsoft/SupportedProducts/

_______________________________________________
Dev mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/dev
Martijn van Oosterhout-2

Re: Tiled WFS layer (need feedback)

Reply Threaded More More options
Print post
Permalink
On Thu, Feb 28, 2008 at 6:24 AM, Roald de Wit
<[hidden email]> wrote:
> Hi Martijn,
>
>  I'm interested in the work you've done on WFS tiling. Have you got your
>  code in a sandbox too or can you please create a ticket and a patch for
>  this, so people can have a look at it?

No sandbox (not sure if I have access to make one or not). I can make
a patch....

Ok, done, see #1401.

Have a nice day,
--
Martijn van Oosterhout <[hidden email]> http://svana.org/kleptog/
_______________________________________________
Dev mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/dev