[mapserver-users] WFS changing NULL values to 0.

Rahkonen Jukka (MML) jukka.rahkonen at maanmittauslaitos.fi
Mon Aug 2 08:16:22 PDT 2021


Hi,

Attributes of type double can not really be nulls in shapefile. See https://desktop.arcgis.com/en/arcmap/latest/manage-data/shapefiles/geoprocessing-considerations-for-shapefile-output.htm#GUID-A10ADA3B-0988-4AB1-9EBA-AD704F77B4A2. A value -1.7976931348623158e+308 might work as a null but I do not consider it generally reliable. Use some other format as a datasource.

-Jukka Rahkonen-

Lähettäjä: mapserver-users <mapserver-users-bounces at lists.osgeo.org> Puolesta Marcin Grudzien
Lähetetty: maanantai 2. elokuuta 2021 15.07
Vastaanottaja: mapserver-users at lists.osgeo.org
Aihe: [mapserver-users] WFS changing NULL values to 0.

Hi,

I am publishing an SHP file via the WFS service using Mapserver 7.2.2

In some cases, attributes of a type double have NULL values in the SHP. In such cases, MapServer is publishing them as "0" in GetFeature responses which may be confusing to the data users. I would like to achieve a situation that if the attribute value is NULLin SHP, the attribute is not published in GetFeature response.

For example the response instead of this
<wfs:member>
<ms:Bazowa_pozioma>
<ms:msGeometry>
<gml:Point gml:id=".1" srsName="urn:ogc:def:crs:EPSG::2180">
<gml:pos>419591.224000 697399.714000</gml:pos>
</gml:Point>
</ms:msGeometry>
<ms:NR_PUNKTU>284301500</ms:NR_PUNKTU>
<ms:X1992>419591.224</ms:X1992>
<ms:Y1992>697399.714</ms:Y1992>
<ms:H_PLKRON86>0</ms:H_PLKRON86>
<ms:MH_PLKRON8>0</ms:MH_PLKRON8>
</ms:Bazowa_pozioma>
</wfs:member>

Should look like this
<wfs:member>
<ms:Bazowa_pozioma>
<ms:msGeometry>
<gml:Point gml:id=".1" srsName="urn:ogc:def:crs:EPSG::2180">
<gml:pos>419591.224000 697399.714000</gml:pos>
</gml:Point>
</ms:msGeometry>
<ms:NR_PUNKTU>284301500</ms:NR_PUNKTU>
<ms:X1992>419591.224</ms:X1992>
<ms:Y1992>697399.714</ms:Y1992>
</ms:Bazowa_pozioma>
</wfs:member>

Can it be achieved in MapServer?

Best regards,
Marcin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20210802/bbe24cf0/attachment.htm>


More information about the MapServer-users mailing list