Frequently Asked Question: How do I load shapefiles?
This has come up a few times now. Multiple questions deserve at least one answer, right?
First, Microsoft has not produced a shapefile loader (or exporter). If this is important to you, here’s the Connect item to hit. (And yes: we do listen to Connect!)
So, what are you to do? There are a few options:
- If you are a user of one of our partner GIS vendors---Autodesk, ESRI, Intergraph, Manifold, or Pitney Bowes (MapInfo)---they probably have support for loading shapefiles already. You’ll have to ask them, though: I’m not an expert in their products.
- If not, and if you aren’t interested in a real GIS, then you should check out Safe Software: they build spatial ETL software that will take shapefiles (as well as about ~200 other formats) perform transformations on the data, and load into SQL Server.
- If you’re looking for a free solution, then there are a few popping up in the wild. Morten Nielsen has had his tool available for some time now, which has both a command line and GUI interfaces. Scott Ellington has created a command line tool as well, but I haven’t had a chance to play with it yet.
- You could build your own. I suggest using the sink/builder API---you can find plenty of examples in our Codeplex project.
Hopefully one of these solutions will work for you.
Cheers,
-Isaac
Comments
Anonymous
November 05, 2008
Isaac, Not sure it helps much - but we've started a new section on our site covering SQL Server 2008 Spatial (hopefully all the information is accurate). We are still green ourselves as far as 2008 goes so we may have made some errors. For Part 1 and Part 2 - we cover installing express, using Morten's tool to load shape and also doing transform with OGR. We'll need to check out some of the other tools you mentioned at a later time to see what gems they offer. http://www.bostongis.com/PrinterFriendly.aspx?content_name=sql2008_tut01 http://www.bostongis.com/PrinterFriendly.aspx?content_name=sql2008_tut02 Thanks, ReginaAnonymous
November 05, 2008
Hi Regina, Absolutely! Thanks for pointing this out. I saw your tutorial---and it looked very useful---but it slipped my mind when I was putting this post together. Cheers, -IsaacAnonymous
November 10, 2008
We built our own. It's fairly simple. The only snag I've hit so far was that the ADO.Net DBase provider does not exist in the 64bit world, so I had to build my app for x86. This is going to be a problem, unless you can push all your DBF data into another database. Or, as in our case, we're not too fussed about 64bit at this moment in time and will run about panicking when x64 is old and x86 code ceases to run.Anonymous
November 11, 2008
The comment has been removedAnonymous
November 19, 2008
Hello, Can you explain the half-hemispher limitation on the geographical datatype? Reading various posts recently, I suspect that it is to do with determining what is the inside and what is the outside of a region, but apparently this can be signalled by the ring orientation of the polygon. What is the timeline for introducing whole sphere support? Will this be in a service pack or will we have to wait for the next major upgrade?Anonymous
January 14, 2009
You can also use the Open Source SharpMap.Demo.FormatConverter project in the trunk of SharpMap V2 - currently in development at http://sharpmapv2.googlecode.com . The project SharpMap.Demo.MapViewer can also display data from a variety of sources including Sql Server 2008 John Diss