Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have imported a number of Shape files from the ordnance survey using shape2SQL

these have been imported as geometry however i would like to convert them to Geography and specifically to srid 4326

the shape when imported contains a number of polygons

ultimately i'm trying to ascertain if a number of lat/long coordinates i hold fall within one of these polygons (so i suppose i also need to alter the coordinates to geog (which i can see has been answered before))

finally the plan is to display this on an SSRS report or onto a Bing Map display (hence why at this stage i believe i require SRID 4326)

so i guess my question is, how do i go about importing the shape as SRID 4326

share|improve this question
    
Are you wanting to do a datum transformation too? –  Kirk Kuykendall Aug 6 '12 at 15:27
    
honestly i'm not sure,i think so , i can get the shape file into SQL using shape2SQL but they are inserted using geometry and easting and northing coordinates, i need to get them in as Geography using Latitude and Longitude –  Yakyb Aug 10 '12 at 8:53

3 Answers 3

You cannot do that.

Geometry and Geography are two completely different types of data. You probably did read up on it..., but here is an explanation...

Geometry are points on a flat surface. If you would like to calculate the area of your bedroom, i.e. 3.5m by 6.8m, it would result in 23.8m2 - if you would have drawn it in a CAD program, you would start from 0,0 and draw a rectangle to 3.5 in width, and 6.8 length, which gives you the area of the flat surface, on a Z elevation of 0

enter image description here

When you get to Geography, we are talking about the way the earth or sphere are measured. Yes, the earth is round, but not completely round as a ball. It actually looks like a potato mixed with a watermelon. So, when you draw lines on the earth's surface, they are not flat. For the first couple of meters, its "ok" to measure a flat line, but after that you have to consider using calculations and Coordinate systems (i.e. WGS84, a.k.a. 4326 SRID)

Explanation: http://en.wikipedia.org/wiki/Earth_radius | http://en.wikipedia.org/wiki/Horizon

When you store something in Geometry, they are normally X,Y,Z, and when you store something in Geography they are normally Latitude, Longitude, Elevation. Also to note is, when you store in Geometry it is usually in units of measure, i.e. Meter. When storing in Geography is is usually in which datum the data reside, for example a province or state in America would not the be the same area if measured in Australia. The earth's curve is not the same, and you would sit with errors in your calculations. So, the idea was to use WGS84 as the major measuring unit across the world, but that has led to many errors locally on the ground for some surveyors. Measuring with a theodolite instrument, you would calculate the correct area of a surveyed place to the accuracy of less than 0.002m - which is acceptable. Imagine measuring an area of a place by only having 3 decimal digits after a lat/lon.

enter image description here

enter image description here

shape2SQL has a selection where you can choose between the two. BUT, you cannot compare the two against each other...

share|improve this answer

Disclaimer: this can be wrong, but... Once you have geography or geometry in srid 4326, you change change between those two systems in SQL Server without problems. Only thing where geometry vs. geography affects is calculations, geometry works on plane and georaphy works on ellipsoid, so geography type is preferred.

So Assuming that you have shp file in srid 4326. Use shape2SQL to import data into SQL server, then explode geom to text and input it to script which casts it to geograpghy (geography::ST_AstexT(geom.ST_AsText()) ? ), (simple "update datatable set geog = convert(geography, geom) " dosen't work)

If you data isn't allready in srid 4326, then you need better tools than MS SQL server for you data transformations

share|improve this answer

If there are not so many shape-files, you can try to get geography "manually", with brigantine

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.