Comments posted to this topic are about the item Investigating the new Spatial Types in SQL Server 2008 - Part 2
Good article. 5 stars from me.
Waiting for ArcSDE interface.
Another good article. Well done.
Readers might want to note that the spatial reference identifier not only refers to projected spatial reference systems as suggested, but to geodetic spatial reference systems too (i.e. ones based on lat/long coordinates).
In fact, the sys.spatial_reference_systems table is *only* used for non-projected spatial reference systems, since these are required to apply the relevant model of curvature to the earth when using the geography datatype.
When using a projected system based on the geometry datatype, it doesn't matter what SRID is supplied - the results obtained of any methods will be the same.
For any readers wanting a further introduction to different spatial reference systems, and their signficance to the geometry and geography datatype, try:
"Beginning Spatial with SQL Server 2008" (Apress)
Thanks for Spatial documents and code. They all show points in text, but I want to take data from one table in sql 2005, which holds X & Y values and create Points in SQL 2008.
For normal data I would write something like :
Insert into NewTable (NewX, NewY) Select X, Y from OldTable
As SQL 2008 uses geometry::STPointFromText('POINT(20 25)', 0), what do I use for a recursive call, I cannot put geometry::STPointFromText('POINT(X Y)', 0).
The only method I have found so far is to extract the data to a text file, include all the SQL commands, then use the file as an SQL file to run. I thought of CTE, but surely I am missing something, it has to be easier.
Except for some grey cells, what am I missing, can you give some examples for a simple transfer?
I think you're making this more complicated than it needs to be! You can construct the WKT representation of a point by concatenating together the string values of each coordinate, and then passing that to the STPointFromText() method, as follows:
INSERT INTO NewTable (point)
geometry::STPointFromText('POINT('+ CAST(X AS varchar(255)) + ' ' + CAST(Y AS varchar(255)) + ')',0)
Alternatively, if it's only points that you're creating, you'll probably find it easier to use the Point() method instead. Point() accepts two floating point coordinate values directly (X/Y, or Lat/Lng), so you don't have to bother with the CASTing:
INSERT INTO NewTable (point)
Note: You should not include a space between the double colons of geometry:: and the word Point in the above example - it's just that I needed to insert the space to stop the emoticon 😛 appearing!
Beginning Spatial with SQL Server 2008
Well, my flabber is absolutely gassed!
I assumed it had to be like that and I can assure you that I tried every combination I could. Obviously not Every combination, I assumed I would need double quotes for the first quotation.
I really appreciate your help, I can now continue with my life and apologise for all those remarks I made about the Microsoft implemtation of Spatial.
Thanks for that.
Perfect, but i'm don't understand when you say: "then method Parse is simular STPointFromText" i'm don't understand too, How do say "SRID" im look, but i'm don't understand, thanks a lot! EXCELENTE TOPIC!
Part 1 and 2 were great. Where's part 3??
I had an unexpected death in the family, which kept me occupied for quite a while. Look for the remaining articles in the series within the next couple of weeks
Have you seen the Manage SQL Server 2008 Spatial Data tutorial on the SQL Server "How Do I?" Videos page? It's a nice companion to this article because you can see how to do it.
Do we still have any hope for the rest of the articles in this series? Can some other expert jump in and complete puzzle?
I need to get information on this topic specially building / constructing 3D shapes and querying the data involving these shapes. Can someone refer to some sites/books that can speed up this process of learning for me?
Any and all help is well appreciated.
This is Bennie (the original author). I have been out for a while due to family issues, but I am back, look for the next post in a couple of days.
You can check out "Beginning Spatial with SQL Server 2008" (http://www.amazon.com/Beginning-Spatial-Server-Experts-Voice/dp/1430218290), which has chapters covering the following topics:
1. Defining Spatial Information
2. Implementing Spatial Data in SQL Server 2008
3. CLR Datatypes and the .NET Framework
4. Creating Spatial Data
5. Marking Out Features Using Virtual Earth
6. Importing Spatial Data
8. Syndicating Spatial Data
9. Interactive Web Mapping
10. The Spatial Results Tab
11. Examining Spatial Properties
12. Modifying Spatial Objects
13. Testing Spatial Relationships
14. Spatial Indexing
However, you won't find anything about working with 3D geometries, in this book or any other - although SQL Server allows you to define coordinates in 4 dimensions (x, y, z, m), all of the inbuilt methods only operate in two dimensions (the flat planar surface of the geometry datatype, or the ellipsoidal surface of the geography datatype). z and m can be stored, but are not used unless you want to write your own custom methods.
Glad to hear from you Bennie. Hope everything will be fine with you.
I am eagerly waiting for the next article.
Viewing 15 posts - 1 through 15 (of 15 total)