[MapServer-users] FlatGeobuf as output format
Benedek Petrovicz
benedek.petrovicz at gmail.com
Thu Jun 22 01:17:22 PDT 2023
I'm not trying to create any fgb-s, but MapServer is.
And the issue is with MultiPolygons, so converting everything to that type
doesn't help.
The data source is not fgb. It can be anything.
It is an MSSQL DB in my instance.
Btw, converting the same dataset to fgb manually with ogr2ogr does work,
and it doesn't require any extra parameters.
Isn't MapServer using ogr2ogr functionality for OGR based OUTPUTFORMATs?
I feel like it could handle it, but just hangs up because it sees
MultiPolygon when checking the type.
On Wed, Jun 21, 2023 at 6:43 PM Scott <public at postholer.com> wrote:
> I'm not sure how you're creating your fgb's, but from an ogr2ogr context
> try promoting all geoms to multi:
>
> -nlt PROMOTE_TO_MULTI
>
> On 6/21/23 07:50, Benedek Petrovicz wrote:
> > Hi!
> >
> > I'm trying to integrate OGR's FlatGeobuf driver as an output format in
> > my mapfiles.
> > It works for the most part and it's awesome, but it fails immediately
> > when I feed some MultiPolygons into it.
> >
> > The geometries are queried from an MSSQL DB.
> >
> > I get the following error:
> > msOGRWriteShape(): OGR error. Attempt to write feature failed (code=6):
> > ICreateFeature: Mismatched geometry type msCalculateScale(): General
> > error message. Invalid image width or height.
> >
> > I found a little note in the docs which corresponds with this issue
> > (https://mapserver.org/input/vector/ogr.html
> > <https://mapserver.org/input/vector/ogr.html>):
> > /"Even though MapInfo and other OGR data sources may support layers with
> > mixed geometry types (e.g. points, lines and polygons in the same file)
> > this is not yet supported in MapServer. So you still have to define a
> > layer ‘TYPE’ and make sure that all the shapes in the OGR data source
> > are compatible with that layer type, otherwise MapServer may produce an
> > error about incompatible geometry types at runtime."/
> > /
> > /
> > So it fails for me when I have Polygons and MultiPolygons in the table
> > I'm querying.
> > But it also fails if it includes MultiPolygons only. So with no mixing
> > of types.
> >
> > I'm using the POLYGON type for my layer in the mapfile.
> >
> > The same dataset works fine when I'm using the GML2 output format. Even
> > with mixing Polygons and MultiPolygons.
> >
> > Am I doing something wrong here?
> > Is it a known limitation for MultiPolygons?
> > Is there a way to bypass the issue while retaining the geometries in the
> DB?
> >
> > Thank you
> > Petrovicz
> >
> > _______________________________________________
> > MapServer-users mailing list
> > MapServer-users at lists.osgeo.org
> > https://lists.osgeo.org/mailman/listinfo/mapserver-users
> _______________________________________________
> MapServer-users mailing list
> MapServer-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20230622/978804f7/attachment.htm>
More information about the MapServer-users
mailing list