Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qgis provider in searchBox don't work #508

Closed
naub1n opened this issue Nov 30, 2023 · 3 comments
Closed

qgis provider in searchBox don't work #508

naub1n opened this issue Nov 30, 2023 · 3 comments

Comments

@naub1n
Copy link

naub1n commented Nov 30, 2023

Hi,

qwc-map-viewer-demo:v2023.11.22 (idem with latest pulled today)
qwc-feature-info-service:latest (pulled today)

When I try to search layer whith qgis provider, there is no data in searchBox.

My themesConfig:

"searchProviders": [
    "nominatim",
    {
        "provider": "qgis",
        "params": {
          "title": "test",
          "resultTitle": "Test",
          "expression": {
            "Sous-bassins": "\"COMI_TER\" ILIKE '%$TEXT$%'"
          }
        }
    }
]

I can see the request to FeatureInfo service and this is the result:

<GetFeatureInfoResponse>
<Layer name="Sous-bassins" layername="Sous-bassins" layerinfo="Sous-bassins" displayfield="COMI_TER">
<Feature id="1">
<HtmlContent inline="1">
<table class="attribute-list"> <tbody> <tr> <td class="identify-attr-title wrap"> <i>id</i> </td> <td class="identify-attr-value wrap"> 1 </td> </tr> <tr> <td class="identify-attr-title wrap"> <i>OBJECTID</i> </td> <td class="identify-attr-value wrap"> 1 </td> </tr> <tr> <td class="identify-attr-title wrap"> <i>FID_COMITE</i> </td> <td class="identify-attr-value wrap"> 0 </td> </tr> <tr> <td class="identify-attr-title wrap"> <i>COMI_TER</i> </td> <td class="identify-attr-value wrap"> Rivières d&#x27;Ile-de-France </td> </tr> <tr> <td class="identify-attr-title wrap"> <i>SHAPE.AREA</i> </td> <td class="identify-attr-value wrap"> 13050836083.1511 </td> </tr> <tr> <td class="identify-attr-title wrap"> <i>SHAPE.LEN</i> </td> <td class="identify-attr-value wrap"> 809246.680936491 </td> </tr> </tbody> </table>
</HtmlContent>
<Attribute name="id" value="1" attrname="id"/>
<Attribute name="OBJECTID" value="1" attrname="OBJECTID"/>
<Attribute name="FID_COMITE" value="0" attrname="FID_COMITE"/>
<Attribute name="COMI_TER" value="Rivières d'Ile-de-France" attrname="COMI_TER"/>
<Attribute name="SHAPE.AREA" value="13050836083.1511" attrname="SHAPE.AREA"/>
<Attribute name="SHAPE.LEN" value="809246.680936491" attrname="SHAPE.LEN"/>
</Feature>
<Feature id="4">
<HtmlContent inline="1">
<table class="attribute-list"> <tbody> <tr> <td class="identify-attr-title wrap"> <i>id</i> </td> <td class="identify-attr-value wrap"> 4 </td> </tr> <tr> <td class="identify-attr-title wrap"> <i>OBJECTID</i> </td> <td class="identify-attr-value wrap"> 4 </td> </tr> <tr> <td class="identify-attr-title wrap"> <i>FID_COMITE</i> </td> <td class="identify-attr-value wrap"> 3 </td> </tr> <tr> <td class="identify-attr-title wrap"> <i>COMI_TER</i> </td> <td class="identify-attr-value wrap"> Rivières de Basse-Normandie </td> </tr> <tr> <td class="identify-attr-title wrap"> <i>SHAPE.AREA</i> </td> <td class="identify-attr-value wrap"> 14205301070.1776 </td> </tr> <tr> <td class="identify-attr-title wrap"> <i>SHAPE.LEN</i> </td> <td class="identify-attr-value wrap"> 955203.622223173 </td> </tr> </tbody> </table>
</HtmlContent>
<Attribute name="id" value="4" attrname="id"/>
<Attribute name="OBJECTID" value="4" attrname="OBJECTID"/>
<Attribute name="FID_COMITE" value="3" attrname="FID_COMITE"/>
<Attribute name="COMI_TER" value="Rivières de Basse-Normandie" attrname="COMI_TER"/>
<Attribute name="SHAPE.AREA" value="14205301070.1776" attrname="SHAPE.AREA"/>
<Attribute name="SHAPE.LEN" value="955203.622223173" attrname="SHAPE.LEN"/>
</Feature>
</Layer>
</GetFeatureInfoResponse>

When I try to debug code in SearchProvider.js, axios.get(...) always use callback function in catch().
Where is the error ??

@manisandro
Copy link
Member

manisandro commented Nov 30, 2023

Not sure that is the issue, but one thing I see is that your response does not contain any geometry. Make sure you have configured your QGIS project to return geometries in FeatureInfo responses.

@naub1n
Copy link
Author

naub1n commented Dec 1, 2023

Ah Ok !!

I activate this parameter in my project:

image

And it work !!

It's possible to add this requirement in Search documentation?

Thx !!

@manisandro
Copy link
Member

Sure, I've added a note to https://qwc-services.github.io/topics/Search/#configuring-the-qgis-feature-search

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants