Opened 18 years ago

Closed 18 years ago

#1847 closed defect (fixed)

bugs in gml writer for multipoints

Reported by: bartvde@… Owned by: mapserverbugs
Priority: high Milestone:
Component: WFS Server Version: 4.8
Severity: normal Keywords:
Cc:

Description

when Mapserver (we use 4.8.3) writes a multipoint, it writes:

<gml:MultiPoint srsName="EPSG:28992">
<gml:Point>
<gml:coordinates>139190.125000,461492.869000</gml:coordinates>
</gml:Point>
</gml:MultiPoint>

This is not correct according to the GML schema, it is missing gml:pointMember
in between.

There are 2 problems in mapgml.c:
1) there is one occurrence where the pointMember is missing, fix would be:

      /* MultiPoint */
      if(srsname_encoded)
        msIO_fprintf(stream, "%s<gml:MultiPoint srsName=\"%s\">\n", tab,
srsname_encoded);
      else
        msIO_fprintf(stream, "%s<gml:MultiPoint>\n", tab);

      for(i=0; i<shape->numlines; i++) {
        for(j=0; j<shape->line[i].numpoints; j++) {
          // bartvde
          msIO_fprintf(stream, "%s<gml:pointMember>\n", tab);
          msIO_fprintf(stream, "%s  <gml:Point>\n", tab);
          msIO_fprintf(stream, "%s   
<gml:coordinates>%f,%f</gml:coordinates>\n", tab, shape->line[i].point[j].x,
shape->line[i].point[j].y);
          msIO_fprintf(stream, "%s  </gml:Point>\n", tab);
          msIO_fprintf(stream, "%s</gml:pointMember>\n", tab);
        }
      }

2) there is one occurrence where it says gml:pointMembers instead of
gml:pointMember!

      msIO_fprintf(stream, "%s    <gml:pointMembers>\n", tab);
      for(i=0; i<shape->numlines; i++) {
        for(j=0; j<shape->line[i].numpoints; j++) {
          msIO_fprintf(stream, "%s      <gml:Point>\n", tab);
          msIO_fprintf(stream, "%s        <gml:pos>%f %f</gml:pos>\n", tab,
shape->line[i].point[j].x, shape->line[i].point[j].y);
          msIO_fprintf(stream, "%s      </gml:Point>\n", tab);
        }
      }
      msIO_fprintf(stream, "%s    </gml:pointMembers>\n", tab);

      msIO_fprintf(stream, "%s  </gml:MultiPoint>\n", tab);

Change History (6)

comment:1 by bartvde@…, 18 years ago

The GML3 part (remark 2) is valid, so this is not a problem. I was not aware of
that GML3 schema change.

comment:2 by dmorissette, 18 years ago

Cc: steve.lime@… added
Adding Steve to CC.

comment:3 by sdlime, 18 years ago

Status: newassigned
Will look tonite.

comment:4 by sdlime, 18 years ago

I committed the missing tag to CVS head for GML 2.1.2 output. bart, can you
verify it is correct there and I will apply to 4.8 branch? (could they make GML
any more verbose!!!)

Steve

comment:5 by bartvde@…, 18 years ago

Steve, I checked the CVS version but you made a little mistake, you miss a / in
the end tag:

msIO_fprintf(stream, "%s  <gml:pointMember>\n", tab);

should be:

msIO_fprintf(stream, "%s  </gml:pointMember>\n", tab);

Other than that it's okay. So please also backport to the 4.8 branch.

comment:6 by sdlime, 18 years ago

Resolution: fixed
Status: assignedclosed
Fixed in cvs head and 4.8...

Steve
Note: See TracTickets for help on using tickets.