Implement spatial data types
See original GitHub issueImplement support for spatial data types: GEOMETRY
, POINT
, LINESTRING
, POLYGON
, MULTIPOINT
, MULTILINESTRING
, MULTIPOLYGON
, GEOMETRYCOLLECTION
.
http://dev.mysql.com/doc/refman/5.7/en/spatial-datatypes.html
Required for #4.
Issue Analytics
- State:
- Created 7 years ago
- Comments:18 (13 by maintainers)
Top Results From Across the Web
Spatial Data Types Overview - SQL Server
There are two types of spatial data. The geometry data type supports planar, or Euclidean (flat-earth), data. The geometry data type both ...
Read more >Spatial types in databases—ArcGIS Pro | Documentation
Spatial data types store the spatial attributes that allow you to visualize data on a map. Many databases automatically include spatial data types....
Read more >What are spatial types?—ArcMap | Documentation
Spatial types are data types that store geometry data. All the spatial information is stored in the spatial column; there are no side...
Read more >MySQL 8.0 Reference Manual :: 11.4 Spatial Data Types
Following the OGC specification, MySQL implements spatial extensions as a subset of the SQL with Geometry Types environment. This term refers to an...
Read more >Geospatial Data Types and How You Can Use Them
9 geospatial data types: ways of representing places, people, and things on Earth · 1. Points of Interest · 2. Property · 3....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’ve read through MySqlGeometry a few times, and it seems very unfinished. The
GEOMETRY
type is supposed to be able to holdPOINT
,LINESTRING
, orPOLYGON
, but from reading the source, it appears to me thatMySqlGeometry
only supports insertingPOINT
.I can’t find anything about
MULTIPOINT
,MULTILINESTRING
,MULTIPOLYGON
, orGEOMETRYCOLLECTION
in Connector/NET..NET Core has no
System.Data.Spatial
namespace as of yet. Other versions of .NET have System.Data.Spatial.DbGeography, and it is probably tailored to work with SQL Server, which supports all of MySQL’s spatial types and more.EF Core has an open issue (https://github.com/aspnet/EntityFramework/issues/1100) to add Spatial support, which will likely come with DB-agnostic spatial abstractions. The most useful approach to programmers would likely be a library outside of this one that implements these forthcoming DB-agnostic spatial abstractions for MySQL.
I ran a query through BigQuery’s Sample GitHub Content representing 10% of public content on GitHub, searching for
MySqlGeometry
. Only 2 repos showed up, Connector/NET and another which looks like it no longer even uses it.My recommendation is that we remove the 1.0 tag and put this on the backlog. Once .NET core has spatial abstractions, we can either accept a contribution for it, or document a third-party library that supports it well if one emerges.
We should still add support for the spatial types as binary objects, and let callers cast from binary on Read and to binary before Write.
Here is what I used for EF 6, .Net Core 6:
Then in my model builder:
My Model: