Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 sql query for polygon

Author  Topic 

gayathris
Starting Member

11 Posts

Posted - 2012-06-11 : 08:16:25
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

47 Posts

Posted - 2012-06-12 : 08:25:13
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 - 2012-06-13 : 03:37:55
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

47 Posts

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

gayathris
Starting Member

11 Posts

Posted - 2012-06-14 : 03:07:56
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

2937 Posts

Posted - 2012-06-14 : 03:52:34
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 - 2012-06-25 : 05:23:20
I am using mysql.
Go to Top of Page
   

- Advertisement -