locked
MapInfo 2 Sql Server 2008 Spatial data type RRS feed

  • Question

  • Hi everyone,

    I'm having a little problem converting MapInfo objects to Sql Server 2008 spatial data type. Ive tried creating a tool that use the text description of the MapInfo object but find this way to be too slow and not optional. Do any of you know a fast and reliable way (or a tool..) that can allow me to convert my MapInfo objects and insert them into a Sql Server spatial column (geometry or geography) ?

    Also, lots of my polygons object aren't valid according to Sql Server 2008 because of the way they have been created (some clockwise and some counter-clockwise). Is there any methods on MapInfo or SqlServer to make them MSSQL valid polygons ? I know there's a MakeValid() method  in MSSQL but unless I'm mistaken, this can't solve my problem.

    Thx in advance !!!

    Franck

    Wednesday, June 10, 2009 4:01 PM

Answers

  • Hi Franck,

    I'm sure the FME from Safe Software can do the conversion.  To be honest, I don't know how much this costs, though.  MapInfo may have a tool as well.  I bet someone else on the board knows more about this than I do.

    For geometry, the ring orientation shouldn't matter, and MakeValid() won't modify a polygon if it just has the wrong ring orientation.  If you're using geometry and have invalid polygons, then something else is wrong.  Still, MakeValid() should fix whatever problems exist.

    Geography doesn't have a built-in MakeValid, but the SQL Server Spatial Tools project on CodePlex now has one---and this should fix ring orientation.

    Cheers,
    -Isaac
    Isaac Kunen, Microsoft SQL Server
    • Marked as answer by _Franck_ Wednesday, June 10, 2009 6:01 PM
    Wednesday, June 10, 2009 4:21 PM
  • Safe FME is a great tool, but it is possible to load MapInfo data into SQL Server 2008 using purely freely-available tools.

    Firstly, the open-source OGR2OGR can convert from MapInfo to ESRI Shapefile (as well as doing lots of other stuff, co-ordinate conversions etc.). Once you've got a shape in shapefile format, you can then use Morten Nielsen's Shape2SQL to load it into SQL Server. The clockwise/anti-clockwise issue only affects the geography datatype, and there are ways around it (see, for example, my post at http://www.beginningspatial.com/fixing_invalid_geography_data or try the new geography MakeValid() method on codeplex).

    You can download OGR2OGR as part of the open source FWTools kit, available from http://fwtools.maptools.org/
    You can download Shape2SQL from http://www.sharpgis.net/page/Shape2SQL.aspx
    Beginning Spatial with SQL Server http://www.apress.com/book/view/1430218290
    • Marked as answer by _Franck_ Wednesday, June 10, 2009 6:01 PM
    Wednesday, June 10, 2009 5:43 PM
    Answerer

All replies

  • Hi Franck,

    I'm sure the FME from Safe Software can do the conversion.  To be honest, I don't know how much this costs, though.  MapInfo may have a tool as well.  I bet someone else on the board knows more about this than I do.

    For geometry, the ring orientation shouldn't matter, and MakeValid() won't modify a polygon if it just has the wrong ring orientation.  If you're using geometry and have invalid polygons, then something else is wrong.  Still, MakeValid() should fix whatever problems exist.

    Geography doesn't have a built-in MakeValid, but the SQL Server Spatial Tools project on CodePlex now has one---and this should fix ring orientation.

    Cheers,
    -Isaac
    Isaac Kunen, Microsoft SQL Server
    • Marked as answer by _Franck_ Wednesday, June 10, 2009 6:01 PM
    Wednesday, June 10, 2009 4:21 PM
  • Safe FME is a great tool, but it is possible to load MapInfo data into SQL Server 2008 using purely freely-available tools.

    Firstly, the open-source OGR2OGR can convert from MapInfo to ESRI Shapefile (as well as doing lots of other stuff, co-ordinate conversions etc.). Once you've got a shape in shapefile format, you can then use Morten Nielsen's Shape2SQL to load it into SQL Server. The clockwise/anti-clockwise issue only affects the geography datatype, and there are ways around it (see, for example, my post at http://www.beginningspatial.com/fixing_invalid_geography_data or try the new geography MakeValid() method on codeplex).

    You can download OGR2OGR as part of the open source FWTools kit, available from http://fwtools.maptools.org/
    You can download Shape2SQL from http://www.sharpgis.net/page/Shape2SQL.aspx
    Beginning Spatial with SQL Server http://www.apress.com/book/view/1430218290
    • Marked as answer by _Franck_ Wednesday, June 10, 2009 6:01 PM
    Wednesday, June 10, 2009 5:43 PM
    Answerer
  • thanks to you guys, sounds like exacly what I needed !

    Ive already taken a look on the SQL Server Spatial Tools project and its really helpful ! Ill chek out for OGR2OGR too.

    Franck
    Wednesday, June 10, 2009 6:01 PM
  • Hi Frank,

    is it possible to load the ESRI shapefiles into SQL Server or do we need use some other tools to do this? basically i am evaulating the compabilities of the MapInfo.

    Thanks,

    Eshwar.

    Friday, January 6, 2012 6:44 AM