Return footprint center in world coordinates, as GeoVector.
334061
def center(self):
        """"""
        image_center = Point(self.width / 2, self.height / 2)
        return self.to_world(image_center)
539585
function geocentricToGeodetic(p, es, a, b) {
        /* local defintions and variables */
        /* end-criterium of loop, accuracy of sin(Latitude) */
        var genau = 1e-12;
        var genau2 = (genau * genau);
        var maxiter = 30;

        var P; /* distance between semi-minor axis and location */
        var RR; /* distance between center and location */
        var CT; /* sin of geocentric latitude */
        var ST; /* cos of geocentric latitude */
        var RX;
        var RK;
        var RN; /* Earth radius at location */
        var CPHI0; /* cos of start or old geodetic latitude in iterations */
        var SPHI0; /* sin of start or old geodetic latitude in iterations */
        var CPHI; /* cos of searched geodetic latitude */
        var SPHI; /* sin of searched geodetic latitude */
        var SDPHI; /* end-criterium: addition-theorem of sin(Latitude(iter)-Latitude(iter-1)) */
        var iter; /* # of continous iteration, max. 30 is always enough (s.a.) */

        var X = p.x;
        var Y = p.y;
        var Z = p.z ? p.z : 0.0; //Z value not always supplied
        var Longitude;
        var Latitude;
        var Height;

        P = Math.sqrt(X * X + Y * Y);
        RR = Math.sqrt(X * X + Y * Y + Z * Z);

        /*      special cases for latitude and longitude */
        if (P / a < genau) {

            /*  special case, if P=0. (X=0., Y=0.) */
            Longitude = 0.0;

            /*  if (X,Y,Z)=(0.,0.,0.) then Height becomes semi-minor axis
             *  of ellipsoid (=center of mass), Latitude becomes PI/2 */
            if (RR / a < genau) {
                Latitude = HALF_PI;
                Height = -b;
                return {
                    x: p.x,
                    y: p.y,
                    z: p.z
                };
            }
        } else {
            /*  ellipsoidal (geodetic) longitude
             *  interval: -PI < Longitude <= +PI */
            Longitude = Math.atan2(Y, X);
        }

        /* --------------------------------------------------------------
         * Following iterative algorithm was developped by
         * "Institut for Erdmessung", University of Hannover, July 1988.
         * Internet: www.ife.uni-hannover.de
         * Iterative computation of CPHI,SPHI and Height.
         * Iteration of CPHI and SPHI to 10**-12 radian resp.
         * 2*10**-7 arcsec.
         * --------------------------------------------------------------
         */
        CT = Z / RR;
        ST = P / RR;
        RX = 1.0 / Math.sqrt(1.0 - es * (2.0 - es) * ST * ST);
        CPHI0 = ST * (1.0 - es) * RX;
        SPHI0 = CT * RX;
        iter = 0;

        /* loop to find sin(Latitude) resp. Latitude
         * until |sin(Latitude(iter)-Latitude(iter-1))| < genau */
        do {
            iter++;
            RN = a / Math.sqrt(1.0 - es * SPHI0 * SPHI0);

            /*  ellipsoidal (geodetic) height */
            Height = P * CPHI0 + Z * SPHI0 - RN * (1.0 - es * SPHI0 * SPHI0);

            RK = es * RN / (RN + Height);
            RX = 1.0 / Math.sqrt(1.0 - RK * (2.0 - RK) * ST * ST);
            CPHI = ST * (1.0 - RK) * RX;
            SPHI = CT * RX;
            SDPHI = SPHI * CPHI0 - CPHI * SPHI0;
            CPHI0 = CPHI;
            SPHI0 = SPHI;
        }
        while (SDPHI * SDPHI > genau2 && iter < maxiter);

        /*      ellipsoidal (geodetic) latitude */
        Latitude = Math.atan(SPHI / Math.abs(CPHI));
        return {
            x: Longitude,
            y: Latitude,
            z: Height
        };
    }
1125892
def get_center_offset(self):
        
        return (-self.view_rect.centerx + self._half_width,
                -self.view_rect.centery + self._half_height)
694847
def getCenter(self):
        '''
        
        '''

        (left, top), (right, bottom) = self.getCoords()
        x = left + (right - left) / 2
        y = top + (bottom - top) / 2
        return (x, y)
424421
def _get_y_axis(self):
        """"""
        # 0,0 is top/left top top/left pixel. Actual x/y coord of that pixel are (.5,.5).
        y_centers = np.linspace(.5, self.y_size - .5, self.y_size)
        x_centers = y_centers * 0
        return (self.geotransform[3]
                + self.geotransform[4] * x_centers
                + self.geotransform[5] * y_centers)
1352254
def a(self):
        '''
        

        '''
        a = Point(self.center)

        if self.xAxisIsMajor:
            a.x += self.majorRadius
        else:
            a.y += self.majorRadius
        return a
667347
private Coordinate calcCenterFromPoint(final Coordinate worldCenter) {
		double xCenter = worldCenter.getX();
		double yCenter = worldCenter.getY();
		if (maxBounds != null) {
			Coordinate minCoordinate = maxBounds.getOrigin();
			Coordinate maxCoordinate = maxBounds.getEndPoint();

			if (BoundsLimitOption.COMPLETELY_WITHIN_MAX_BOUNDS.equals(viewBoundsLimitOption)) {
				/** View must lay completely within maxBounds. **/
				double w = getViewSpaceWidth() / 2;
				double h = getViewSpaceHeight() / 2;
	
				if ((w * 2) > maxBounds.getWidth()) {
					xCenter = maxBounds.getCenterPoint().getX();
				} else {
					if ((xCenter - w) < minCoordinate.getX()) {
						xCenter = minCoordinate.getX() + w;
					}
					if ((xCenter + w) > maxCoordinate.getX()) {
						xCenter = maxCoordinate.getX() - w;
					}
				}
				if ((h * 2) > maxBounds.getHeight()) {
					yCenter = maxBounds.getCenterPoint().getY();
				} else {
					if ((yCenter - h) < minCoordinate.getY()) {
						yCenter = minCoordinate.getY() + h;
					}
					if ((yCenter + h) > maxCoordinate.getY()) {
						yCenter = maxCoordinate.getY() - h;
					}
				}
			} else if (BoundsLimitOption.CENTER_WITHIN_MAX_BOUNDS.equals(viewBoundsLimitOption)) {
				/** Center of view must lay within maxBounds. **/
				Coordinate center = new Coordinate(xCenter, yCenter);
				if (!maxBounds.contains(center)) {
					if (xCenter < minCoordinate.getX()) {
						xCenter = minCoordinate.getX();
					} else if (xCenter > maxCoordinate.getX()) {
						xCenter = maxCoordinate.getX();
					}
					if (yCenter < minCoordinate.getY()) {
						yCenter = minCoordinate.getY();
					} else if (yCenter > maxCoordinate.getY()) {
						yCenter = maxCoordinate.getY();
					}
				}
			}
		}
		return new Coordinate(xCenter, yCenter);
	}
1203847
def coords_for_computations(self):
        

        # TODO: need to subtract the position offset if a Mesh (in orbit)
        if self._compute_at_vertices:
            if self.pvertices is not None:
                return self.pvertices - self._pos_center
            else:
                return self.vertices - self._pos_center
        else:
            return self.centers - self._pos_center
131968
def within(self, lat, lon, radius):
		'''
		
		'''
		self._geo = { "$circle": { 
						"$center": [
							factual.common.shared_filter_helpers.GeoScalar(lat), 
							factual.common.shared_filter_helpers.GeoScalar(lon), 
							], 
						"$meters": radius 
						}
					}
		return self
669543
def get_geoid_offset(ds, geoid_srs=egm08_srs):
    
    ds_srs = get_ds_srs(ds)
    c = get_center(ds)
    x, y, z = cT_helper(c[0], c[1], 0.0, ds_srs, geoid_srs)
    return z
503815
def unit_vector(self):
        """"""
        return Point2D( self.x / self.magnitude, self.y / self.magnitude )
1367101
def geoid(self):
        """""""

        if self.valuetype_class.is_geoid():
            return self

        for c in self.table.columns:
            if c.parent == self.name and  c.valuetype_class.is_geoid():
                return c
991561
def com(self):
        """"""
        return (self.coordinates*self.masses.reshape((-1,1))).sum(axis=0)/self.mass
1188240
function centerGeometry(object) {
      var pseudoNode = _.clone(object);
      pseudoNode.lat = object.center.lat;
      pseudoNode.lon = object.center.lon;
      pseudoNode.__is_center_placeholder = true;
      nodes.push(pseudoNode);
    }
1158504
function getCenter(points) {
        var center = {x: 0, y: 0};
        for (var i =0; i < points.length; ++i ) {
            center.x += points[i].x;
            center.y += points[i].y;
        }
        center.x /= points.length;
        center.y /= points.length;
        return center;
    }
1062010
function getCentroidFeatureForPolygon (coordinates, properties, newProperties) {
    let centroid = Geo.centroid(coordinates);
    if (!centroid) {
        return;
    }

    // clone properties and mixix newProperties
    let centroid_properties = {};
    Object.assign(centroid_properties, properties, newProperties);

    return {
        type: 'Feature',
        properties: centroid_properties,
        geometry: {
            type: 'Point',
            coordinates: centroid
        }
    };
}
962456
def coordinate(self):
    
    return M2Coordinate(org=self.org, name=self.name, rev=self.rev, classifier=self.classifier,
                        ext=self.ext)