[mapserver-users] GML Invalid exterior ring

Moffatt, Greg Greg.Moffatt at amec.com
Thu Jan 10 10:47:42 PST 2013


My apologies, Jukka.  I had cross posted the problem and not followed up here.

The problem was resolved on the GDAL list.  The GML was generated by SQL Server using the "FOR XML" clause, which tends to produce very verbose XML!

At the request of Even Rouault, I logged a ticket on the issue (#4934), and he addressed it right away.

In the meantime, I stripped the redundant attributes from the XML by casting it to a varchar(max), replacing the namespace attributes with nothing, and then replacing the root tag with one containing the attributes.  Casted that varchar back to XML and voila - everything works again.

Not the most eloquent solution, but it works.

All the best,
Greg


-----Original Message-----
From: Rahkonen Jukka [mailto:Jukka.Rahkonen at mmmtike.fi]
Sent: January-10-13 1:40 PM
To: Moffatt, Greg; mapserver-users at lists.osgeo.org
Subject: Re: GML Invalid exterior ring

Hi,

Looks like this:
http://trac.osgeo.org/gdal/ticket/4934

Thus once MS4W contains GDAL 1.10 is should work again.
By looking at your gml file I think it is generated by Mapserver, not SQL server. Was the attachment correct?

-Jukka Rahkonen-
________________________________________
Moffatt, Greg wrote:

> Hi all,

> I posted this on the ms4w list last week, but I haven't had any response, so please forgive my cross-post.

> I have a GML file that's generated by SQL Server that contains one or more polygons.  It used to work, but since I've upgraded the ms4w installation on my web server, any requests to MapServer for that layer fail with the message: msOGRFileNextShape(): OGR error. Invalid exterior ring.

> An example of the GML is attached, along with a .map file.

I've worked my way back through the ms4w versions, and have found that a change between 3.0.3 and 3.0.4-beta1 may be the culprit:

ms4w 3.0.3 - Works
ms4w 3.0.4-beta1 - Invalid exterior ring
ms4w 3.0.5 - Invalid exterior ring
ms4w 3.0.6 - Invalid exterior ring

GDAL changed from 1.8.1RC2 to 1.9.0 in that step.  I've looked through the GDAL release notes, but nothing is jumping out at me.  Two questions:

1. Do you know of any reason why the GML would fail to draw in recent versions?  Ideally, I'd like to correct my GML or MapServer configuration to get it to work in the latest ms4w version.

2. If there's no solution in #1, would it be feasible to downgrade GDAL/OGR while keeping the remainder of ms4w intact (or would that be asking for trouble)?

A million thanks,
Greg

The information contained in this e-mail is intended only for the individual or entity to whom it is addressed.
Its contents (including any attachments) may contain confidential and/or privileged information.
If you are not an intended recipient you must not use, disclose, disseminate, copy or print its contents.
If you receive this e-mail in error, please notify the sender by reply e-mail and delete and destroy the message.

The information contained in this e-mail is intended only for the individual or entity to whom it is addressed.
Its contents (including any attachments) may contain confidential and/or privileged information.
If you are not an intended recipient you must not use, disclose, disseminate, copy or print its contents.
If you receive this e-mail in error, please notify the sender by reply e-mail and delete and destroy the message.


More information about the mapserver-users mailing list