SQL Server 2008 geography - spatial result - color based on another column value

廉价感情. 提交于 2019-12-11 17:35:17

问题


I have a table like this in SQL Server 2008:

serv_type   coords
------------------------
shop        0xE6100000010CE4857478080B49401CD2A8C0C9DE2C40
shop        0xE6100000010C54C6BFCFB80A49408A592F8672DA2C40
restaurant  0xE6100000010C2A00C63368064940B5C189E8D7162D40
shop        0xE6100000010CF9F884ECBC0B49405D6A847EA6FE2C40
restaurant  0xE6100000010CD3BEB9BF7A004940BC202235EDF22C40
restaurant  0xE6100000010CEE76BD3445004940508D976E12F32C40
restaurant  0xE6100000010CFFAECF9CF50B49400ABDFE243EE72C40
...        ...

If I SELECT * FROM this_table, I automatically obtain spatial results - something like points on a map.

What I would like to get is the very same thing, but with the points colored based on the serv_type column, i.e., I want the same "map", but all restaurants should be, say, blue and all shops should be red.

Is it possible to do this in SQL Server? Thanks.


回答1:


SQL Server is only going to give you the data. If you want to format that data for presentation according to attributes of that data, you're going to have to build a UI which contains your presentation logic.



来源:https://stackoverflow.com/questions/5003606/sql-server-2008-geography-spatial-result-color-based-on-another-column-value

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!