Ticket #2570 (closed feature: fixed)

Opened 3 years ago

Last modified 3 years ago

Create control to perform SLD selections on WMS layers

Reported by: bartvde Owned by: bartvde
Priority: minor Milestone: 2.10 Release
Component: Control Version: 2.8
Keywords: Cc:
State: Complete

Description

Create a control which can perform selections on WMS layers in point, box, polygon and line mode using Styled Layer Descriptors.

Attachments

ticket2270.patch Download (42.5 KB) - added by bartvde 3 years ago.
ticket2570.patch Download (43.3 KB) - added by bartvde 3 years ago.
new patch incorporating ahocevar's comments. Control now works with a sketch handler, and the cache objects are configurable. Added circle selection to example, however demo.geoserver.org gives a HTTP error 502 proxy error on the SLD. Mapserver handles it okay.
openlayers-2570-increment.diff Download (12.6 KB) - added by ahocevar 3 years ago.
incremental patch against attachment:ticket2570.patch Download
openlayers-2570-scopefix.patch Download (0.6 KB) - added by ahocevar 3 years ago.
openlayers-2570-syntax.patch Download (1.1 KB) - added by fredj 3 years ago.

Change History

Changed 3 years ago by bartvde

  Changed 3 years ago by bartvde

  • state set to Review

Sorry name of the attachment is misleading (2270 instead of 2570), but it's the right one. Tests pass in IE6 and FF 3.5.9. Please review.

  Changed 3 years ago by bartvde

If people think this could better be an addin, please change the milestone to Addins.

  Changed 3 years ago by bartvde

Eric commented on the dev list this would be okay for OL.

A discussion point: maybe we can store the DescribeFeatureType cache in layer.metadata instead?

  Changed 3 years ago by bartvde

Also, what do we do with the DWithin issue in Geoserver? IMO the generated SLD is correct. Mapserver treats it okay. Add a comment to the example?

 http://permalink.gmane.org/gmane.comp.gis.geoserver.user/20646

  Changed 3 years ago by ahocevar

The DWithin issue is  http://jira.codehaus.org/browse/GEOS-937.

Since we don't have layer.metadata yet, I'd say caching in the Control's namespace is fine.

  Changed 3 years ago by bartvde

Are you sure that's the issue Andreas, since the source data is in EPSG:4326, and the DWithin filter has units degrees? The JIRA issue seems to describe the case where the DWithin units differ from the source units.

I added the metadata property for Layer in the patch for OWSContext (ticket:2063), based on your comments there.

  Changed 3 years ago by ahocevar

Bart: you are right. I just ran the example against my local geoserver, and I get an error in the log:

unknown filter [ogc:DWithin: null]

I am already in touch with our GeoServer developers to see what is wrong here.

follow-ups: ↓ 9 ↓ 10   Changed 3 years ago by ahocevar

Regarding cache: #2063 will be the next ticket on my review list, but I remember now. I would not use metadata in this case, because there is nothing we want to round-trip with a format here.

One more thing: I would like your great patch even better if you wouldn't have to configure a mode (which, BTW, is not documented well), but could configure it with a sketch handler to perform selection.

in reply to: ↑ 8   Changed 3 years ago by bartvde

  • state changed from Review to Needs More Work

Replying to ahocevar:

One more thing: I would like your great patch even better if you wouldn't have to configure a mode (which, BTW, is not documented well), but could configure it with a sketch handler to perform selection.

That's a great suggestion (like with the circle mode in GetFeature :-), I'll work on that and update the status once it's done.

in reply to: ↑ 8   Changed 3 years ago by bartvde

Replying to ahocevar:

Regarding cache: #2063 will be the next ticket on my review list, but I remember now. I would not use metadata in this case, because there is nothing we want to round-trip with a format here.

Okay, I was thinking of storing it on the layer through metadata so that other controls/widgets in an application can also use the cache instead of doing the actual request. Does it not make more sense on the layer than in a control-specific cache?

  Changed 3 years ago by ahocevar

If you do so, applications need to rely on layer.metadata, and we need to be very strict about what goes in layer.metadata, document when it will be populated with what, and so on. I see layer.metadata as something that layer oriented formats need for round tripping.

The problem here is that the control does a lot more than other controls. The usual OpenLayers way would be to not let it fetch DescribeLayer and DescribeFeatureType itself, but configure it with a DescribeFeatureType response. Then the application needs to do DescribeLayer and derive DescribeFeatureType. This is inconvenient for the application developer, but leaves more options (e.g. were to cache the responses) open. You could also combine both approaches, i.e. allow to configure the DescribeFeatureType object. Then the control stays convenient if not configured with it, and the developer has full control if configured with it.

Changed 3 years ago by bartvde

new patch incorporating ahocevar's comments. Control now works with a sketch handler, and the cache objects are configurable. Added circle selection to example, however demo.geoserver.org gives a HTTP error 502 proxy error on the SLD. Mapserver handles it okay.

  Changed 3 years ago by bartvde

  • state changed from Needs More Work to Review

Tests still pass in FF3.6 and IE6, please review.

Changed 3 years ago by ahocevar

incremental patch against attachment:ticket2570.patch Download

  Changed 3 years ago by ahocevar

  • state changed from Review to Commit

Bart, this is an incredibly powerful new control, I'm really impressed!

Please see my incremental patch. The one issue that I fixed in there is that in your patch, selecting before all DescribeFeatureType results are available would not return anything. Other than that, I think caching on the prototype by default is better, so I changed it that way. I also removed the layerDefaults from the prototype, added some documentation, and renamed cache to wfsCache.

Please apply my incremental patch to your version before committing, or let me know if you don't agree.

I have tried the example and ran the tests in Safari 4 with my incremental patch applied, and everything looked fine.

  Changed 3 years ago by bartvde

  • status changed from new to closed
  • state changed from Commit to Complete
  • resolution set to fixed

(In [10290]) Create control to perform SLD selections on WMS layers, r=ahocevar (closes #2570)

  Changed 3 years ago by bartvde

Thanks Andreas, your incremental patch makes things perfect! Do you have any news on the 2 Geoserver issues (DWithin issue and proxy error issue on circle selection)?

  Changed 3 years ago by ahocevar

The DWithin issue is already fixed and should be deployed to demo.opengeo.org soon. I did not get a proxy error though when I tried circle selection.

  Changed 3 years ago by bartvde

The proxy error is only in Firefox, it seems the GET string is getting too long for the Apache on demo.opengeo.org to handle?

Proxy Error

The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request GET /geoserver/wms.

Reason: Error reading from remote server

Apache/2.2.3 (CentOS) Server at demo.opengeo.org Port 80

  Changed 3 years ago by ahocevar

Ok, that sounds like an explanation. Indeed it works against my local GeoServer. Layer.WMS.Post still uses GET by default in Mozilla, Firefox and Opera. In Firefox, an IFrame layer will cause the page to flicker when panning the map, and in Opera, transparency does not work. The proxy or Apache cannot be blamed - if the URL gets too long, we are beyond the spec. A workaround would be to reduce the number of edges of the RegularPolygon handler in the example.

  Changed 3 years ago by bartvde

Good suggestion, done, see r10293

Changed 3 years ago by ahocevar

  Changed 3 years ago by ahocevar

  • status changed from closed to reopened
  • state changed from Complete to Review
  • resolution fixed deleted

Bart, can you please have a look at the above patch? The scope was wrong in my previous patch.

  Changed 3 years ago by bartvde

  • state changed from Review to Commit

Right, I had missed that, patch looks good, please commit.

  Changed 3 years ago by ahocevar

  • status changed from reopened to closed
  • state changed from Commit to Complete
  • resolution set to fixed

(In [10294]) fixed scope inside handler. r=bartvde (closes #2570)

Changed 3 years ago by fredj

  Changed 3 years ago by fredj

  • status changed from closed to reopened
  • state changed from Complete to Review
  • resolution fixed deleted

Bart, a small patch that add missing semicolons and use the filter variable in createSLD()

  Changed 3 years ago by bartvde

  • state changed from Review to Commit

thanks fredj, looks good, please commit.

  Changed 3 years ago by fredj

  • status changed from reopened to closed
  • state changed from Commit to Complete
  • resolution set to fixed

(In [10296]) add missing semicolons, use the filter variable in createSLD(). r=bartvde (closes #2570)

Note: See TracTickets for help on using tickets.