SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 sql query for polygon
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

gayathris
Starting Member

11 Posts

Posted - 06/11/2012 :  08:16:25  Show Profile  Reply with Quote
Hello
Could anyone please tell me the sql query for the following case. I have a polygon which has id,name,latitude and longitude.
I used the query: select ASTEXT(polygon) AS polygon from table_name; This gives me all details but are congested. How can I seperate them?

Mar
Starting Member

23 Posts

Posted - 06/12/2012 :  08:25:13  Show Profile  Reply with Quote
Can you provide more details? What do you mean by congested? What does your table look like? What results are you getting back? What do you want to get back, i.e. what do you want different from what you have?
Go to Top of Page

gayathris
Starting Member

11 Posts

Posted - 06/13/2012 :  03:37:55  Show Profile  Reply with Quote
When I used the above query, I got POLYGON(9.4 34.7,9.5 34.8,9.6 34.9,9.4 34.7). I want the latitude and longitude to be separate such that they are displayed separately? Is it possible?
Go to Top of Page

Mar
Starting Member

23 Posts

Posted - 06/13/2012 :  09:40:05  Show Profile  Reply with Quote
Probably. Since you didn't answer my questions I can not provide you with an answer. But you could figure it out http://msdn.microsoft.com/en-US/library/ms187748%28v=sql.90%29.aspx
Go to Top of Page

gayathris
Starting Member

11 Posts

Posted - 06/14/2012 :  03:07:56  Show Profile  Reply with Quote
I have designed a polygon and used this sql query to get the coordinates of the polygon.

select ASTEXT(polygon) AS polygon from table_name;

Now I want to parse them. I want to seperate the latitude and the longitude .

How should I do it?
Go to Top of Page

Sachin.Nand
Flowing Fount of Yak Knowledge

2937 Posts

Posted - 06/14/2012 :  03:52:34  Show Profile  Reply with Quote
quote:
Originally posted by gayathris

I have designed a polygon and used this sql query to get the coordinates of the polygon.

select ASTEXT(polygon) AS polygon from table_name;

Now I want to parse them. I want to seperate the latitude and the longitude .

How should I do it?



Are you using sql server or MySql ?

After Monday and Tuesday even the calendar says W T F ....
Go to Top of Page

gayathris
Starting Member

11 Posts

Posted - 06/25/2012 :  05:23:20  Show Profile  Reply with Quote
I am using mysql.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000