MySQL Spatial Data Types
Is your feature request related to a problem? Please describe.
Similar to #166 there are missing spatial types for MySQL.
Describe the solution you'd like
using the geo crate: https://crates.io/crates/geo
- GEOMETRY -> geo::geometry::Geometry
- POINT -> geo::geometry::Point
- LINESTRING -> geo::geometry::LineString
- POLYGON -> geo::geometry::Polygon
- MULTIPOINT -> geo::geometry::MultiPoint
- MULTILINESTRING -> geo::geometry::MultiLineString
- MULTIPOLYGON -> geo::geometry::MultiPolygon
- GEOMETRYCOLLECTION -> geo::geometry::GeometryCollection
And add geo to the feature list in the Cargo.toml
Describe alternatives you've considered
Alternativly geo-types could be used.
Additional context
https://dev.mysql.com/doc/refman/8.1/en/spatial-types.html
I prefer to use geo-types, because geo::geometry::* is a re-export of geo_types::geometry::*.
An additional discussion is whether we need a wrapper structure (or a (Geometry<f64>, i32)) to handle SRID.
AFAIK, geo_types::Geometry and subtypes do not contain SRID. Since MySQL 8.0, MySQL server supports SRID for GEOMETRY types.
If wrapper structure is necessary, I prefer to support both native geo_types::Geometry and the wrapper, like json does.
Since geozero already provides integration with SQLx for PostGIS types, I think this should live there.