Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2005
    Posts
    4

    Question Unanswered: Point in Polygon with TSQL

    I've got a table with lat/longs for specific points:
    Code:
    CREATE TABLE [Point] (
    	[PointID] [int],
    	[Lat] [numeric](10, 6),
    	[Lon] [numeric](10, 6)
    )
    I have another table with polygon borders as lat/longs:
    Code:
    CREATE TABLE [Polygon] (
    	[PolygonID] [int],
    	[PointNum] [int],
    	[Lat] [numeric](10, 6),
    	[Lon] [numeric](10, 6)
    )
    What I need to do, is come up with a script that will determine which Polygon contains each point. I'd like to be able to assign a PolygonID to each record in the Point table, or give it a 0 if there is no polygon that contains that point.

    I'm looking for a way to do this within SQL Server (or possibly with the use of an extended stored procedure if necessary).

    Thanks for your help and suggestions!

    Tyler

  2. #2
    Join Date
    Oct 2005
    Posts
    4
    If anyone has an interest in this, I suggest you have a look here:

    http://www.sqljunkies.com/Forums/Sho...px?PostID=8833

    Discussions are on-going and I've found a solution that is working... so far...

  3. #3
    Join Date
    Jul 2010
    Posts
    7
    You can refer to this page:

    SQL Point In Polygon

  4. #4
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    I'm thinking that you probably won't get much of a response from a five year old thread.

    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •