Exports this geometric object to a specific Well-known Binary Representation of
Geometry.

@return binary representation
320388
public SimpleExpression<byte[]> asBinary() {
        if (binary == null) {
            binary = Expressions.operation(byte[].class, SpatialOps.AS_BINARY, mixin);
        }
        return binary;
    }
1326175
protected byte[] byteBufferToByteArray() {
        if (byteBuffer.hasArray()) {
            return byteBuffer.array();
        } else {
            final byte[] byteArray = new byte[byteBuffer.remaining()];
            byteBuffer.get(byteArray);
            return byteArray;
        }
    }
976402
public function export()
    {
        $out = array();
        if (Encoding::is_binary_data($this->content)) {
            $out['content-bin'] = base64_encode($this->content);
        } else {
            $out['content'] = $this->content;
        }
        return $out;
    }
1013792
protected CBORObject EncodeToCBORObject() throws CoseException {
        if (rgbSignature == null) throw new CoseException("Message not yet signed");
        if (rgbProtected == null) throw new CoseException("Internal Error");
        CBORObject obj = CBORObject.NewArray();
        
        obj.Add(rgbProtected);
        obj.Add(objUnprotected);
        obj.Add(rgbSignature);
        
        return obj;
    }
872132
@Override
	public BitVector bitVector() {
		final LongArrayBitVector result = LongArrayBitVector.ofLength(n);
		for(long i = length; i-- != 0;) result.set(select(i));
		return result;
	}

	@Override
	public int hashCode() {
		return System.identityHashCode(this);
	}

	@Override
	public boolean equals(final Object o) {
		return o == this;
	}

	@Override
	public String toString() {
		return getClass().getName() + '@' + Integer.toHexString(hashCode());
	}
}
49187
@Override
	public Matrix4d getGeometicCenterTransformation() {
		run();

		Matrix4d geometricCentered = new Matrix4d(reverseTransformationMatrix);
		geometricCentered.setTranslation(new Vector3d(getGeometricCenter()));

		return geometricCentered;
	}
1033327
public ByteBuffer getWkbByteBuffer() {
		return ByteBuffer.wrap(bytes, wkbGeometryIndex,
				bytes.length - wkbGeometryIndex).order(byteOrder);
	}
342439
public String getGeometryType() {
      String geometryType = null;
      if (getParameters().length > 0 && getParameters()[0] != null) {
         geometryType = getParameters()[0].toString();
      }
      return geometryType;
   }
687864
public Polygon getHull() {
    if(!ok) {
      computeConvexHull();
    }
    return new Polygon(points, minmaxX.getMin(), minmaxX.getMax(), minmaxY.getMin(), minmaxY.getMax());
  }
277001
private AffineTransform getAlignmentTransform() {
        final int offsetX;
        switch (this.settings.getParams().getAlign()) {
            case LEFT:
                offsetX = 0;
                break;
            case RIGHT:
                offsetX = this.settings.getMaxSize().width - this.settings.getSize().width;
                break;
            case CENTER:
            default:
                offsetX = (int) Math
                        .floor(this.settings.getMaxSize().width / 2.0 - this.settings.getSize().width / 2.0);
                break;
        }

        final int offsetY;
        switch (this.settings.getParams().getVerticalAlign()) {
            case TOP:
                offsetY = 0;
                break;
            case BOTTOM:
                offsetY = this.settings.getMaxSize().height - this.settings.getSize().height;
                break;
            case MIDDLE:
            default:
                offsetY = (int) Math.floor(this.settings.getMaxSize().height / 2.0 -
                                                   this.settings.getSize().height / 2.0);
                break;
        }

        return AffineTransform.getTranslateInstance(Math.round(offsetX), Math.round(offsetY));
    }
1123071
public static VectorTile.Tile.GeomType toGeomType(Geometry geometry) {
        VectorTile.Tile.GeomType result = VectorTile.Tile.GeomType.UNKNOWN;

        if(geometry instanceof Point
                || geometry instanceof MultiPoint) {
            result = VectorTile.Tile.GeomType.POINT;

        } else if(geometry instanceof LineString
                || geometry instanceof MultiLineString) {
            result = VectorTile.Tile.GeomType.LINESTRING;

        } else if(geometry instanceof Polygon
                || geometry instanceof MultiPolygon) {
            result = VectorTile.Tile.GeomType.POLYGON;
        }

        return result;
    }
726659
def to_edgelist(self):
        
        # save cleaned edges
        export = []
        # loop through (node, node, edge attributes)
        for edge in nx.to_edgelist(self.transforms):
            a, b, c = edge
            # geometry is a node property but save it to the
            # edge so we don't need two dictionaries
            if 'geometry' in self.transforms.node[b]:
                c['geometry'] = self.transforms.node[b]['geometry']
            # save the matrix as a float list
            c['matrix'] = np.asanyarray(c['matrix'], dtype=np.float64).tolist()
            export.append((a, b, c))
        return export
875991
public GeoJsonTo toTransferObject(Geometry geometry) {

        if (geometry instanceof Point) {
            return toTransferObject((Point) geometry);
        } else if (geometry instanceof LineString) {
            return toTransferObject((LineString) geometry);
        } else if (geometry instanceof MultiPoint) {
            return toTransferObject((MultiPoint) geometry);
        } else if (geometry instanceof MultiLineString) {
            return toTransferObject((MultiLineString) geometry);
        } else if (geometry instanceof Polygon) {
            return toTransferObject((Polygon) geometry);
        } else if (geometry instanceof MultiPolygon) {
            return toTransferObject((MultiPolygon) geometry);
        } else if (geometry instanceof GeometryCollection) {
            return toTransferObject((GeometryCollection) geometry);
        }
        return null;
    }
503147
public Geometry createGeometry(Geometry geometry) {
		if (geometry instanceof Point) {
			return createPoint(geometry.getCoordinate());
		} else if (geometry instanceof LinearRing) {
			return createLinearRing(geometry.getCoordinates());
		} else if (geometry instanceof LineString) {
			return createLineString(geometry.getCoordinates());
		} else if (geometry instanceof Polygon) {
			Polygon polygon = (Polygon) geometry;
			LinearRing exteriorRing = createLinearRing(polygon.getExteriorRing().getCoordinates());
			LinearRing[] interiorRings = new LinearRing[polygon.getNumInteriorRing()];
			for (int n = 0; n < polygon.getNumInteriorRing(); n++) {
				interiorRings[n] = createLinearRing(polygon.getInteriorRingN(n).getCoordinates());
			}
			return new Polygon(srid, precision, exteriorRing, interiorRings);
		} else if (geometry instanceof MultiPoint) {
			Point[] clones = new Point[geometry.getNumGeometries()];
			for (int n = 0; n < geometry.getNumGeometries(); n++) {
				clones[n] = createPoint(geometry.getGeometryN(n).getCoordinate());
			}
			return new MultiPoint(srid, precision, clones);
		} else if (geometry instanceof MultiLineString) {
			LineString[] clones = new LineString[geometry.getNumGeometries()];
			for (int n = 0; n < geometry.getNumGeometries(); n++) {
				clones[n] = createLineString(geometry.getGeometryN(n).getCoordinates());
			}
			return new MultiLineString(srid, precision, clones);
		} else if (geometry instanceof MultiPolygon) {
			Polygon[] clones = new Polygon[geometry.getNumGeometries()];
			for (int n = 0; n < geometry.getNumGeometries(); n++) {
				clones[n] = (Polygon) createGeometry(geometry.getGeometryN(n));
			}
			return new MultiPolygon(srid, precision, clones);
		}
		return null;
	}
52374
public byte[] getOctets() {
        byte[] octets = new byte[8];
        long bits = this.bits;
        for (int n = 8; --n >= 0; bits >>= 8) {
            octets[n] = (byte) (bits & 0xff);
        }
        return octets;
    }
1936
public JsonObject export() {
        JsonObject result = JsonObject.create();
        for (MutationToken token : tokens) {
            JsonObject bucket = result.getObject(token.bucket());
            if (bucket == null) {
                bucket = JsonObject.create();
                result.put(token.bucket(), bucket);
            }

            bucket.put(
                String.valueOf(token.vbucketID()),
                JsonArray.from(token.sequenceNumber(), String.valueOf(token.vbucketUUID()))
            );
        }
        return result;
    }
719655
public Shape convert2Spatial4j() {
        switch(getType()) {
            case POINT: return getPoint().getSpatial4jPoint();
            case CIRCLE: return CTX.makeCircle(getPoint(0).getSpatial4jPoint(), DistanceUtils.dist2Degrees(getRadius(), DistanceUtils.EARTH_MEAN_RADIUS_KM));
            case BOX: return CTX.makeRectangle(getPoint(0).getSpatial4jPoint(),getPoint(1).getSpatial4jPoint());
            case POLYGON: throw new UnsupportedOperationException("Not yet supported");
            default: throw new IllegalStateException("Unrecognized type: " + getType());
        }
    }