C# 클래스 Spatial4n.Core.Context.SpatialContext

This is a facade to most of Spatial4j, holding things like {@link DistanceUnits}, {@link DistanceCalculator}, and the coordinate world boundaries, and acting as a factory for the {@link Shape}s.

A SpatialContext has public constructors, but note the convenience instance {@link #GEO}. Also, if you wish to construct one based on configuration information then consider using {@link SpatialContextFactory}.

Thread-safe & immutable.

파일 보기 프로젝트 열기: synhershko/Spatial4n 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
GEO SpatialContext

공개 메소드들

메소드 설명
GetDistCalc ( ) : DistanceCalculator
GetWorldBounds ( ) : Rectangle

The extent of x & y coordinates should fit within the return'ed rectangle. Do *NOT* invoke reset() on this return type.

IsGeo ( ) : bool

Is this a geospatial context (true) or simply 2d spatial (false).

MakeCircle ( System.Point point, double distance ) : Circle

Construct a circle. The units of "distance" should be the same as x & y.

MakeCircle ( double x, double y, double distance ) : Circle

Construct a circle. The units of "distance" should be the same as x & y.

MakePoint ( double x, double y ) : System.Point

Construct a point.

MakeRectangle ( System.Point lowerLeft, System.Point upperRight ) : Rectangle

Construct a rectangle. The parameters will be normalized.

MakeRectangle ( double minX, double maxX, double minY, double maxY ) : Rectangle

Construct a rectangle. If just one longitude is on the dateline (+/- 180) then potentially adjust its sign to ensure the rectangle does not cross the dateline.

SpatialContext ( bool geo ) : System
SpatialContext ( bool geo, DistanceCalculator calculator, Rectangle worldBounds ) : System

ToString ( ) : String
VerifyX ( double x ) : void

Ensure fits in {@link #getWorldBounds()}

VerifyY ( double y ) : void

Ensure fits in {@link #getWorldBounds()}

보호된 메소드들

메소드 설명
MakeShapeReadWriter ( ) : ShapeReadWriter

비공개 메소드들

메소드 설명
ReadShape ( String value ) : Shape
ToString ( Shape shape ) : String

메소드 상세

GetDistCalc() 공개 메소드

public GetDistCalc ( ) : DistanceCalculator
리턴 DistanceCalculator

GetWorldBounds() 공개 메소드

The extent of x & y coordinates should fit within the return'ed rectangle. Do *NOT* invoke reset() on this return type.
public GetWorldBounds ( ) : Rectangle
리턴 Rectangle

IsGeo() 공개 메소드

Is this a geospatial context (true) or simply 2d spatial (false).
public IsGeo ( ) : bool
리턴 bool

MakeCircle() 공개 메소드

Construct a circle. The units of "distance" should be the same as x & y.
public MakeCircle ( System.Point point, double distance ) : Circle
point System.Point
distance double
리턴 Circle

MakeCircle() 공개 메소드

Construct a circle. The units of "distance" should be the same as x & y.
public MakeCircle ( double x, double y, double distance ) : Circle
x double
y double
distance double
리턴 Circle

MakePoint() 공개 메소드

Construct a point.
public MakePoint ( double x, double y ) : System.Point
x double
y double
리턴 System.Point

MakeRectangle() 공개 메소드

Construct a rectangle. The parameters will be normalized.
public MakeRectangle ( System.Point lowerLeft, System.Point upperRight ) : Rectangle
lowerLeft System.Point
upperRight System.Point
리턴 Rectangle

MakeRectangle() 공개 메소드

Construct a rectangle. If just one longitude is on the dateline (+/- 180) then potentially adjust its sign to ensure the rectangle does not cross the dateline.
public MakeRectangle ( double minX, double maxX, double minY, double maxY ) : Rectangle
minX double
maxX double
minY double
maxY double
리턴 Rectangle

MakeShapeReadWriter() 보호된 메소드

protected MakeShapeReadWriter ( ) : ShapeReadWriter
리턴 Spatial4n.Core.Io.ShapeReadWriter

SpatialContext() 공개 메소드

public SpatialContext ( bool geo ) : System
geo bool
리턴 System

SpatialContext() 공개 메소드

public SpatialContext ( bool geo, DistanceCalculator calculator, Rectangle worldBounds ) : System
geo bool Establishes geo vs cartesian / Euclidean.
calculator DistanceCalculator Optional; defaults to Haversine or cartesian depending on units.
worldBounds Rectangle Optional; defaults to GEO_WORLDBOUNDS or MAX_WORLDBOUNDS depending on units.
리턴 System

ToString() 공개 메소드

public ToString ( ) : String
리턴 String

VerifyX() 공개 메소드

Ensure fits in {@link #getWorldBounds()}
public VerifyX ( double x ) : void
x double
리턴 void

VerifyY() 공개 메소드

Ensure fits in {@link #getWorldBounds()}
public VerifyY ( double y ) : void
y double
리턴 void

프로퍼티 상세

GEO 공개적으로 정적으로 프로퍼티

A popular default SpatialContext implementation for geospatial.
public static SpatialContext,Spatial4n.Core.Context GEO
리턴 SpatialContext