I have a database where one field gives spatial coordinates. I have learned the field is a serialised MSDN geometry Data Type (http://msdn.microsoft.com/en-us/library/bb933973.aspx).
I want to access this database from Python and was wandering if anyone knew the format of the Geometry Data Type, or any libraries capable of parsing it out into a set of Geo Coordinates in Python.
The link states that Microsoft used the "Open Geospatial Consortium (OGC) standard" in designing this data type, does this mean the spatial coordinates are defined by this standard?
Does any one else have any experience with this?
Any help would be much appreciated!
As figured out in the comments below (thanks MarkJ!):
select geocolumn.STX, geocolumn.STY from myTable;
select geocolumn.AsGml() from myTable;
which can be processed by Python geometry libraries such as http://gispython.org/ http://mapnik.org/ http://www.qgis.org/wiki/Python_Bindings
I had originally thought SQL Server stored CLR data types as serialized .NET objects directly in the table but this turned out to be wrong.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With