use of org.orekit.models.earth.tessellation.EllipsoidTessellator in project Orekit by CS-SI.
the class DOPComputation method sample.
/**
* Mesh an area of interest into a grid of geodetic points.
*
* @param zone the area to mesh
* @param meshSize the size of the square meshes as a distance on the Earth surface (in meters)
* @return a list of geodetic points sampling the zone of interest
* @throws OrekitException if the area cannot be meshed
*/
private List<List<GeodeticPoint>> sample(final OneAxisEllipsoid shape, final List<GeodeticPoint> zone, final double meshSize) throws OrekitException {
// Convert the area into a SphericalPolygonsSet
final SphericalPolygonsSet sps = computeSphericalPolygonsSet(zone);
// Build the tesselator
final TileAiming aiming = new ConstantAzimuthAiming(shape, 0.);
final EllipsoidTessellator tessellator = new EllipsoidTessellator(shape, aiming, 4);
// Returns the sampled area as a grid of geodetic points
return tessellator.sample(sps, meshSize, meshSize);
}
use of org.orekit.models.earth.tessellation.EllipsoidTessellator in project Orekit by CS-SI.
the class FootprintOverlapDetector method sample.
/**
* Sample the region.
* @param body body on which the geographic zone is defined
* @param zone geographic zone to consider
* @param samplingStep linear step used for sampling the geographic zone (in meters)
* @return sampling points
* @throws OrekitException if the region cannot be sampled
*/
private static List<SamplingPoint> sample(final OneAxisEllipsoid body, final SphericalPolygonsSet zone, final double samplingStep) throws OrekitException {
final List<SamplingPoint> sampledZone = new ArrayList<SamplingPoint>();
// sample the zone boundary
final List<Vertex> boundary = zone.getBoundaryLoops();
for (final Vertex loopStart : boundary) {
int count = 0;
for (Vertex v = loopStart; count == 0 || v != loopStart; v = v.getOutgoing().getEnd()) {
++count;
final Edge edge = v.getOutgoing();
final int n = (int) FastMath.ceil(edge.getLength() * body.getEquatorialRadius() / samplingStep);
for (int i = 0; i < n; ++i) {
final S2Point intermediate = new S2Point(edge.getPointAt(i * edge.getLength() / n));
final GeodeticPoint gp = new GeodeticPoint(0.5 * FastMath.PI - intermediate.getPhi(), intermediate.getTheta(), 0.0);
sampledZone.add(new SamplingPoint(body.transform(gp), gp.getZenith()));
}
}
}
// sample the zone interior
final EllipsoidTessellator tessellator = new EllipsoidTessellator(body, new ConstantAzimuthAiming(body, 0.0), 4);
final List<List<GeodeticPoint>> gpSample = tessellator.sample(zone, samplingStep, samplingStep);
for (final List<GeodeticPoint> list : gpSample) {
for (final GeodeticPoint gp : list) {
sampledZone.add(new SamplingPoint(body.transform(gp), gp.getZenith()));
}
}
return sampledZone;
}
Aggregations