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.

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
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