Convert a {@link Point} to a {@link GeoPoint}

@param point
@return
179853
public GeoPoint toLatLng2(Point point) {
        point = toWgs84(point);
        GeoPoint latLng = new GeoPoint(point.getY(), point.getX());
        return latLng;
    }
797991
public static Point mapToPoint(Map<String, Object> map) {
        return new Point(toSeleniumCoordinate(map.get("x")), toSeleniumCoordinate(map.get("y")));
    }
1138422
private Point asPoint(List coords, CrsId crsId) throws IOException {
        if (coords != null && coords.size() >= 2) {
            ArrayList<List> coordinates = new ArrayList<List>();
            coordinates.add(coords);
            return new Point(getPointSequence(coordinates, crsId));
        } else {
            throw new IOException("A point must has exactly one coordinate (an x, a y and possibly a z value). Additional numbers in the coordinate are permitted but ignored.");
        }
    }
1051506
@Pure
	public RoadSegment getNearestRoadSegment(Point2D<?, ?> point) {
		assert point != null;
		double distance = Double.MAX_VALUE;
		RoadSegment nearestSegment = null;
		final Iterator<RoadSegment> iterator = this.roadSegments.roadSegments();
		RoadSegment segment;
		while (iterator.hasNext()) {
			segment = iterator.next();
			final double d = segment.distance(point);
			if (d < distance) {
				distance = d;
				nearestSegment = segment;
			}
		}
		return nearestSegment;
	}
300985
public Geometry toGeometry(GoogleMapShape shape) {

        Geometry geometry = null;
        Object shapeObject = shape.getShape();

        switch (shape.getGeometryType()) {

            case POINT:
                LatLng point = null;
                switch (shape.getShapeType()) {
                    case LAT_LNG:
                        point = (LatLng) shapeObject;
                        break;
                    case MARKER_OPTIONS:
                        MarkerOptions markerOptions = (MarkerOptions) shapeObject;
                        point = markerOptions.getPosition();
                        break;
                    case MARKER:
                        Marker marker = (Marker) shapeObject;
                        point = marker.getPosition();
                        break;
                    default:
                        throw new GeoPackageException("Not a valid "
                                + shape.getGeometryType().getName() + " shape type: "
                                + shape.getShapeType());
                }
                if (point != null) {
                    geometry = toPoint(point);
                }

                break;
            case LINESTRING:
            case CIRCULARSTRING:
                List<LatLng> lineStringPoints = null;
                switch (shape.getShapeType()) {
                    case POLYLINE_OPTIONS:
                        PolylineOptions polylineOptions = (PolylineOptions) shapeObject;
                        lineStringPoints = polylineOptions.getPoints();
                        break;
                    case POLYLINE:
                        Polyline polyline = (Polyline) shapeObject;
                        lineStringPoints = polyline.getPoints();
                        break;
                    case POLYLINE_MARKERS:
                        PolylineMarkers polylineMarkers = (PolylineMarkers) shapeObject;
                        if (!polylineMarkers.isValid()) {
                            throw new GeoPackageException(
                                    PolylineMarkers.class.getSimpleName()
                                            + " is not valid to create "
                                            + shape.getGeometryType().getName());
                        }
                        if (!polylineMarkers.isDeleted()) {
                            lineStringPoints = getPointsFromMarkers(polylineMarkers
                                    .getMarkers());
                        }
                        break;
                    default:
                        throw new GeoPackageException("Not a valid "
                                + shape.getGeometryType().getName() + " shape type: "
                                + shape.getShapeType());
                }
                if (lineStringPoints != null) {
                    switch (shape.getGeometryType()) {
                        case LINESTRING:
                            geometry = toLineString(lineStringPoints);
                            break;
                        case CIRCULARSTRING:
                            geometry = toCircularString(lineStringPoints);
                            break;
                        default:
                            throw new GeoPackageException("Unhandled "
                                    + shape.getGeometryType().getName());
                    }
                }

                break;
            case POLYGON:
                List<LatLng> polygonPoints = null;
                List<List<LatLng>> holePointList = null;
                switch (shape.getShapeType()) {
                    case POLYGON_OPTIONS:
                        PolygonOptions polygonOptions = (PolygonOptions) shapeObject;
                        polygonPoints = polygonOptions.getPoints();
                        holePointList = polygonOptions.getHoles();
                        break;
                    case POLYGON:
                        com.google.android.gms.maps.model.Polygon polygon = (com.google.android.gms.maps.model.Polygon) shapeObject;
                        polygonPoints = polygon.getPoints();
                        holePointList = polygon.getHoles();
                        break;
                    case POLYGON_MARKERS:
                        PolygonMarkers polygonMarkers = (PolygonMarkers) shapeObject;
                        if (!polygonMarkers.isValid()) {
                            throw new GeoPackageException(
                                    PolygonMarkers.class.getSimpleName()
                                            + " is not valid to create "
                                            + shape.getGeometryType().getName());
                        }
                        if (!polygonMarkers.isDeleted()) {
                            polygonPoints = getPointsFromMarkers(polygonMarkers
                                    .getMarkers());
                            holePointList = new ArrayList<List<LatLng>>();
                            for (PolygonHoleMarkers hole : polygonMarkers.getHoles()) {
                                if (!hole.isDeleted()) {
                                    List<LatLng> holePoints = getPointsFromMarkers(hole
                                            .getMarkers());
                                    holePointList.add(holePoints);
                                }
                            }
                        }
                        break;
                    default:
                        throw new GeoPackageException("Not a valid "
                                + shape.getGeometryType().getName() + " shape type: "
                                + shape.getShapeType());
                }
                if (polygonPoints != null) {
                    geometry = toPolygon(polygonPoints, holePointList);
                }

                break;
            case MULTIPOINT:
                List<LatLng> multiPoints = null;
                switch (shape.getShapeType()) {
                    case MULTI_LAT_LNG:
                        MultiLatLng multiLatLng = (MultiLatLng) shapeObject;
                        multiPoints = multiLatLng.getLatLngs();
                        break;
                    case MULTI_MARKER:
                        MultiMarker multiMarker = (MultiMarker) shapeObject;
                        multiPoints = getPointsFromMarkers(multiMarker.getMarkers());
                        break;
                    default:
                        throw new GeoPackageException("Not a valid "
                                + shape.getGeometryType().getName() + " shape type: "
                                + shape.getShapeType());
                }
                if (multiPoints != null) {
                    geometry = toMultiPoint(multiPoints);
                }

                break;
            case MULTILINESTRING:
            case COMPOUNDCURVE:
                switch (shape.getShapeType()) {
                    case MULTI_POLYLINE_OPTIONS:
                        MultiPolylineOptions multiPolylineOptions = (MultiPolylineOptions) shapeObject;
                        switch (shape.getGeometryType()) {
                            case MULTILINESTRING:
                                geometry = toMultiLineStringFromOptions(multiPolylineOptions);
                                break;
                            case COMPOUNDCURVE:
                                geometry = toCompoundCurveFromOptions(multiPolylineOptions);
                                break;
                            default:
                                throw new GeoPackageException("Unhandled "
                                        + shape.getGeometryType().getName());
                        }
                        break;
                    case MULTI_POLYLINE:
                        MultiPolyline multiPolyline = (MultiPolyline) shapeObject;
                        switch (shape.getGeometryType()) {
                            case MULTILINESTRING:
                                geometry = toMultiLineString(multiPolyline.getPolylines());
                                break;
                            case COMPOUNDCURVE:
                                geometry = toCompoundCurve(multiPolyline.getPolylines());
                                break;
                            default:
                                throw new GeoPackageException("Unhandled "
                                        + shape.getGeometryType().getName());
                        }
                        break;
                    case MULTI_POLYLINE_MARKERS:
                        MultiPolylineMarkers multiPolylineMarkers = (MultiPolylineMarkers) shapeObject;
                        if (!multiPolylineMarkers.isValid()) {
                            throw new GeoPackageException(
                                    MultiPolylineMarkers.class.getSimpleName()
                                            + " is not valid to create "
                                            + shape.getGeometryType().getName());
                        }
                        if (!multiPolylineMarkers.isDeleted()) {
                            List<List<LatLng>> multiPolylineMarkersList = new ArrayList<List<LatLng>>();
                            for (PolylineMarkers polylineMarkers : multiPolylineMarkers
                                    .getPolylineMarkers()) {
                                if (!polylineMarkers.isDeleted()) {
                                    multiPolylineMarkersList
                                            .add(getPointsFromMarkers(polylineMarkers
                                                    .getMarkers()));
                                }
                            }
                            switch (shape.getGeometryType()) {
                                case MULTILINESTRING:
                                    geometry = toMultiLineStringFromList(multiPolylineMarkersList);
                                    break;
                                case COMPOUNDCURVE:
                                    geometry = toCompoundCurveFromList(multiPolylineMarkersList);
                                    break;
                                default:
                                    throw new GeoPackageException("Unhandled "
                                            + shape.getGeometryType().getName());
                            }
                        }
                        break;
                    default:
                        throw new GeoPackageException("Not a valid "
                                + shape.getGeometryType().getName() + " shape type: "
                                + shape.getShapeType());
                }

                break;
            case MULTIPOLYGON:
                switch (shape.getShapeType()) {
                    case MULTI_POLYGON_OPTIONS:
                        MultiPolygonOptions multiPolygonOptions = (MultiPolygonOptions) shapeObject;
                        geometry = toMultiPolygonFromOptions(multiPolygonOptions);
                        break;
                    case MULTI_POLYGON:
                        mil.nga.geopackage.map.geom.MultiPolygon multiPolygon = (mil.nga.geopackage.map.geom.MultiPolygon) shapeObject;
                        geometry = toMultiPolygon(multiPolygon.getPolygons());
                        break;
                    case MULTI_POLYGON_MARKERS:
                        MultiPolygonMarkers multiPolygonMarkers = (MultiPolygonMarkers) shapeObject;
                        if (!multiPolygonMarkers.isValid()) {
                            throw new GeoPackageException(
                                    MultiPolygonMarkers.class.getSimpleName()
                                            + " is not valid to create "
                                            + shape.getGeometryType().getName());
                        }
                        if (!multiPolygonMarkers.isDeleted()) {
                            List<Polygon> multiPolygonMarkersList = new ArrayList<Polygon>();
                            for (PolygonMarkers polygonMarkers : multiPolygonMarkers
                                    .getPolygonMarkers()) {

                                if (!polygonMarkers.isDeleted()) {

                                    List<LatLng> multiPolygonPoints = getPointsFromMarkers(polygonMarkers
                                            .getMarkers());
                                    List<List<LatLng>> multiPolygonHolePoints = new ArrayList<List<LatLng>>();
                                    for (PolygonHoleMarkers hole : polygonMarkers
                                            .getHoles()) {
                                        if (!hole.isDeleted()) {
                                            List<LatLng> holePoints = getPointsFromMarkers(hole
                                                    .getMarkers());
                                            multiPolygonHolePoints.add(holePoints);
                                        }
                                    }

                                    multiPolygonMarkersList
                                            .add(toPolygon(multiPolygonPoints,
                                                    multiPolygonHolePoints));
                                }

                            }
                            geometry = createMultiPolygon(multiPolygonMarkersList);
                        }
                        break;
                    default:
                        throw new GeoPackageException("Not a valid "
                                + shape.getGeometryType().getName() + " shape type: "
                                + shape.getShapeType());
                }
                break;

            case POLYHEDRALSURFACE:
            case TIN:
            case TRIANGLE:
                throw new GeoPackageException("Unsupported GeoPackage type: "
                        + shape.getGeometryType());
            case GEOMETRYCOLLECTION:
                @SuppressWarnings("unchecked")
                List<GoogleMapShape> shapeList = (List<GoogleMapShape>) shapeObject;
                GeometryCollection<Geometry> geometryCollection = new GeometryCollection<Geometry>(
                        false, false);
                for (GoogleMapShape shapeListItem : shapeList) {
                    Geometry subGeometry = toGeometry(shapeListItem);
                    if (subGeometry != null) {
                        geometryCollection.addGeometry(subGeometry);
                    }
                }
                if (geometryCollection.numGeometries() > 0) {
                    geometry = geometryCollection;
                }
                break;
            default:
        }

        return geometry;
    }
797042
public GeoPoint getCloseTo(GeoPoint point, double tolerance, MapView mapView) {
        return mOutline.getCloseTo(point, tolerance, mapView.getProjection(), false);
    }
32763
public static Point getCorner (Point center, Point size)
    {
        return new Point(center.x - size.x/2, center.y - size.y/2);
    }
569781
public SimpleFeature convertDwgPoint( String typeName, String layerName, DwgPoint point, int id ) {
        double[] p = point.getPoint();
        Point2D pto = new Point2D.Double(p[0], p[1]);

        CoordinateList coordList = new CoordinateList();
        Coordinate coord = new Coordinate(pto.getX(), pto.getY(), 0.0);
        coordList.add(coord);

        SimpleFeatureTypeBuilder b = new SimpleFeatureTypeBuilder();
        b.setName(typeName);
        b.setCRS(crs);
        b.add(THE_GEOM, MultiPoint.class);
        b.add(LAYER, String.class);
        SimpleFeatureType type = b.buildFeatureType();
        SimpleFeatureBuilder builder = new SimpleFeatureBuilder(type);
        Geometry points = gF.createMultiPoint(coordList.toCoordinateArray());
        Object[] values = new Object[]{points, layerName};
        builder.addAll(values);
        return builder.buildFeature(typeName + "." + id);
    }
1248633
public Point removePoint(String id) {
        Point removePoint = null;
        for (Point point : points)
            if (id.equals(point.getId()))
                removePoint = point;
        if (removePoint != null)
            points.remove(removePoint);
        return removePoint;
    }
120649
public Point getPointAt(double t)
	{
		if (Double.isNaN(t))
			return null;
		return new Point(origin.x + t * direction.x, origin.y + t * direction.y, origin.z + t * direction.z);
	}
183105
public Point3d getCoordinatesFromGridPoint(Point3d gridPoint) {
        double dx = minx + latticeConstant * gridPoint.x;
        double dy = miny + latticeConstant * gridPoint.y;
        double dz = minz + latticeConstant * gridPoint.z;
        return new Point3d(dx, dy, dz);
    }
796669
@Nonnull
    public static Point fromMicroDeg(final int latMicroDeg, final int lonMicroDeg) {
        final Point p = new Point();
        p.latMicroDeg = latMicroDeg;
        p.latFractionOnlyDeg = 0;
        p.lonMicroDeg = lonMicroDeg;
        p.lonFractionOnlyDeg = 0;
        p.defined = true;
        return p.wrap();
    }
345717
public static Geometry addPoint(Geometry geometry, Point point) throws SQLException {
        return addPoint(geometry, point, PRECISION);
    }
657586
@Pure
	public final BusItineraryHalt getNearestBusHalt(GeoLocationPoint point) {
		return getNearestBusHalt(point.getX(), point.getY());
	}
1115074
private Point parsePoint(String point) {
    int comma = point.indexOf(',');
    if (comma == -1)
      return null;

    float lat = Float.valueOf(point.substring(0, comma));
    float lng = Float.valueOf(point.substring(comma + 1));
    return spatialctx.makePoint(lng, lat);
  }
1027759
public OGCPoint getPoint(DeferredObject[] args) {
		OGCGeometry geometry = getGeometry(args);
		
		if (geometry instanceof OGCPoint) {
			return (OGCPoint)geometry;
		} else {
			return null;
		}
	}
889611
public GeoPosition pixelToGeo(Point2D pixelCoordinate, int zoom)
    {
        return GeoUtil.getPosition(pixelCoordinate, zoom, getInfo());
    }