MultiPolygon layer requested as GeoJSON is returned as Polygon

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

MultiPolygon layer requested as GeoJSON is returned as Polygon

Peter Schmitt
Hi,

I have a layer with one MultiPolygon feature.  I issue a request for the layer as GeoJSON, like so:


In response, I get a single feature, but it has been converted to a Polygon.

{
   "type": "FeatureCollection", "name": "should_be_multi", "features": [
      { "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": ... } }
   ]
}

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?

Here's the feature as a MultiPolygon I expected to receive:

Here's my MAP file:

Thanks,
Pete

_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users
Reply | Threaded
Open this post in threaded view
|

Re: MultiPolygon layer requested as GeoJSON is returned as Polygon

Lime, Steve D (MNIT)

Hi Peter: Adding the following metadata to the layer returns a multipolygon for me:

 

        METADATA

            "ows_geomtype"  "Geometry"

        END

 

Without specific direction on geometry type it may be that MapServer is capitalizing on the layer type or something like that.

 

Steve

 

From: mapserver-users [mailto:[hidden email]] On Behalf Of Peter Schmitt
Sent: Friday, January 05, 2018 12:09 PM
To: [hidden email]
Subject: [mapserver-users] MultiPolygon layer requested as GeoJSON is returned as Polygon

 

Hi,

 

I have a layer with one MultiPolygon feature.  I issue a request for the layer as GeoJSON, like so:

 

 

In response, I get a single feature, but it has been converted to a Polygon.

 

{

   "type": "FeatureCollection", "name": "should_be_multi", "features": [

      { "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": ... } }

   ]

}

 

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?

 

Here's the feature as a MultiPolygon I expected to receive:

 

Here's my MAP file:

 

Thanks,

Pete


_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users
Reply | Threaded
Open this post in threaded view
|

Re: MultiPolygon layer requested as GeoJSON is returned as Polygon

Peter Schmitt
Thanks Steve.  Yes, ows_geomtype=Geometry does the trick!

You're right -- it seems with layer TYPE=polygon, the OGR output is coerced to a Polygon rather than MultiPolygon for this case:

My mental model was that the METADATA block only gave hints to what should be reported in GetCapabilities requests.

Thanks again,
Pete

On Mon, Jan 8, 2018 at 12:07 PM, Lime, Steve D (MNIT) <[hidden email]> wrote:

Hi Peter: Adding the following metadata to the layer returns a multipolygon for me:

 

        METADATA

            "ows_geomtype"  "Geometry"

        END

 

Without specific direction on geometry type it may be that MapServer is capitalizing on the layer type or something like that.

 

Steve

 

From: mapserver-users [mailto:[hidden email]] On Behalf Of Peter Schmitt
Sent: Friday, January 05, 2018 12:09 PM
To: [hidden email]
Subject: [mapserver-users] MultiPolygon layer requested as GeoJSON is returned as Polygon

 

Hi,

 

I have a layer with one MultiPolygon feature.  I issue a request for the layer as GeoJSON, like so:

 

 

In response, I get a single feature, but it has been converted to a Polygon.

 

{

   "type": "FeatureCollection", "name": "should_be_multi", "features": [

      { "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": ... } }

   ]

}

 

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?

 

Here's the feature as a MultiPolygon I expected to receive:

 

Here's my MAP file:

 

Thanks,

Pete




--
Pete

_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users