Hello.
Is there a way to utilize geo spatial support in dotConnect for MySql. Namely POINT data type?
Spatial Point type support
-
- Devart Team
- Posts: 2420
- Joined: Wed 02 Nov 2011 09:44
Re: Spatial Point type support
dotConnect for MySQL supports spatial data types in ADO.NET only with Well-Known Binary (WKB) Format (as a byte array). For more information, please refer to http://dev.mysql.com/doc/refman/5.1/ja/ ... ormat.html
Entity Framework of versions v5 and v6 support spatial data types. For more information, please refer to http://blog.devart.com/enhanced-entity- ... resql.html
Entity Framework of versions v5 and v6 support spatial data types. For more information, please refer to http://blog.devart.com/enhanced-entity- ... resql.html
-
- Posts: 2
- Joined: Thu 07 Aug 2014 05:28
Re: Spatial Point type support
Thank you.
So, how do I convert lat, lng values into WKB and back?
Is there some kind of OpenGIS .NET library that provides the types serializable in WKB format? Or is there a way to convert System.Device.Location.GeoCoordinate to WKB and back?
So, how do I convert lat, lng values into WKB and back?
Is there some kind of OpenGIS .NET library that provides the types serializable in WKB format? Or is there a way to convert System.Device.Location.GeoCoordinate to WKB and back?
-
- Devart Team
- Posts: 2420
- Joined: Wed 02 Nov 2011 09:44
Re: Spatial Point type support
If you use a column of a spatial type, the data in this column is stored as a set of bytes in a binary format. If you perform a SELECT statement for this column, you will get this binary data. After this you may process this binary data in your application. For example, you may create a custom class that accepts this binary data to its constructor, parse it and assign corresponding values for the fields. Then you may work with this class, and after this convert data back to the binary format and store it to the database table.Michael Logutov wrote:So, how do I convert lat, lng values into WKB and back?
You can also get the necessary fields with a query using the functions, creating geometry values using WKB. The list of such functions you can find in the MySQL documentation http://dev.mysql.com/doc/refman/4.1/en/ ... tions.html
For example, suppose you have the following table:
SQL script:
Code: Select all
CREATE TABLE semenb.test_point (
t1 point DEFAULT NULL
);
INSERT INTO semenb.test_point(t1)
VALUES(PointFromText('POINT(1 1)'));
Code: Select all
SELECT x(PointFROMWKB(t1)) AS X, y(PointFROMWKB(t1)) AS Y FROM test_point
dotConnect for MySQL does not provide such a feature. Probably there are .NET libraries that provide the types serializable in WKB format, but this question is beyond the scope of our support.Michael Logutov wrote:Is there some kind of OpenGIS .NET library that provides the types serializable in WKB format?
GeoCoordinate class belongs to the System assembly, so please contact the Microsoft support on this question.Michael Logutov wrote:Or is there a way to convert System.Device.Location.GeoCoordinate to WKB and back?