本文整理了Java中org.esa.snap.engine_utilities.eo.GeoUtils
类的一些代码示例,展示了GeoUtils
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。GeoUtils
类的具体详情如下:
包路径:org.esa.snap.engine_utilities.eo.GeoUtils
类名称:GeoUtils
暂无
代码示例来源:origin: senbox-org/s1tbx
/**
* Compute accurate target geo position.
*
* @param latMid The scene latitude.
* @param lonMid The scene longitude.
* @param slrgTime The slant range time of the given pixel.
* @param data The orbit data.
* @return The geo position of the target.
*/
private static GeoPos computeLatLon(final double latMid, final double lonMid, double slrgTime, Orbits.OrbitVector data) {
final double[] xyz = new double[3];
final GeoPos geoPos = new GeoPos(latMid, lonMid);
// compute initial (x,y,z) coordinate from lat/lon
GeoUtils.geo2xyz(geoPos, xyz);
// compute accurate (x,y,z) coordinate using Newton's method
GeoUtils.computeAccurateXYZ(data, xyz, slrgTime);
// compute (lat, lon, alt) from accurate (x,y,z) coordinate
GeoUtils.xyz2geo(xyz, geoPos);
return geoPos;
}
代码示例来源:origin: senbox-org/s1tbx
GeoUtils.polar2cartesian(lat, lon, alt, xyz);
代码示例来源:origin: senbox-org/s1tbx
private void writeCenterLatLon(final PrintStream p) {
GeoPos geoPos = srcProduct.getSceneGeoCoding().getGeoPos(
new PixelPos(srcProduct.getSceneRasterWidth() / 2, srcProduct.getSceneRasterHeight() / 2), null);
p.println(GammaConstants.HEADER_KEY_CENTER_LATITUDE + sep + geoPos.getLat() + tab + "degrees");
p.println(GammaConstants.HEADER_KEY_CENTER_LONGITUDE + sep + geoPos.getLon() + tab + "degrees");
GeoPos geoPos2 = srcProduct.getSceneGeoCoding().getGeoPos(
new PixelPos(srcProduct.getSceneRasterWidth() / 2, (srcProduct.getSceneRasterHeight() / 2) + 100), null);
GeoUtils.DistanceHeading heading = GeoUtils.vincenty_inverse(geoPos, geoPos2);
p.println(GammaConstants.HEADER_KEY_HEADING + sep + heading.heading1 + tab + "degrees");
}
代码示例来源:origin: senbox-org/s1tbx
xyz[2] = Maths.lagrangeEightOrderInterpolation(zPosArray, ref);
GeoUtils.cartesian2polar(xyz, phiLamHeight);
GeoUtils.geo2xyz(phiLamHeight[0] * Constants.RTOD, phiLamHeight[1] * Constants.RTOD, phiLamHeight[2], xyz, GeoUtils.EarthModel.GRS80);
代码示例来源:origin: senbox-org/s1tbx
/**
* Compute Earth radius (in meters) for given pixel in source image.
*
* @param lat The latitude of a given pixel in source image.
* @param lon The longitude of a given pixel in source image.
* @return The Earth radius.
*/
private static double computeEarthRadius(float lat, float lon) {
final double[] xyz = new double[3];
GeoUtils.geo2xyz(lat, lon, 0.0, xyz, GeoUtils.EarthModel.WGS84);
return Math.sqrt(xyz[0] * xyz[0] + xyz[1] * xyz[1] + xyz[2] * xyz[2]);
}
代码示例来源:origin: senbox-org/s1tbx
private void getMstApproxSceneCentreXYZ() throws Exception {
final int numOfBursts = subSwath[subSwathIndex - 1].numOfBursts;
mstSceneCentreXYZ = new Point[numOfBursts];
for (int b = 0; b < numOfBursts; b++) {
final double firstLineTime = subSwath[subSwathIndex - 1].burstFirstLineTime[b];
final double lastLineTime = subSwath[subSwathIndex - 1].burstLastLineTime[b];
final double slrTimeToFirstPixel = subSwath[subSwathIndex - 1].slrTimeToFirstPixel;
final double slrTimeToLastPixel = subSwath[subSwathIndex - 1].slrTimeToLastPixel;
final double latUL = su.getLatitude(firstLineTime, slrTimeToFirstPixel, subSwathIndex);
final double latUR = su.getLatitude(firstLineTime, slrTimeToLastPixel, subSwathIndex);
final double latLL = su.getLatitude(lastLineTime, slrTimeToFirstPixel, subSwathIndex);
final double latLR = su.getLatitude(lastLineTime, slrTimeToLastPixel, subSwathIndex);
final double lonUL = su.getLongitude(firstLineTime, slrTimeToFirstPixel, subSwathIndex);
final double lonUR = su.getLongitude(firstLineTime, slrTimeToLastPixel, subSwathIndex);
final double lonLL = su.getLongitude(lastLineTime, slrTimeToFirstPixel, subSwathIndex);
final double lonLR = su.getLongitude(lastLineTime, slrTimeToLastPixel, subSwathIndex);
final double lat = (latUL + latUR + latLL + latLR) / 4.0;
final double lon = (lonUL + lonUR + lonLL + lonLR) / 4.0;
final PosVector mstSceneCenter = new PosVector();
GeoUtils.geo2xyzWGS84(lat, lon, 0.0, mstSceneCenter);
mstSceneCentreXYZ[b] = new Point(mstSceneCenter.toArray());
}
}
代码示例来源:origin: senbox-org/s1tbx
GeoUtils.xyz2geo(sensorPos.toArray(), sensorGeoPos, GeoUtils.EarthModel.WGS84);
final double delLatMax = Math.abs(lat - sensorGeoPos.lat);
double delLonMax;
代码示例来源:origin: senbox-org/s1tbx
private synchronized void AddWindRecordsAsVectors(final List<WindFieldRecord> recordList) {
VectorDataNode vectorDataNode = targetProduct.getVectorDataGroup().get(VECTOR_NODE_NAME);
if (vectorDataNode == null) {
vectorDataNode = new VectorDataNode(VECTOR_NODE_NAME, windFeatureType);
targetProduct.getVectorDataGroup().add(vectorDataNode);
}
DefaultFeatureCollection collection = vectorDataNode.getFeatureCollection();
final GeometryFactory geometryFactory = new GeometryFactory();
final GeoCoding geoCoding = targetProduct.getSceneGeoCoding();
final GeoPos geoPos1 = new GeoPos();
final GeoPos geoPos2 = new GeoPos();
int c = collection.size();
for (WindFieldRecord rec : recordList) {
geoCoding.getGeoPos(new PixelPos(rec.x, rec.y), geoPos1);
geoCoding.getGeoPos(new PixelPos(rec.x + rec.dx, rec.y + rec.dy), geoPos2);
GeoUtils.DistanceHeading heading = GeoUtils.vincenty_inverse(geoPos1, geoPos2);
final SimpleFeatureBuilder fb = new SimpleFeatureBuilder(windFeatureType);
fb.add(geometryFactory.createPoint(new Coordinate(rec.x, rec.y)));
fb.add(rec.speed);
fb.add(heading.heading1);
fb.add(rec.dx);
fb.add(rec.dy);
fb.add(rec.ratio);
fb.add(STYLE_FORMAT);
final SimpleFeature feature = fb.buildFeature("wind_" + c);
collection.add(feature);
c++;
}
}
代码示例来源:origin: senbox-org/s1tbx
private void getMstApproxSceneCentreXYZ() throws Exception {
final int numOfBursts = subSwath[subSwathIndex - 1].numOfBursts;
mstSceneCentreXYZ = new Point[numOfBursts];
for (int b = 0; b < numOfBursts; b++) {
final double firstLineTime = subSwath[subSwathIndex - 1].burstFirstLineTime[b];
final double lastLineTime = subSwath[subSwathIndex - 1].burstLastLineTime[b];
final double slrTimeToFirstPixel = subSwath[subSwathIndex - 1].slrTimeToFirstPixel;
final double slrTimeToLastPixel = subSwath[subSwathIndex - 1].slrTimeToLastPixel;
final double latUL = su.getLatitude(firstLineTime, slrTimeToFirstPixel, subSwathIndex);
final double latUR = su.getLatitude(firstLineTime, slrTimeToLastPixel, subSwathIndex);
final double latLL = su.getLatitude(lastLineTime, slrTimeToFirstPixel, subSwathIndex);
final double latLR = su.getLatitude(lastLineTime, slrTimeToLastPixel, subSwathIndex);
final double lonUL = su.getLongitude(firstLineTime, slrTimeToFirstPixel, subSwathIndex);
final double lonUR = su.getLongitude(firstLineTime, slrTimeToLastPixel, subSwathIndex);
final double lonLL = su.getLongitude(lastLineTime, slrTimeToFirstPixel, subSwathIndex);
final double lonLR = su.getLongitude(lastLineTime, slrTimeToLastPixel, subSwathIndex);
final double lat = (latUL + latUR + latLL + latLR) / 4.0;
final double lon = (lonUL + lonUR + lonLL + lonLR) / 4.0;
final PosVector mstSceneCenter = new PosVector();
GeoUtils.geo2xyzWGS84(lat, lon, 0.0, mstSceneCenter);
mstSceneCentreXYZ[b] = new Point(mstSceneCenter.toArray());
}
}
代码示例来源:origin: senbox-org/s1tbx
/**
* Compute accurate target geo position.
*
* @param latMid The scene latitude.
* @param lonMid The scene longitude.
* @param slrgTime The slant range time of the given pixel.
* @param data The orbit data.
* @return The geo position of the target.
*/
private static GeoPos computeLatLon(final double latMid, final double lonMid, double slrgTime, Orbits.OrbitVector data) {
final double[] xyz = new double[3];
final GeoPos geoPos = new GeoPos(latMid, lonMid);
// compute initial (x,y,z) coordinate from lat/lon
GeoUtils.geo2xyz(geoPos, xyz);
// compute accurate (x,y,z) coordinate using Newton's method
GeoUtils.computeAccurateXYZ(data, xyz, slrgTime);
// compute (lat, lon, alt) from accurate (x,y,z) coordinate
GeoUtils.xyz2geo(xyz, geoPos);
return geoPos;
}
代码示例来源:origin: senbox-org/s1tbx
geoCoding.getGeoPos(new PixelPos(velocityData.slvGCPx[i][j], velocityData.slvGCPy[i][j]), slvGeoPos);
GeoUtils.DistanceHeading heading = GeoUtils.vincenty_inverse(mstGeoPos, slvGeoPos);
代码示例来源:origin: senbox-org/s1tbx
final PosVector downPoint = new PosVector();
GeoUtils.geo2xyzWGS84(lg.rightPointLat, lg.rightPointLon, rightPointHeight, rightPoint);
GeoUtils.geo2xyzWGS84(lg.leftPointLat, lg.leftPointLon, leftPointHeight, leftPoint);
GeoUtils.geo2xyzWGS84(lg.upPointLat, lg.upPointLon, upPointHeight, upPoint);
GeoUtils.geo2xyzWGS84(lg.downPointLat, lg.downPointLon, downPointHeight, downPoint);
final PosVector centrePoint = new PosVector();
GeoUtils.geo2xyzWGS84(lg.rightPointLat, lg.rightPointLon, rightPointHeight, rightPoint);
GeoUtils.geo2xyzWGS84(lg.leftPointLat, lg.leftPointLon, leftPointHeight, leftPoint);
GeoUtils.geo2xyzWGS84(lg.upPointLat, lg.upPointLon, upPointHeight, upPoint);
GeoUtils.geo2xyzWGS84(lg.downPointLat, lg.downPointLon, downPointHeight, downPoint);
GeoUtils.geo2xyzWGS84(geo.getLat(), geo.lon, centerHeight, centrePoint);
代码示例来源:origin: senbox-org/s1tbx
/**
* Compute accurate target geo position.
*
* @param latMid The scene latitude.
* @param lonMid The scene longitude.
* @param slrgTime The slant range time of the given pixel.
* @param data The orbit data.
* @return The geo position of the target.
*/
private static GeoPos computeLatLon(final double latMid, final double lonMid, double slrgTime, Orbits.OrbitVector data) {
final double[] xyz = new double[3];
final GeoPos geoPos = new GeoPos(latMid, lonMid);
// compute initial (x,y,z) coordinate from lat/lon
GeoUtils.geo2xyz(geoPos, xyz);
// compute accurate (x,y,z) coordinate using Newton's method
GeoUtils.computeAccurateXYZ(data, xyz, slrgTime);
// compute (lat, lon, alt) from accurate (x,y,z) coordinate
GeoUtils.xyz2geo(xyz, geoPos);
return geoPos;
}
代码示例来源:origin: senbox-org/s1tbx
protected void addCommonSARMetadata(final Product product) throws Exception {
if(product.getSceneGeoCoding() == null) {
return;
}
GeoPos geoPos = product.getSceneGeoCoding().getGeoPos(
new PixelPos(product.getSceneRasterWidth() / 2, product.getSceneRasterHeight() / 2), null);
GeoPos geoPos2 = product.getSceneGeoCoding().getGeoPos(
new PixelPos(product.getSceneRasterWidth() / 2, (product.getSceneRasterHeight() / 2) + 100), null);
GeoUtils.DistanceHeading heading = GeoUtils.vincenty_inverse(geoPos, geoPos2);
final MetadataElement absRoot = AbstractMetadata.getAbstractedMetadata(product);
AbstractMetadata.setAttribute(absRoot, "centre_lat", geoPos.getLat());
AbstractMetadata.setAttribute(absRoot, "centre_lon", geoPos.getLon());
AbstractMetadata.setAttribute(absRoot, "centre_heading", heading.heading1);
AbstractMetadata.setAttribute(absRoot, "centre_heading2", heading.heading2);
}
代码示例来源:origin: senbox-org/s1tbx
GeoUtils.geo2xyzWGS84(gp.lat, gp.lon, alt, posData.earthPoint);
if(mstSARPosition.getPosition(posData)) {
代码示例来源:origin: senbox-org/s1tbx
/**
* Compute accurate target geo position.
*
* @param refLat The scene latitude.
* @param refLon The scene longitude.
* @param slrgTime The slant range time of the given pixel.
* @param data The orbit data.
* @return The geo position of the target.
*/
private static GeoPos computeLatLon(final double refLat, final double refLon, double slrgTime, Orbits.OrbitVector data) {
final double[] xyz = new double[3];
final GeoPos geoPos = new GeoPos(refLat, refLon);
// compute initial (x,y,z) coordinate from lat/lon
GeoUtils.geo2xyz(geoPos, xyz);
// compute accurate (x,y,z) coordinate using Newton's method
GeoUtils.computeAccurateXYZ(data, xyz, slrgTime);
// compute (lat, lon, alt) from accurate (x,y,z) coordinate
GeoUtils.xyz2geo(xyz, geoPos);
return geoPos;
}
内容来源于网络,如有侵权,请联系作者删除!