I've been doing my research on how to import shape files into Microsoft SQL Server 2012. and am still unable to figure out how to do it after hours of playing around with it. I'll document what I've done below:
I first downloaded the latest Census TIGER Shape files at the census block level for all 50 U.S. states and the District of Columbia, unzipped those files, and now have the .dbf, .prj, .shp, and .shx files sitting in separate folders.
I opened the .prj file in Notepad++ to determine whether or not the shape file itself was Geographic or Geometric and to determine the correct SRID.
This is what it said:
I downloaded Shape2Sql.exe and attempted to import one of the smallest shape files I had (Rhode Island - roughly 25,000 polygon features). When I pressed the "Upload to Database" button nothing happened. The application recognizes the file but perhaps the file (even for a small state) is too big to handle the number of shapes at the census block level. If I switched from "Geography(Spheric)" to "Planar Geography" and from "geog" to "geom" in the "Geometry Name" column, and SRID from 4269 to 4326, I would get an error seen below when I pressed the "Upload to Database" button. I hadn't created the table in SQL Server prior to running it but I don't think that's where the problem lies (since I read it should create a new table if you're not replacing an existing one).
I've also been looking at alternate solutions besides the Shape2Sql.exe application. I've read a little about GDAL and OGR2OGR but that has me a little lost. (http://alastaira.wordpress.com/ogr2ogr-patterns-for-sql-server/). Has anyone had success bringing in large shape files into SQL Server? Perhaps there is another way that I'm missing that can be easily explained?
Any help would be greatly appreciated.
أكثر...
I first downloaded the latest Census TIGER Shape files at the census block level for all 50 U.S. states and the District of Columbia, unzipped those files, and now have the .dbf, .prj, .shp, and .shx files sitting in separate folders.
I opened the .prj file in Notepad++ to determine whether or not the shape file itself was Geographic or Geometric and to determine the correct SRID.
This is what it said:
GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]]
I concluded that these Census shape files I downloaded were Geographic (since I had a longitude/latitude column within the shape file) and the SRID was 4269 (after comparing the results to a simple query in SQL Server on sys.spatial_reference_systems)
I downloaded Shape2Sql.exe and attempted to import one of the smallest shape files I had (Rhode Island - roughly 25,000 polygon features). When I pressed the "Upload to Database" button nothing happened. The application recognizes the file but perhaps the file (even for a small state) is too big to handle the number of shapes at the census block level. If I switched from "Geography(Spheric)" to "Planar Geography" and from "geog" to "geom" in the "Geometry Name" column, and SRID from 4269 to 4326, I would get an error seen below when I pressed the "Upload to Database" button. I hadn't created the table in SQL Server prior to running it but I don't think that's where the problem lies (since I read it should create a new table if you're not replacing an existing one).
I've also been looking at alternate solutions besides the Shape2Sql.exe application. I've read a little about GDAL and OGR2OGR but that has me a little lost. (http://alastaira.wordpress.com/ogr2ogr-patterns-for-sql-server/). Has anyone had success bringing in large shape files into SQL Server? Perhaps there is another way that I'm missing that can be easily explained?
Any help would be greatly appreciated.


أكثر...