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

Searching for a number with a zero value #850

Open
mbarto opened this issue Feb 18, 2021 · 0 comments
Open

Searching for a number with a zero value #850

mbarto opened this issue Feb 18, 2021 · 0 comments

Comments

@mbarto
Copy link
Contributor

mbarto commented Feb 18, 2021

Issue from document: "Segnalazioni_DECSIRAv2_v4.docx" sent by client on 18/02/2021, point 7.

https://drive.google.com/file/d/1IAi8MRvdPCoVZ_Z9fO3cFuAkWyGi1qfQ/view?usp=sharing

When searching using a filter on a numeric value using zero (=0, >0, >=0, etc.), the result is not correct, because this filter is not correctly add to the query payload (count is correct, instead).

Example. You can use "Impianti depurazione":

  • Codice Sira stabilimento = 17191
  • Capacità Organica di progetto >= 0

image

The result count is 0 (zero), but in the list the data is shown (the record having NULL in "Capacità Organica di progetto"

image

In the calls detail, you can see that:

  • you have the correct filter in the count query:
<?xml version="1.0"?>
<wfs:GetPropertyValue xmlns:wfs="http://www.opengis.net/wfs/2.0" xmlns:fes="http://www.opengis.net/fes/2.0" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" valueReference="decsiraogc_stabilimenti:idStato" service="WFS" version="2.0" xsi:schemaLocation="http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/wfs/2.0/wfs.xsd http://www.opengis.net/gml/3.2 http://schemas.opengis.net/gml/3.2.1/gml.xsd">
  <wfs:Query typeNames="decsiraogc_stabilimenti:ImpiantoDiDepurazione" srsName="EPSG:4326">
    <fes:Filter>
      <fes:And>
        <fes:PropertyIsEqualTo>
          <fes:ValueReference>decsiraogc_stabilimenti:codiceSira</fes:ValueReference>
          <fes:Literal>17191</fes:Literal>
        </fes:PropertyIsEqualTo>
        <fes:PropertyIsGreaterThanOrEqualTo>
         <fes:ValueReference>decsiraogc_stabilimenti:capacitaOrganicaProgetto</fes:ValueReference>
          <fes:Literal>0</fes:Literal>
        </fes:PropertyIsGreaterThanOrEqualTo>
      </fes:And>
    </fes:Filter>
  </wfs:Query>
</wfs:GetPropertyValue>

In the extraction query instead, the filter is not present:

<?xml version="1.0"?>
<wfs:GetFeature xmlns:wfs="http://www.opengis.net/wfs/2.0" xmlns:fes="http://www.opengis.net/fes/2.0" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" startIndex="0" count="20" service="WFS" version="2.0" xsi:schemaLocation="http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/wfs/2.0/wfs.xsd http://www.opengis.net/gml/3.2 http://schemas.opengis.net/gml/3.2.1/gml.xsd">
  <wfs:Query typeNames="decsiraogc_stabilimenti:ImpiantoDiDepurazione" srsName="EPSG:4326">
    <fes:Filter>
      <fes:And>
        <fes:PropertyIsEqualTo>
          <fes:ValueReference>decsiraogc_stabilimenti:codiceSira</fes:ValueReference>
          <fes:Literal>17191</fes:Literal>
        </fes:PropertyIsEqualTo>
      </fes:And>
    </fes:Filter>
  </wfs:Query>
</wfs:GetFeature>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants