public class DSL extends Object
The DSL has methods for creating Position
s, Geometry
s and GeometryTokens
.
The methods for creating Position
s are:
G2D
, G3D
, G2DM
and
G3DM
Position
instancesP2D
, P3D
, P2DM
and P3DM
Position
instancesThe methods for creating geometries are named for the geometry the create.
GeometryToken
s are intermediate representations that are handy when creating a Geometry
that is composed of Geometry
s. It allows the
DSL user to specify the coordinate reference system only once.
import static org.geolatte.geom.builder.DSL.*;
public Polygon createPolygon() {
CoordinateReferenceSystem crs = ...
return polygon(crs, ring(p(0, 0), p(0, 1), p(1, 1), p(1, 0), p(0, 0)));
}
Modifier and Type | Class and Description |
---|---|
static class |
DSL.GeometryCollectionToken<P extends Position> |
static class |
DSL.GeometryToken<P extends Position> |
static class |
DSL.LinearRingToken<P extends Position> |
static class |
DSL.LineStringToken<P extends Position> |
static class |
DSL.MultiLineStringToken<P extends Position> |
static class |
DSL.MultiPointToken<P extends Position> |
static class |
DSL.MultiPolygonToken<P extends Position> |
static class |
DSL.PointToken<P extends Position> |
static class |
DSL.PolygonToken<P extends Position> |
Modifier and Type | Method and Description |
---|---|
static C2D |
c(double x,
double y)
Creates a projected 2D position token.
|
static C3D |
c(double x,
double y,
double z)
Creates a projected 3D position token
|
static C3DM |
c(double x,
double y,
double z,
double m)
Creates a projected 3DM position token
|
static C2DM |
cM(double x,
double y,
double m)
Creates a projected 2DM position token
|
protected static <P extends Position,G extends Geometry<P>> |
combine(Class<G> resultType,
G geometry,
G... geometries) |
static G2D |
g(double lon,
double lat)
Creates a geographic 2D position token
|
static G3D |
g(double lon,
double lat,
double height)
Creates a geographic 3D position token
|
static G3DM |
g(double lon,
double lat,
double height,
double m)
Creates a geographic 3DM position token
|
static <P extends Position> |
geometrycollection(CoordinateReferenceSystem<P> crs,
DSL.GeometryToken<P>... tokens)
Creates a
GeometryCollection from the specified GeometryToken s and CoordinateReferenceSystem . |
static <P extends Position> |
geometrycollection(DSL.GeometryToken<P>... tokens)
Creates a
GeometryCollectionToken of the specified GeometryToken s |
static <P extends Position> |
geometrycollection(Geometry<P> geometry,
Geometry<P>... geometries)
Creates a
GeometryCollection from the specified Geometry s. |
static G2DM |
gM(double lon,
double lat,
double m)
Creates a geographic 2DM position token
|
static <P extends Position> |
linestring(CoordinateReferenceSystem<P> crs,
P... positions)
Creates a
LineString |
static <P extends Position> |
linestring(P... positions)
Creates a
LineStringToken |
static <P extends Position> |
multilinestring(CoordinateReferenceSystem<P> crs,
DSL.LineStringToken<P>... tokens) |
static <P extends Position> |
multilinestring(DSL.LineStringToken<P>... tokens) |
static <P extends Position> |
multilinestring(LineString<P> linestring,
LineString<P>... linestrings) |
static <P extends Position> |
multipoint(CoordinateReferenceSystem<P> crs) |
static <P extends Position> |
multipoint(CoordinateReferenceSystem<P> crs,
DSL.PointToken<P>... tokens) |
static <P extends Position> |
multipoint(CoordinateReferenceSystem<P> crs,
P... positions) |
static <P extends Position> |
multipoint(DSL.PointToken<P>... tokens) |
static <P extends Position> |
multipoint(Point<P> point,
Point<P>... points) |
static <P extends Position> |
multipolygon(CoordinateReferenceSystem<P> crs,
DSL.PolygonToken<P>... tokens) |
static <P extends Position> |
multipolygon(DSL.PolygonToken<P>... tokens) |
static <P extends Position> |
multipolygon(Polygon<P> polygon,
Polygon<P>... polygons) |
static <P extends Position> |
point(CoordinateReferenceSystem<P> crs,
P p)
Creates a
Point |
static <P extends Position> |
point(P position)
Creates a
PointToken |
static <P extends Position> |
polygon(CoordinateReferenceSystem<P> crs,
DSL.LinearRingToken<P>... tokens)
Creates a
Polygon from the specified ring tokens and CoordinateReferenceSystem |
static <P extends Position> |
polygon(DSL.LinearRingToken<P>... tokens) |
static <P extends Position> |
polygon(LinearRing<P> hull,
LinearRing<P>... rings)
Creates a
Polygon from the specified outer ring (or hull) and inner rings (if any) |
static <P extends Position> |
ring(CoordinateReferenceSystem<P> crs,
P... positions)
Creates a
LinearRing |
static <P extends Position> |
ring(P... positions)
Creates a
LinearRingToken |
public static C2D c(double x, double y)
x
- x or eastingy
- y or northingpublic static C3D c(double x, double y, double z)
x
- x or eastingy
- y or northingz
- z or heightpublic static C2DM cM(double x, double y, double m)
x
- x or eastingy
- y or northingm
- measure valuepublic static C3DM c(double x, double y, double z, double m)
x
- x or eastingy
- y or northingz
- z or heightitudem
- measure valuepublic static G2D g(double lon, double lat)
lon
- longitudelat
- latitudepublic static G3D g(double lon, double lat, double height)
lon
- longitudelat
- latitudeheight
- heightpublic static G2DM gM(double lon, double lat, double m)
lon
- longitudelat
- latitudem
- measure valuepublic static G3DM g(double lon, double lat, double height, double m)
lon
- longitudelat
- latitudeheight
- heightm
- measure valuepublic static <P extends Position> Point<P> point(CoordinateReferenceSystem<P> crs, P p)
Point
P
- the Position
typecrs
- the CoordinateReferenceSystem
for the Point
p
- the Position
for the Point
Point
having the specified Position
and CoordinateReferenceSystem
public static <P extends Position> DSL.PointToken<P> point(P position)
PointToken
P
- the Position
typeposition
- the Position
for the PointToken
PointToken
having the specified Position
public static <P extends Position> LineString<P> linestring(CoordinateReferenceSystem<P> crs, P... positions)
LineString
P
- the Position
typecrs
- the CoordinateReferenceSystem
for the LineString
positions
- the Position
s for the LineString
LineString
having the specified Position
s and CoordinateReferenceSystem
public static <P extends Position> DSL.LineStringToken<P> linestring(P... positions)
LineStringToken
P
- the Position
typepositions
- the Position
s for the LineStringToken
LineStringToken
having the specified Position
spublic static <P extends Position> LinearRing<P> ring(CoordinateReferenceSystem<P> crs, P... positions)
LinearRing
P
- the Position
typecrs
- the CoordinateReferenceSystem
for the LinearRing
positions
- the Position
s for the LinearRing
LinearRing
having the specified Position
s and CoordinateReferenceSystem
@SafeVarargs public static <P extends Position> DSL.LinearRingToken<P> ring(P... positions)
LinearRingToken
P
- the Position
typepositions
- the Position
s for the LinearRingToken
LinearRingToken
having the specified Position
s@SafeVarargs protected static <P extends Position,G extends Geometry<P>> G[] combine(Class<G> resultType, G geometry, G... geometries)
@SafeVarargs public static <P extends Position> GeometryCollection<P> geometrycollection(Geometry<P> geometry, Geometry<P>... geometries)
GeometryCollection
from the specified Geometry
s.P
- the Position
typegeometry
- the first constituent Geometry
geometries
- the rest of the constituent Geometry
sGeometryCollection
of the specified constituent Geometry
s.@SafeVarargs public static <P extends Position> GeometryCollection<P> geometrycollection(CoordinateReferenceSystem<P> crs, DSL.GeometryToken<P>... tokens)
GeometryCollection
from the specified GeometryToken
s and CoordinateReferenceSystem
.P
- the Position
typecrs
- the CoordinateReferenceSystem
for the GeometryCollection
tokens
- the GeometryTokens
for the constituent Geometry
s of the returned GeometryCollection
GeometryCollection
of the specified constituent Geometry
s and CoordinateReferenceSystem
@SafeVarargs public static <P extends Position> DSL.GeometryCollectionToken<P> geometrycollection(DSL.GeometryToken<P>... tokens)
GeometryCollectionToken
of the specified GeometryToken
sP
- the Position
typetokens
- the GeometryToken
s that represent the constituent Geometry
s of the returned GeometryCollection
GeometryCollectionToken
of the specified constituent GeometryToken
s@SafeVarargs public static <P extends Position> Polygon<P> polygon(LinearRing<P> hull, LinearRing<P>... rings)
Polygon
from the specified outer ring (or hull) and inner rings (if any)P
- the Position
typehull
- the outer ring of the returned Polygon
rings
- the inner rings of the returned Polygon
Polygon
defined by the specified outer and inner rings.@SafeVarargs public static <P extends Position> Polygon<P> polygon(CoordinateReferenceSystem<P> crs, DSL.LinearRingToken<P>... tokens)
Polygon
from the specified ring tokens and CoordinateReferenceSystem
P
- the Position
typecrs
- the CoordinateReferenceSystem
for the returned Polygon
tokens
- the GeometryTokens
representing (in order) the outer and any inner ringsPolygon
defined by the specified coordinate reference system and ring tokens@SafeVarargs public static <P extends Position> DSL.PolygonToken<P> polygon(DSL.LinearRingToken<P>... tokens)
@SafeVarargs public static <P extends Position> MultiPoint<P> multipoint(Point<P> point, Point<P>... points)
@SafeVarargs public static <P extends Position> DSL.MultiPointToken<P> multipoint(DSL.PointToken<P>... tokens)
public static <P extends Position> MultiPoint<P> multipoint(CoordinateReferenceSystem<P> crs)
@SafeVarargs public static <P extends Position> MultiPoint<P> multipoint(CoordinateReferenceSystem<P> crs, P... positions)
@SafeVarargs public static <P extends Position> MultiPoint<P> multipoint(CoordinateReferenceSystem<P> crs, DSL.PointToken<P>... tokens)
@SafeVarargs public static <P extends Position> MultiLineString<P> multilinestring(LineString<P> linestring, LineString<P>... linestrings)
@SafeVarargs public static <P extends Position> DSL.MultiLineStringToken<P> multilinestring(DSL.LineStringToken<P>... tokens)
@SafeVarargs public static <P extends Position> MultiLineString<P> multilinestring(CoordinateReferenceSystem<P> crs, DSL.LineStringToken<P>... tokens)
@SafeVarargs public static <P extends Position> MultiPolygon<P> multipolygon(Polygon<P> polygon, Polygon<P>... polygons)
@SafeVarargs public static <P extends Position> DSL.MultiPolygonToken<P> multipolygon(DSL.PolygonToken<P>... tokens)
@SafeVarargs public static <P extends Position> MultiPolygon<P> multipolygon(CoordinateReferenceSystem<P> crs, DSL.PolygonToken<P>... tokens)
Copyright © 2021 geolatte.org. All rights reserved.