Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Database & SysAdmin
  3. Database
  4. SQL Server 2008 Spatial Data

SQL Server 2008 Spatial Data

Scheduled Pinned Locked Moved Database
databasesql-serversysadminbeta-testinghelp
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    Bassam Saoud
    wrote on last edited by
    #1

    Hi All, I am struggeling finding an effectient way to find a distance between a Point that intersects a polygon and the border of that polygon. I was able to use the STDistance comparing the point to every point that made up the polygon but that is taking a lot of time. Using SPatial indexe wasn't much helpful because the STDistance is not part of any constraint and even when I did put the constraint, the index didnt help much. I appreciate any feedback. Thanks

    P 1 Reply Last reply
    0
    • B Bassam Saoud

      Hi All, I am struggeling finding an effectient way to find a distance between a Point that intersects a polygon and the border of that polygon. I was able to use the STDistance comparing the point to every point that made up the polygon but that is taking a lot of time. Using SPatial indexe wasn't much helpful because the STDistance is not part of any constraint and even when I did put the constraint, the index didnt help much. I appreciate any feedback. Thanks

      P Offline
      P Offline
      Peter_in_2780
      wrote on last edited by
      #2

      Looks like you might have to write some code. For the basics, google "distance point line". Once you have that, you just need to find the minimum of the distances to the edges of the polygon. Calculation should be O(n) for an n-gon.

      Software rusts. Simon Stephenson, ca 1994.

      B 1 Reply Last reply
      0
      • P Peter_in_2780

        Looks like you might have to write some code. For the basics, google "distance point line". Once you have that, you just need to find the minimum of the distances to the edges of the polygon. Calculation should be O(n) for an n-gon.

        Software rusts. Simon Stephenson, ca 1994.

        B Offline
        B Offline
        Bassam Saoud
        wrote on last edited by
        #3

        Thats what I am doing but its freakin slow. After a lot of research I found an excelent blog describing an efficient way to do this: Nearest neighbors[^]

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups