Feature request #6586
Allow qgis to understand and use a GML response from A GetFeatureInfo text/gml request
Status: | Open | ||
---|---|---|---|
Priority: | Normal | ||
Assignee: | - | ||
Category: | Web Services clients/WMS | ||
Pull Request or Patch supplied: | No | Resolution: | |
Easy fix?: | No | Copied to github as #: | 15777 |
Description
QGIS desktop actually when do an Identify on a WMS LAyer will do a requets GetFeatureInfo of text/html type.
But every wms server is capable to give also a response of GML type.
Also the MapServer has the capability to send the GML and it is on a MultiPart response.
To have this is necessary that the qgis send a request GetFeatureInfo with format type = text/gml.
Also is need that qgis should be capable to understand the multipart response of mapserver . Extract from it the XSD to understand the structure of the GML and after extract also from the response the second part (the real GML data).
After this qgis should be capable to parse the GML and extract the geometry and attributes from it to allow the user to use profittably this informations.
As example to copy/paste the geometry on another local layer.
So A really interesting enhancement should be to
put the qgis desktop capable to do a GetFeatureInfo of text/gml type from a MapServer, and when it was response, parse it to understand all the geometries and attributes in the gml (the gml response could have more records and so more geometries).
Give to the user the capability to add all of it (geometries + attributes for each records in the GML) into a memory layer .
This will allow an user to use it directly or copy/paste each of this geometries on another local layer.
History
#1 Updated by aperi2007 - about 12 years ago
An example of a response GML from a Mapserver is this:
#2 Updated by Radim Blazek about 12 years ago
Copy/paste for vectors is currently using selected features, not a result of identify. Too keep it consistent, the same feature for WMS (rasters in general) should also use selected features.
What do you mean exactly by "Give to the user the capability to add all of it (geometries + attributes for each records in the GML) into a memory layer."? How it should work from user/GUI point of view?
#3 Updated by aperi2007 - about 12 years ago
What do you mean exactly by "Give to the user the capability to add all of it (geometries + attributes for each records
in the GML) into a memory layer."? How it should work from user/GUI point of view?
I mean that when an user do a click for identify the qgis will send always the text/html request.
I understand that it cannot send two request.
So the user should necessarily choose to send a text/htl request OR a text/gml request.
If the user choose for the text/gml request.
What can do the QGIS with it response ?
I guess the first immediate use is show the alphanumeric values in a windows and use the geometry to draw a red geometric on the canvas. Exactly as do an identify on a shapefile.
But as I understand this is a really difficult operation.
So is not possible to have this.
Also another use that an user could do of this text/gml response is to use it copy/paste the geometry and attributes on another layer available on the canvas.
This as the mainly use of this feature (retrieve the GML with a text/gml GetFeatureInfo request).
So I guess a good solution to allow both this uses is to put the geometry and attributes of all records from a Response to a text/gml request on a memory layer.
The retrieve of a geometry from a WMS is surely an important operation so I guess the user want to use that geometry.
And also the user could need to read the attributes.
So i guess the best solution to use both is put them on a memory layer and allow the user to I guess the best use of it is use it to add a memory layer on the canvas.
So the user can
#4 Updated by Radim Blazek about 12 years ago
aperi2007 - wrote:
I guess the first immediate use is show the alphanumeric values in a windows and use the geometry to draw a red geometric on the canvas. Exactly as do an identify on a shapefile.
But as I understand this is a really difficult operation.So is not possible to have this.
It is possible. Raster identify API was recently generalized to support various formats. It has to be implemented in WMS provider and identify tool.
Also another use that an user could do of this text/gml response is to use it copy/paste the geometry and attributes on another layer available on the canvas.
This as the mainly use of this feature (retrieve the GML with a text/gml GetFeatureInfo request).
So I guess a good solution to allow both this uses is to put the geometry and attributes of all records from a Response to a text/gml request on a memory layer.
I think that raster layer API has to be extended to support vector features like current select, getNextFeature etc. but in the new threading version. Any hack with a temporary layer would not be clean solution. In fact, I don't have any idea how it could be implemented to be user friendly and do not mess up source code too much.
#5 Updated by aperi2007 - about 12 years ago
I think that raster layer API has to be extended to support vector features like current select, getNextFeature etc.
but in the new threading version. Any hack with a temporary layer would not be clean solution. In fact, I don't have
any idea how it could be implemented to be user friendly and do not mess up source code too much.
What do you think when speak of an hack for temporary layer ?
I don't see any other solution to allow an user to use as he need and want a geometry returned from a remote request.
I don't know the raster API, but I guess that it cannot give any help to allow an user to use the geometry where he need.
Can you explain better ?
Thx.
#6 Updated by Radim Blazek about 12 years ago
aperi2007 - wrote:
What do you think when speak of an hack for temporary layer ?
Still I don't know what do you mean exactly by use of temporary layer. Should a new vector layer be added to legend? Should it be hidden and kept by raster layer? I can only imagine sort of such a hack. It would be more work than to add QgsFeatureIterator select() to raster provider.
I don't see any other solution to allow an user to use as he need and want a geometry returned from a remote request.
I don't know the raster API, but I guess that it cannot give any help to allow an user to use the geometry where he need.
Form user point of view there would be no difference between raster and vector layer for identify and select tools. Only the select tool would be probably limited to point and rectangle. The identify tool would highlight the geometry in canvas and show feature attributes in pop up window. The select tool would highlight selected features and those features could be copied to clipboard.
#7 Updated by aperi2007 - about 12 years ago
Ok, perhaps I understand the misunderstanding.
Usually who work on a GIS world, don't need only see the data on a map, but often need to use them to
create a new vector data.
I understand that for who don't work on GIS the main method to create a new dataset is to trace out from a base raster .
But this in never used when the need is to give main quality.
The main method we use to create a derivative dataset
is to copy a geometry from a base dataset and past it on the derivative dataset.
After this, the user clip, intersect, move what need to do to adjust the nodes, and so on.
Perhaps in qgis world this is to with a select geometry and copy/paste.
But because the wms is mainly a raster layer.
The only solution to get a geometry from it is to do a GetFeatureInfo from it and ask for a text/gml.
Otherwise why the OGC give this option ?
So the best solution is put the result of the text/gml kinf of GetFeatureInfo on a memory layer.
This give to the user the choice to copy/paste it where it want to copy,
or also save it a a shapefile if it like to do this.
#8 Updated by Radim Blazek about 12 years ago
aperi2007 - wrote:
The main method we use to create a derivative dataset
is to copy a geometry from a base dataset and past it on the derivative dataset.
I am suggesting that WMS raster layer will work like any vector 'base' dataset with select tool.
But because the wms is mainly a raster layer.
Yes, I am suggesting to add a piece of vector functionality to WMS, it would become sort of hybrid.
The only solution to get a geometry from it is to do a GetFeatureInfo from it and ask for a text/gml.
Yes, GetFeatureInfo request would be used by select tool.
So the best solution is put the result of the text/gml kinf of GetFeatureInfo on a memory layer.
I believe that temporary layer is not necessary if we add the necessary functionality of vector layer to WMS layer.
This give to the user the choice to copy/paste it where it want to copy,
that will be possible
or also save it a a shapefile if it like to do this.
if this is necessary, it should be implemented as "Paste as new (layer)" to get a standard feature available for all vector layers, not only WMS.
#9 Updated by Giovanni Manghi over 7 years ago
- Easy fix? set to No