LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (February 2000, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 3 Feb 2000 18:31:05 +0100
Reply-To:     peter.crawford@DB.COM
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Peter Crawford <peter.crawford@DB.COM>
Subject:      Q: Point in Polygon Test - has anyone seen a Base SAS
              implementation.
Comments: To: finelink@iinet.net.au
Content-type: text/plain; charset=us-ascii

Isn't the algorithm something to do with detecting whether the polygon frontier passes through X line and Y line an odd number of times or even number of times. If the point has an odd number of frontiers in all 4 directions the it lies within. I remember a SAS/Graph map data set routine ......... So it seemed a good time to show those who don't know, just how simple it is to search for this kind of thing at SI The default database is v6 usage notes, but more useful for this enquiry is database TSNOTE which is the full set of technical notes and articles. So I sent off a search to the SAS Information warehouse, with these results which will give Bob Whitehead just what he seeks >>>>>>>>< I sent to sasnotes@sas.com database tsnote search point inside polygon map This is a clip from the reply >>>>>>>>>>>>>>>>>>>>>>>>>> > database tsnote > search point inside polygon map

Score Document Title ----------------------------------------------------------------------------- 1000 ts096 DETERMINING IF A POINT LIES INSIDE A POLYGON - SAS CODE XAMPLE 11 ts321 SAS Communications(R) Index 1982 - 2Q94

---------------------------------------------------------------------------

To get additional help, send email to sasnotes@sas.com with the word HELP in the body of the message.

You can retrieve any document by specifying its document name/number. For example: database v6 get 5371 >>>>>>>>>>>>>>end of clip

All Bob has to do is send to: sasnotes@sas.com the message database tsnote get ts096

Datum: 03.02.2000 17:19 An: SAS-L@listserv.uga.edu

Antwort an: finelink@iinet.net.au

Betreff: Q: Point in Polygon Test - has anyone seen a Base SAS implementation. Nachrichtentext:

Hi all,

I thought I'd throw this to the collective intelligence.

I am trying to find a way to implement in Base SAS (maybe GRAPH as well later) a way to test if X,Y points in my dataset are inside or outside a polygon.

At this point the best I can say is that the polygon is not necessary a simple one.

I just need to return a simple flag indicating whether the point is IN/OUT/BORDER/VERTEX.

I can easily test for the vertex, and I have some ideas for algorithms but I my geometry is a little (lot!) rusty.

Thanks in advance.

Bob Whitehead Finelink Nominees Pty Ltd Perth, Western Australia


Back to: Top of message | Previous page | Main SAS-L page