Ticket #1225 (closed feature: fixed)

Opened 5 years ago

Last modified 5 years ago

WFS Layer doesn't support custom Format like KML

Reported by: rdewit Owned by: tschaub
Priority: minor Milestone: 2.6 Release
Component: Layer.WFS Version: 2.5
Keywords: Cc:
State: Complete

Description

It would be nice if one can feed a WFS layer with a different format than GML (KML for example). A GML layer can do this already. The attached patch allows for this in WFS too.

Attachments

patch_wfs_custom_format.diff Download (1.4 KB) - added by rdewit 5 years ago.

Change History

Changed 5 years ago by rdewit

Changed 5 years ago by ahocevar

Maybe a stupid question, but where do Web Feature Services return anything different than a GML FeatureCollection? Feature Servers that return GeoJSON or KML are no WFS, or am I wrong here?

Changed 5 years ago by crschmidt

You're wrong :)

WFS spec allows for format= parameter just like WMS -- but more importantly than whether this is the case or not is that the "Layer.WFS" is not really about WFS at all, but about requesting data with a bbox in the URL, in the same way that Layer.GML is not really about GML but about requesting a single file and then displaying it as a vector layer.

Changed 5 years ago by ahocevar

Thanks Chris for clarifying this, obviously it's been a while since I was dealing with WFS and GML specs. Now Roald's patch makes perfect sense for me.

Changed 5 years ago by tschaub

  • state changed from Review to Needs More Work

rdewit, thanks for the patch. This is how I've done this previously as well - because it's easy. But really, we should try to be a bit more efficient. Instead of creating a new format instance on each requestSuccess, we should at least be creating just a single instance on the tile and using that with each request. If we were dealing with multiple tiles, it would make the most sense to put the instance on the layer. Even though we are only dealing with a single "tile," I still think it makes sense to put the instance on the layer. Then, requestSuccess would do something like layer.parser.read.

What do you think? If you do put it on the layer, a test would be pretty simple to include as well.

Changed 5 years ago by crschmidt

  • status changed from new to closed
  • state changed from Needs More Work to Complete
  • resolution set to fixed

(In [5828]) Add support for reprojection of vector formats when loading data. This allows for the definition of a 'projection' option on a layer. IF this projection object exists, it will be used to create the format's internal/external projection options, making it such that any data loaded will be reprojected to the map's projection automatically. r=pagameba (Closes #1273, #1225, #1269)

Note: See TracTickets for help on using tickets.