public class DSL extends Object
The DSL has methods for creating Positions, Geometrys and GeometryTokens.
The methods for creating Positions 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.
GeometryTokens are intermediate representations that are handy when creating a Geometry that is composed of Geometrys. 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.EmptyPointToken<P extends Position> |
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 <P extends Position> |
emptyPoint() |
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 GeometryTokens and CoordinateReferenceSystem. |
static <P extends Position> |
geometrycollection(DSL.GeometryToken<P>... tokens)
Creates a
GeometryCollectionToken of the specified GeometryTokens |
static <P extends Position> |
geometrycollection(Geometry<P> geometry,
Geometry<P>... geometries)
Creates a
GeometryCollection from the specified Geometrys. |
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)
Creates an empty
Point |
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)
PointP - the Position typecrs - the CoordinateReferenceSystem for the Pointp - the Position for the PointPoint having the specified Position and CoordinateReferenceSystempublic static <P extends Position> Point<P> point(CoordinateReferenceSystem<P> crs)
PointP - the Position typecrs - the CoordinateReferenceSystem for the PointPoint having the specified Position and CoordinateReferenceSystempublic static <P extends Position> DSL.PointToken<P> point(P position)
PointTokenP - the Position typeposition - the Position for the PointTokenPointToken having the specified Positionpublic static <P extends Position> DSL.EmptyPointToken<P> emptyPoint()
public static <P extends Position> LineString<P> linestring(CoordinateReferenceSystem<P> crs, P... positions)
LineStringP - the Position typecrs - the CoordinateReferenceSystem for the LineStringpositions - the Positions for the LineStringLineString having the specified Positions and CoordinateReferenceSystempublic static <P extends Position> DSL.LineStringToken<P> linestring(P... positions)
LineStringTokenP - the Position typepositions - the Positions for the LineStringTokenLineStringToken having the specified Positionspublic static <P extends Position> LinearRing<P> ring(CoordinateReferenceSystem<P> crs, P... positions)
LinearRingP - the Position typecrs - the CoordinateReferenceSystem for the LinearRingpositions - the Positions for the LinearRingLinearRing having the specified Positions and CoordinateReferenceSystem@SafeVarargs public static <P extends Position> DSL.LinearRingToken<P> ring(P... positions)
LinearRingTokenP - the Position typepositions - the Positions for the LinearRingTokenLinearRingToken having the specified Positions@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 Geometrys.P - the Position typegeometry - the first constituent Geometrygeometries - the rest of the constituent GeometrysGeometryCollection of the specified constituent Geometrys.@SafeVarargs public static <P extends Position> GeometryCollection<P> geometrycollection(CoordinateReferenceSystem<P> crs, DSL.GeometryToken<P>... tokens)
GeometryCollection from the specified GeometryTokens and CoordinateReferenceSystem.P - the Position typecrs - the CoordinateReferenceSystem for the GeometryCollectiontokens - the GeometryTokens for the constituent Geometrys of the returned GeometryCollectionGeometryCollection of the specified constituent Geometrys and CoordinateReferenceSystem@SafeVarargs public static <P extends Position> DSL.GeometryCollectionToken<P> geometrycollection(DSL.GeometryToken<P>... tokens)
GeometryCollectionToken of the specified GeometryTokensP - the Position typetokens - the GeometryTokens that represent the constituent Geometrys of the returned GeometryCollectionGeometryCollectionToken of the specified constituent GeometryTokens@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 Polygonrings - the inner rings of the returned PolygonPolygon 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 CoordinateReferenceSystemP - the Position typecrs - the CoordinateReferenceSystem for the returned Polygontokens - 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 © 2023 geolatte.org. All rights reserved.