PHP 클래스 Location\Polygon

저자: Paul Vidal ([email protected])
저자: Marcus Jaschen ([email protected])
상속: implements location\GeometryInterface
파일 보기 프로젝트 열기: mjaschen/phpgeo 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$points array

공개 메소드들

메소드 설명
addPoint ( Coordinate $point )
contains ( Coordinate $point ) : boolean Determine if given point is contained inside the polygon. Uses the PNPOLY algorithm by W. Randolph Franklin. Therfore some edge cases may not give the expected results, e. g. if the point resides on the polygon boundary.
containsGeometry ( location\GeometryInterface $geometry ) : boolean Determine if given geometry is contained inside the polygon. This is assumed to be true, if each point of the geometry is inside the polygon.
format ( Location\Formatter\Polygon\FormatterInterface $formatter ) : mixed
getArea ( ) : float Calculates the polygon area.
getLats ( ) : float[] Return all polygon point's latitudes.
getLngs ( ) : float[] Return all polygon point's longitudes.
getNumberOfPoints ( ) : integer
getPerimeter ( Location\Distance\DistanceInterface $calculator ) : float Calculates the polygon perimeter.
getPoints ( ) : array
getReverse ( ) : Polygon Create a new polygon with reversed order of points, i. e. reversed polygon direction.
getSegments ( ) : array

메소드 상세

addPoint() 공개 메소드

public addPoint ( Coordinate $point )
$point Coordinate

contains() 공개 메소드

Determine if given point is contained inside the polygon. Uses the PNPOLY algorithm by W. Randolph Franklin. Therfore some edge cases may not give the expected results, e. g. if the point resides on the polygon boundary.
또한 보기: http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html For special cases this calculation leads to wrong results: - if the polygons spans over the longitude boundaries at 180/-180 degrees
public contains ( Coordinate $point ) : boolean
$point Coordinate
리턴 boolean

containsGeometry() 공개 메소드

Edge cases: - it's not detected when a line between two points is outside the polygon - @see contains() for more restrictions
public containsGeometry ( location\GeometryInterface $geometry ) : boolean
$geometry location\GeometryInterface
리턴 boolean

format() 공개 메소드

public format ( Location\Formatter\Polygon\FormatterInterface $formatter ) : mixed
$formatter Location\Formatter\Polygon\FormatterInterface
리턴 mixed

getArea() 공개 메소드

Calculates the polygon area.
public getArea ( ) : float
리턴 float

getLats() 공개 메소드

Return all polygon point's latitudes.
public getLats ( ) : float[]
리턴 float[]

getLngs() 공개 메소드

Return all polygon point's longitudes.
public getLngs ( ) : float[]
리턴 float[]

getNumberOfPoints() 공개 메소드

public getNumberOfPoints ( ) : integer
리턴 integer

getPerimeter() 공개 메소드

Calculates the polygon perimeter.
public getPerimeter ( Location\Distance\DistanceInterface $calculator ) : float
$calculator Location\Distance\DistanceInterface instance of distance calculation class
리턴 float

getPoints() 공개 메소드

public getPoints ( ) : array
리턴 array

getReverse() 공개 메소드

Create a new polygon with reversed order of points, i. e. reversed polygon direction.
public getReverse ( ) : Polygon
리턴 Polygon

getSegments() 공개 메소드

public getSegments ( ) : array
리턴 array

프로퍼티 상세

$points 보호되어 있는 프로퍼티

protected array $points
리턴 array