<div dir="ltr">Thanks Steve. Yes, ows_geomtype=Geometry does the trick!<div><br></div><div>You're right -- it seems with layer TYPE=polygon, the OGR output is coerced to a Polygon rather than MultiPolygon for this case:<div><div><a href="https://github.com/mapserver/mapserver/blob/2c1e5c50791cac205cfbeed0e1fa98bb421f5c5c/mapogroutput.c#L908-L923">https://github.com/mapserver/mapserver/blob/2c1e5c50791cac205cfbeed0e1fa98bb421f5c5c/mapogroutput.c#L908-L923</a><br></div><div><br></div><div>My mental model was that the METADATA block only gave hints to what should be reported in GetCapabilities requests.</div><div><br></div><div>Thanks again,</div><div>Pete<br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jan 8, 2018 at 12:07 PM, Lime, Steve D (MNIT) <span dir="ltr"><<a href="mailto:steve.lime@state.mn.us" target="_blank">steve.lime@state.mn.us</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div lang="EN-US">
<div class="gmail-m_1817071051639703834WordSection1">
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">Hi Peter: Adding the following metadata to the layer returns a multipolygon for me:<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"> METADATA<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"> "ows_geomtype" "Geometry"<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"> END<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">Without specific direction on geometry type it may be that MapServer is capitalizing on the layer type or something like that.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">Steve<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span style="font-size:11pt;font-family:Calibri,sans-serif">From:</span></b><span style="font-size:11pt;font-family:Calibri,sans-serif"> mapserver-users [mailto:<a href="mailto:mapserver-users-bounces@lists.osgeo.org" target="_blank">mapserver-users-<wbr>bounces@lists.osgeo.org</a>]
<b>On Behalf Of </b>Peter Schmitt<br>
<b>Sent:</b> Friday, January 05, 2018 12:09 PM<br>
<b>To:</b> <a href="mailto:mapserver-users@lists.osgeo.org" target="_blank">mapserver-users@lists.osgeo.<wbr>org</a><br>
<b>Subject:</b> [mapserver-users] MultiPolygon layer requested as GeoJSON is returned as Polygon<u></u><u></u></span></p><div><div class="gmail-h5">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">Hi,<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">I have a layer with one MultiPolygon feature. I issue a request for the layer as GeoJSON, like so:<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">curl "<a href="http://localhost/mapserv?MAP=/usr/src/mapfiles/busted.map&service=WFS&VERSION=1.1.0&REQUEST=getfeature&typename=should_be_multi&OUTPUTFORMAT=geojson" target="_blank">http://localhost/mapserv?MAP=<wbr>/usr/src/mapfiles/busted.map&<wbr>service=WFS&VERSION=1.1.0&<wbr>REQUEST=getfeature&typename=<wbr>should_be_multi&OUTPUTFORMAT=<wbr>geojson</a>"<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">In response, I get a single feature, but it has been converted to a Polygon.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<div>
<p class="MsoNormal">{<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> "type": "FeatureCollection", "name": "should_be_multi", "features": [<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> { "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": ... } }<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> ]<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">}<u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">The returned polygon has interior rings, one of which should actually be a separate polygon with its own interior rings. I think this is wrong and the geometry type returned by MapServer should be MultiPolygon. Can anyone help me understand
what is going on?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Here's the feature as a MultiPolygon I expected to receive:<u></u><u></u></p>
</div>
<div>
<div>
<p class="MsoNormal"><a href="http://bl.ocks.org/d/640884687326af5d123a5fc761884e3d" target="_blank">http://bl.ocks.org/d/<wbr>640884687326af5d123a5fc761884e<wbr>3d</a><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><a href="http://bl.ocks.org/d/640884687326af5d123a5fc761884e3d/map.geojson" target="_blank">http://bl.ocks.org/d/<wbr>640884687326af5d123a5fc761884e<wbr>3d/map.geojson</a><u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Here's my MAP file:<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><a href="https://gist.github.com/pedros007/f685d8d336c77aff4cc56673b85f6672" target="_blank">https://gist.github.com/<wbr>pedros007/<wbr>f685d8d336c77aff4cc56673b85f66<wbr>72</a><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Thanks,<u></u><u></u></p>
<div>
<p class="MsoNormal">Pete<u></u><u></u></p>
</div>
</div>
</div>
</div></div></div>
</div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Pete</div>
</div></div></div></div></div>