null values in GML

Bart van den Eijnden (OSGIS) bartvde at OSGIS.NL
Thu Dec 7 03:21:17 EST 2006


Hi Steve,

if the schema has minOccurs 1, then ofcourse you can't leave out the
element. If possible, the GML application schema should be changed to match
that.

If not possible, there is also something called nillable in XML Schema, so
if nillable is true, you could use:

<PRIORITY xsi:nil="true"></PRIORITY>

But as pointed out on the wfs-dev e-mail list, there are also a few issues
with the nillable solution.

So there is no easy fix ....

Best regards,
Bart

--
Bart van den Eijnden
OSGIS, Open Source GIS
http://www.osgis.nl


--------- Oorspronkelijk bericht --------
Van: Steve Lime <Steve.Lime at dnr.state.mn.us>
Naar: Bart van den Eijnden OSGIS <bartvde at OSGIS.NL>
Cc: MAPSERVER-USERS at lists.umn.edu
Onderwerp: Re: [UMN_MAPSERVER-USERS] null values in GML
Datum: 06/12/06 19:34

> I guess we need a standard definition of NULL for all drivers then since
> I don't believe it's
> the same across the board. A mapserver-dev topic. Since we use char *
> for all attributes
> we could literally use NULL.
> 
> Also, often a schema will require an element, what to do with NULLs in
> that case?
> 
> Steve
> 
> &gt;&gt;&gt; &quot;Bart van den Eijnden (OSGIS)&quot;
&lt;bartvde at osgis.nl&gt; 12/6/2006 1:07:55
> PM &gt;&gt;&gt;
> Hi Steve,
> 
> as I understand from previous discussions on wfs-dev, it would be best
> 
> for Mapserver to leave out the attribute from the GML response in case
> 
> it's null.
> 
> For reference, check the threads named &quot;null values&quot; here:
> 
> http://mail.opengeospatial.org/pipermail/wfs-dev/2006-October/ 
> 
> although they get a bit hard to understand .... at least for me ....
> :-)
> 
> Best regards,
> Bart
> 
> Steve Lime schreef:
> &gt; Mateusz is most likely correct. MapServer extracts attributes and
> &gt; converts when necessary (not very often). If the asterix 
> &gt; always represents NULL then we could represent as something else
> (empty
> &gt; string?) in the DBF code. What does GDAL/OGR
> &gt; do with NULLs in its output?
> &gt;
> &gt; Steve
> &gt;
> &gt;   
> &gt;&gt;&gt;&gt; Mateusz Loskot &lt;mateusz at LOSKOT.NET&gt; 12/6/2006
9:44:29 AM &gt;&gt;&gt;
> &gt;&gt;&gt;&gt;         
> &gt; Bart van den Eijnden (OSGIS) wrote:
> &gt;   
> &gt;&gt; Hi list,
> &gt;&gt;
> &gt;&gt; I have a strange phenomenon.
> &gt;&gt;
> &gt;&gt; A shape attribute table has some null values in it (column type
> &gt;&gt; Real), for instance:
> &gt;&gt;
> &gt;&gt; OGRFeature(nap_speciaal):856 pnt_pntid (String) = 000A2510 .. 
> &gt;&gt; hgt_hgtwd (Real) = (null) .. POINT (122880 487860)
> &gt;&gt;
> &gt;&gt; Using Mapserver WFS I get the following GML output:
> &gt;&gt;
> &gt;&gt; &lt;ms:pnt_pntid&gt;000A2510&lt;/ms:pnt_pntid&gt; .. 
> &gt;&gt; &lt;ms:hgt_hgtwd&gt;************************&lt;/ms:hgt_hgtwd&gt;
..
> &gt;&gt;
> &gt;&gt; Does anybody have an idea what is causing the sequence of
> asterisks?
> &gt;&gt;     
> &gt;
> &gt; Asterix is used to indicate NULL value in Shapefile attribute.
> &gt; I'm completely not sure, but I suppose MS WFS driver does not handle
> &gt; asterix as null but accepts it as a string value and puts into
> output
> &gt; GML.
> &gt;
> &gt; Cheers
> &gt;   
> 
> 
> -- 
> Bart van den Eijnden
> OSGIS, Open Source GIS
> bartvde at osgis.nl 
> http://www.osgis.nl 
> 
> 
> 



More information about the mapserver-users mailing list