本文整理汇总了Java中com.esri.core.geometry.Point.getY方法的典型用法代码示例。如果您正苦于以下问题:Java Point.getY方法的具体用法?Java Point.getY怎么用?Java Point.getY使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.esri.core.geometry.Point
的用法示例。
在下文中一共展示了Point.getY方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: process
import com.esri.core.geometry.Point; //导入方法依赖的package包/类
@Override
public GeoEvent process(GeoEvent ge) throws Exception {
// Operation phase...
if (radius == null) {
radius = (Double) ge.getField(bufferEventFld);
if (radius == null) {
Exception e = new Exception("Radius is not defined in geoevent");
throw (e);
}
}
MapGeometry mapGeo = ge.getGeometry();
Point eventGeo = (Point) mapGeo.getGeometry();
double x = eventGeo.getX();
double y = eventGeo.getY();
int inwkid = mapGeo.getSpatialReference().getID();
//int inwkid = eventGeo.getSpatialReference().getWkid();
Geometry buffer = constructBuffer(x, y, radius,
units, inwkid, bufferwkid, outwkid);
SpatialReference srOut = SpatialReference.create(outwkid);
MapGeometry outMapGeo = new MapGeometry(buffer, srOut);
ge.setGeometry(outMapGeo);
return ge;
}
示例2: constructRangeFan
import com.esri.core.geometry.Point; //导入方法依赖的package包/类
private Geometry constructRangeFan(double x, double y, double range,
String unit, double bearing, double traversal)
throws GeometryException {
Polygon fan = new Polygon();
Point center = new Point();
center.setX(x);
center.setY(y);
// SpatialReference srIn = SpatialReference.create(wkidin);
// SpatialReference srBuffer = SpatialReference.create(wkidbuffer);
// SpatialReference srOut = SpatialReference.create(wkidout);
Point centerProj = (Point) GeometryEngine.project(center, srIn,
srBuffer);
double centerX = centerProj.getX();
double centerY = centerProj.getY();
bearing = GeometryUtility.Geo2Arithmetic(bearing);
double leftAngle = bearing - (traversal / 2);
double rightAngle = bearing + (traversal / 2);
int count = (int) Math.round(Math.abs(leftAngle - rightAngle));
fan.startPath(centerProj);
UnitConverter uc = new UnitConverter();
range = uc.Convert(range, unit, srBuffer);
for (int i = 0; i < count; ++i) {
double d = Math.toRadians(leftAngle + i);
double arcX = centerX + (range * Math.cos(d));
double arcY = centerY + (range * Math.sin(d));
Point arcPt = new Point(arcX, arcY);
// arcPt = (Point) GeometryEngine.project(arcPt, srBuffer, srOut);
fan.lineTo(arcPt);
}
fan.closeAllPaths();
return fan;
}
示例3: _rotate
import com.esri.core.geometry.Point; //导入方法依赖的package包/类
private static Point _rotate(Point center, Point inPt, double ra)
{
double x = inPt.getX();
double y = inPt.getY();
double cx = center.getX();
double cy = center.getY();
double cosra = Math.cos(ra);
double sinra = Math.sin(ra);
double rx = cx + cosra * (x - cx) - sinra * (y - cy);
double ry = cy + sinra * (x - cx) + cosra * (y-cy);
Point rPt = new Point(rx,ry);
return rPt;
}
示例4: ellipsePtFromAngle
import com.esri.core.geometry.Point; //导入方法依赖的package包/类
private Point ellipsePtFromAngle(Point center, double rh, double rv, double angle)
{
double x = center.getX();
double y = center.getY();
double c = Math.cos(angle);
double s = Math.sin(angle);
double ta = s/c;
double tt = ta * (rh/rv);
double d = 1.0 / Math.sqrt(1.0 + Math.pow(tt, 2));
double ex = x + Math.copySign(rh*d, c);
double ey = y + Math.copySign(rv * tt * d, s);
return new Point(ex,ey);
}
示例5: toMapPoint
import com.esri.core.geometry.Point; //导入方法依赖的package包/类
@Override
public double[] toMapPoint(int screenX, int screenY) {
Point pt = toMapPointObject(screenX, screenY);
if (null == pt) {
return null;
} else {
return new double[] { pt.getX(), pt.getY() };
}
}
示例6: process
import com.esri.core.geometry.Point; //导入方法依赖的package包/类
@Override
public GeoEvent process(GeoEvent ge) throws Exception {
if(!ge.getGeoEventDefinition().getTagNames().contains("GEOMETRY"))
{
return null;
}
inwkid = ge.getGeometry().getSpatialReference().getID();
if(majAxisSource.equals("Event"))
{
majorAxisRadius = (Double)ge.getField(majorAxisField);
}
if(minAxisSource.equals("Event"))
{
minorAxisRadius = (Double)ge.getField(minorAxisField);
}
if(rotSource.equals("Event"))
{
rotation=(Double)ge.getField(rotationField);
}
MapGeometry mapGeo = ge.getGeometry();
Geometry geo = mapGeo.getGeometry();
if(!(geo instanceof Point))
{
return null;
}
Point eventGeo = (Point)geo;
double x = eventGeo.getX();
double y = eventGeo.getY();
double rdeg = GeometryUtility.Geo2Arithmetic(rotation);
double r = Math.toRadians(rdeg);
MapGeometry ellipse = constructEllipse(x, y, majorAxisRadius, minorAxisRadius, r, inwkid, procwkid, outwkid);
ge.setGeometry(ellipse);
return ge;
}
示例7: projectPoint
import com.esri.core.geometry.Point; //导入方法依赖的package包/类
@Override
public double[] projectPoint(double x, double y, int fromWkid, int toWkid) {
Point pt = (Point) GeometryEngine.project(new Point(x, y), SpatialReference.create(fromWkid), SpatialReference.create(toWkid));
return new double[] { pt.getX(), pt.getY() };
}
示例8: findBoundingBox
import com.esri.core.geometry.Point; //导入方法依赖的package包/类
private Geometry findBoundingBox(String mgrs, int accuracy, Point mgrsPt)
{
String mgrsZone = mgrs.substring(0, 1);
int wkid = 0;
String utm = null;
if(mgrsZone.equals("A") || mgrsZone.equals("B") )
{
wkid = 32761;
}
else if(mgrsZone.equals("Y") || mgrsZone.equals("Z"))
{
wkid = 32661;
}
else
{
PeGeogcs peGeoCS = PeFactory.geogcs(4326);
double[] coordArray = {mgrsPt.getX(), mgrsPt.getY()};
String[] utmArray = new String[1];
PeNotationUtm.geog_to_utm(peGeoCS, 1, coordArray, PeNotationUtm.PE_UTM_OPTS_NS, utmArray);
utm=utmArray[0];
wkid=GetWkidFromUTM(utm);
}
SpatialReference pcs = SpatialReference.create(wkid);
SpatialReference gcs = SpatialReference.create(4326);
Geometry projGeo = GeometryEngine.project(mgrsPt, gcs, pcs);//projec local
Point projPt = (Point)projGeo;
double dist = getDistFromAccuracy(accuracy);
double xmin, ymin, xmax, ymax;
xmin=projPt.getX();
ymin=projPt.getY();
xmax = xmin + dist;
ymax = ymin + dist;
Polygon pbb = new Polygon();
pbb.startPath(xmin, ymin);
pbb.lineTo(xmax, ymin);
pbb.lineTo(xmax, ymax);
pbb.lineTo(xmin, ymax);
pbb.lineTo(xmin, ymin);
pbb.closeAllPaths();
Geometry bb = GeometryEngine.project(pbb, pcs, gcs);//project back to wgs84
return bb;
}
示例9: process
import com.esri.core.geometry.Point; //导入方法依赖的package包/类
@Override
public GeoEvent process(GeoEvent evt) throws Exception {
MapGeometry mapGeo = (MapGeometry) evt.getField(geofld);
Geometry geo = mapGeo.getGeometry();
int wkid = mapGeo.getSpatialReference().getID();
if(wkid != 4326)
{
return null;
}
if(geo.getType() != Geometry.Type.Point)
{
return null;
}
Point pt = (Point)geo;
double[] coords = {pt.getX(), pt.getY()};
PeGeogcs pegeocs = PeFactory.geogcs(4326);
String[] mgrsvals = new String[1];
PeNotationMgrs.geog_to_mgrs(pegeocs, 1, coords, accuracy, false, mgrsvals);
String mgrs = mgrsvals[0];
//LL ll = new LL(pt.getX(), pt.getY());
//ll.setAccuracy(accuracy);
//MGRS2LatLongConverter converter = new MGRS2LatLongConverter();
//String mgrs = converter.LL2MRGS(ll);
GeoEventDefinition edOut;
GeoEventDefinition geoDef = evt.getGeoEventDefinition();
if((edOut=manager.searchGeoEventDefinition(newdef, getId()))==null)
{
edOut = geoDef.augment(fds);
edOut.setOwner(getId());
edOut.setName(newdef);
manager.addGeoEventDefinition(edOut);
}
GeoEventCreator geoEventCreator = messaging.createGeoEventCreator();
GeoEvent geOut = geoEventCreator.create(edOut.getGuid(), new Object[] {
evt.getAllFields(), mgrs });
geOut.setProperty(GeoEventPropertyName.TYPE, "message");
geOut.setProperty(GeoEventPropertyName.OWNER_ID, getId());
geOut.setProperty(GeoEventPropertyName.OWNER_ID, definition.getUri());
return geOut;
}