Patent ID: 8046168

Claim:
A method of locating a position as being within or without a defined geographic area, the method comprising the steps of: defining a geofence as a closed circuit of a plurality of straight line boundary segments in a rectangular Cartesian coordinate system to define the geographic area; obtaining a position in the rectangular Cartesian coordinate system; constructing a ray from the position within the rectangular Cartesian coordinate system; locating intersections between the ray and the plurality of line segments; counting the number of intersections and characterizing the position as within or without the geofence based on the count, wherein the ray constructing step is done with the ray oriented in a cardinal direction of the rectangular Cartesian coordinate system, wherein the rectangular Cartesian coordinate system is a system of latitude and longitude used for a globe; defining boundary segments such that they include only end point vertex; locating boundary segments parallel to the ray and excluding any intersections between the ray and parallel boundary segments from the count of intersections; locating extreme dimensions of the geofence; constructing a rectangle in the rectangular Cartesian space from four boundary segments oriented in the cardinal directions of the rectangular Cartesian space, including the extreme dimensions of the geofence and enclosing the geofence; characterizing as outside the geofence any point outside of the rectangle; following definition of the geofence, averaging the coordinate values of the vertices of the geofence; and setting the average values as the origin of a new coordinate system and resetting all vertices in terms of the new origin, wherein the step of counting further comprises characterizing the position as within the geofence if the count is odd and as without the geofence if the count is even.