Using MySQL GeoSpatial Data Types in .NET.

I'm looking for information on how to use MySQL geometry types in .NET. I'm using Sub-sonic for ORM and don't need much more support than MySQL POINT.

It looks like the MySQL.NET connector is returning point data as a byte [] array in OpenGIS WKB format.

  • What libraries are recommended for working with this WKB format?

  • Alternatively, since I only need Point support, examples for converting WKB to / from a .NET type would probably suffice.

  • Assuming I can find (or build) a class that can handle the Point datatype, how much trouble will I have with Sub-sonic (v3) to work with it?

+2


source to share


1 answer


Have a look at OpenSource GeoAPI.Net - http://geoapi.codeplex.com

It has .NET classes for all geometry types and a range of tools for converting them from other types such as WKB. Look at the source code for version 2.11a src> GeoAPI> IO> WellKnownBinary. There are readers / writers / parsers, etc.



GeoAPI.Net is used in a number of projects such as http://sharpmap.codeplex.com which have more complex spatial operations using GeoAPI.Net types, http://code.google.com/p/nettopologysuite/ also uses these classes, so you will have a wide range of powerful operations to use in classes when needed.

I don't know anything about Sub-sonic, but since the Point / interface classes are pretty standardized by .NET, I don't understand why this might cause any problems. You can always look at the source online for verification.

+1


source







All Articles