MariaDB GIS Multipoint field not saving

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for MySQL
Post Reply
Posts: 4
Joined: Wed 14 Apr 2021 21:43

MariaDB GIS Multipoint field not saving

Post by PVHills » Wed 20 Jul 2022 23:16

Hi There,
We're using NetTopologySuite with Devart.Data.MySql.Entity.EfCore.NetTopologySuite 8.19.1905 and against MariaDB 10.3.32. I've discovered that we can load multipoint types into a NetTopologySuite.Geometries.MultiPoint property, but when saving the record, the field is set to NULL.

I've tracked this down to a problem in the NetTopologySuite WKTWriter class, which writes text for multipoints with the MULTIPOINT((1 2),(3 4)) format. The insert query that is emitted uses the ST_GEOMFROMTEXT function, which on this version of mariadb does not appear to allow the inner set of brackets to be used, and requires the format MULTIPOINT(1 2, 3 4) instead. Is there a way that we can override or fix the formatting for this field type? For example by supplying our own implementation of WKTWriter somehow?

With limited knowledge about the problem I'm considering a few workarounds including forking NetTopologySuite or writing a raw entity command for the insert, but would prefer something less hacky

Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: MariaDB GIS Multipoint field not saving

Post by Shalex » Mon 10 Oct 2022 06:15

Thank you for your report. We will investigate the issue and notify you about the result.

Post Reply