Connector/NET supports a MySqlGeometry type, but it doesn't appear to be very well designed:
MySqlGeometry.Value exposes the data for direct manipulation
- The API only seems to support
POINT, not any other kind of Geometry object
- It fails when used with a lot of APIs: bugs 96498, 96499, 96500.
- It's implemented as a
struct when possibly a class would be more appropriate.
This isn't really an issue in practice as it appears to be used very infrequently: #70 (comment)
Because it's not used much, there's little backwards compatibility concern with changing its API. We should introduce a type that's suitable for use with spatial querying layers and that serves to mark a parameter value or returned result as unambiguously being a GEOMETRY value, not any arbitrary byte[].
MySqlDataReader.GetValue should still return byte[] for GEOMETRY columns, but MySqlDataReader.GetMySqlGeometry and GetFieldValue<MySqlGeometry> should be implemented.
Connector/NET supports a
MySqlGeometrytype, but it doesn't appear to be very well designed:MySqlGeometry.Valueexposes the data for direct manipulationPOINT, not any other kind of Geometry objectstructwhen possibly aclasswould be more appropriate.This isn't really an issue in practice as it appears to be used very infrequently: #70 (comment)
Because it's not used much, there's little backwards compatibility concern with changing its API. We should introduce a type that's suitable for use with spatial querying layers and that serves to mark a parameter value or returned result as unambiguously being a
GEOMETRYvalue, not any arbitrarybyte[].MySqlDataReader.GetValueshould still returnbyte[]forGEOMETRYcolumns, butMySqlDataReader.GetMySqlGeometryandGetFieldValue<MySqlGeometry>should be implemented.