mil.nga.sf.MultiPoint Java Examples

The following examples show how to use mil.nga.sf.MultiPoint. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: GeoPackageGeometryDataUtils.java    From geopackage-java with MIT License 5 votes vote down vote up
/**
 * Compare the two multi points for equality
 * 
 * @param expected
 * @param actual
 * @param delta
 */
private static void compareMultiPoint(MultiPoint expected,
		MultiPoint actual, double delta) {

	compareBaseGeometryAttributes(expected, actual);
	TestCase.assertEquals(expected.numPoints(), actual.numPoints());
	for (int i = 0; i < expected.numPoints(); i++) {
		comparePoint(expected.getPoints().get(i),
				actual.getPoints().get(i), delta);
	}
}
 
Example #2
Source File: FeatureUtils.java    From geopackage-java with MIT License 5 votes vote down vote up
/**
 * Validate Multi Point
 * 
 * @param topGeometry
 * @param multiPoint
 */
private static void validateMultiPoint(Geometry topGeometry,
		MultiPoint multiPoint) {

	TestCase.assertEquals(GeometryType.MULTIPOINT,
			multiPoint.getGeometryType());

	validateZAndM(topGeometry, multiPoint);

	for (Point point : multiPoint.getPoints()) {
		validatePoint(topGeometry, point);
	}

}
 
Example #3
Source File: GoogleMapShapeConverter.java    From geopackage-android-map with MIT License 5 votes vote down vote up
/**
 * Convert a {@link MultiLatLng} to a {@link MultiPoint}
 *
 * @param latLngs lat lngs
 * @param hasZ    has z flag
 * @param hasM    has m flag
 * @return multi point
 */
public MultiPoint toMultiPoint(List<LatLng> latLngs, boolean hasZ,
                               boolean hasM) {

    MultiPoint multiPoint = new MultiPoint(hasZ, hasM);

    for (LatLng latLng : latLngs) {
        Point point = toPoint(latLng);
        multiPoint.addPoint(point);
    }

    return multiPoint;
}
 
Example #4
Source File: GeoPackageGeometryDataUtils.java    From geopackage-android with MIT License 5 votes vote down vote up
/**
 * Compare the two multi points for equality
 *
 * @param expected
 * @param actual
 * @param delta
 */
private static void compareMultiPoint(MultiPoint expected,
                                      MultiPoint actual, double delta) {

    compareBaseGeometryAttributes(expected, actual);
    TestCase.assertEquals(expected.numPoints(), actual.numPoints());
    for (int i = 0; i < expected.numPoints(); i++) {
        comparePoint(expected.getPoints().get(i),
                actual.getPoints().get(i), delta);
    }
}
 
Example #5
Source File: GoogleMapShapeConverterUtils.java    From geopackage-android-map with MIT License 5 votes vote down vote up
/**
 * Test the MultiPoint conversion
 * 
 * @param converter
 * @param multiPoint
 */
private static void convertMultiPoint(GoogleMapShapeConverter converter,
		MultiPoint multiPoint) {

	MultiLatLng latLngs = converter.toLatLngs(multiPoint);
	TestCase.assertNotNull(latLngs);
	TestCase.assertFalse(latLngs.getLatLngs().isEmpty());

	List<Point> points = multiPoint.getPoints();
	comparePointsAndLatLngs(converter, points, latLngs.getLatLngs());

	MultiPoint multiPoint2 = converter.toMultiPoint(latLngs);
	comparePoints(multiPoint.getPoints(), multiPoint2.getPoints());
}
 
Example #6
Source File: GoogleMapShapeConverter.java    From geopackage-android-map with MIT License 5 votes vote down vote up
/**
 * Convert a {@link MultiPoint} to a {@link MultiLatLng}
 *
 * @param multiPoint multi point
 * @return multi lat lng
 */
public MultiLatLng toLatLngs(MultiPoint multiPoint) {

    MultiLatLng multiLatLng = new MultiLatLng();

    for (Point point : multiPoint.getPoints()) {
        LatLng latLng = toLatLng(point);
        multiLatLng.add(latLng);
    }

    return multiLatLng;
}
 
Example #7
Source File: FeatureUtils.java    From geopackage-android with MIT License 5 votes vote down vote up
/**
 * Validate Multi Point
 *
 * @param topGeometry
 * @param multiPoint
 */
private static void validateMultiPoint(Geometry topGeometry,
                                       MultiPoint multiPoint) {

    TestCase.assertEquals(GeometryType.MULTIPOINT,
            multiPoint.getGeometryType());

    validateZAndM(topGeometry, multiPoint);

    for (Point point : multiPoint.getPoints()) {
        validatePoint(topGeometry, point);
    }

}
 
Example #8
Source File: DefaultFeatureTiles.java    From geopackage-android with MIT License 4 votes vote down vote up
/**
 * Draw the geometry on the canvas
 *
 * @param simplifyTolerance simplify tolerance in meters
 * @param boundingBox       bounding box
 * @param transform         projection transform
 * @param canvas            feature tile canvas
 * @param featureRow        feature row
 * @param geometry          feature geometry
 * @return true if drawn
 */
private boolean drawShape(double simplifyTolerance, BoundingBox boundingBox, ProjectionTransform transform, FeatureTileCanvas canvas, FeatureRow featureRow, Geometry geometry) {

    boolean drawn = false;

    GeometryType geometryType = geometry.getGeometryType();
    FeatureStyle featureStyle = getFeatureStyle(featureRow, geometryType);

    switch (geometryType) {

        case POINT:
            Point point = (Point) geometry;
            drawn = drawPoint(boundingBox, transform, canvas, point, featureStyle);
            break;
        case LINESTRING:
        case CIRCULARSTRING:
            LineString lineString = (LineString) geometry;
            Path linePath = new Path();
            addLineString(simplifyTolerance, boundingBox, transform, linePath, lineString);
            drawn = drawLinePath(canvas, linePath, featureStyle);
            break;
        case POLYGON:
        case TRIANGLE:
            Polygon polygon = (Polygon) geometry;
            Path polygonPath = new Path();
            addPolygon(simplifyTolerance, boundingBox, transform, polygonPath, polygon);
            drawn = drawPolygonPath(canvas, polygonPath, featureStyle);
            break;
        case MULTIPOINT:
            MultiPoint multiPoint = (MultiPoint) geometry;
            for (Point pointFromMulti : multiPoint.getPoints()) {
                drawn = drawPoint(boundingBox, transform, canvas, pointFromMulti, featureStyle) || drawn;
            }
            break;
        case MULTILINESTRING:
            MultiLineString multiLineString = (MultiLineString) geometry;
            Path multiLinePath = new Path();
            for (LineString lineStringFromMulti : multiLineString.getLineStrings()) {
                addLineString(simplifyTolerance, boundingBox, transform, multiLinePath, lineStringFromMulti);
            }
            drawn = drawLinePath(canvas, multiLinePath, featureStyle);
            break;
        case MULTIPOLYGON:
            MultiPolygon multiPolygon = (MultiPolygon) geometry;
            Path multiPolygonPath = new Path();
            for (Polygon polygonFromMulti : multiPolygon.getPolygons()) {
                addPolygon(simplifyTolerance, boundingBox, transform, multiPolygonPath, polygonFromMulti);
            }
            drawn = drawPolygonPath(canvas, multiPolygonPath, featureStyle);
            break;
        case COMPOUNDCURVE:
            CompoundCurve compoundCurve = (CompoundCurve) geometry;
            Path compoundCurvePath = new Path();
            for (LineString lineStringFromCompoundCurve : compoundCurve.getLineStrings()) {
                addLineString(simplifyTolerance, boundingBox, transform, compoundCurvePath, lineStringFromCompoundCurve);
            }
            drawn = drawLinePath(canvas, compoundCurvePath, featureStyle);
            break;
        case POLYHEDRALSURFACE:
        case TIN:
            PolyhedralSurface polyhedralSurface = (PolyhedralSurface) geometry;
            Path polyhedralSurfacePath = new Path();
            for (Polygon polygonFromPolyhedralSurface : polyhedralSurface.getPolygons()) {
                addPolygon(simplifyTolerance, boundingBox, transform, polyhedralSurfacePath, polygonFromPolyhedralSurface);
            }
            drawn = drawPolygonPath(canvas, polyhedralSurfacePath, featureStyle);
            break;
        case GEOMETRYCOLLECTION:
            @SuppressWarnings("unchecked")
            GeometryCollection<Geometry> geometryCollection = (GeometryCollection) geometry;
            List<Geometry> geometries = geometryCollection.getGeometries();
            for (Geometry geometryFromCollection : geometries) {
                drawn = drawShape(simplifyTolerance, boundingBox, transform, canvas, featureRow, geometryFromCollection) || drawn;
            }
            break;
        default:
            throw new GeoPackageException("Unsupported Geometry Type: "
                    + geometry.getGeometryType().getName());
    }

    return drawn;
}
 
Example #9
Source File: GeoPackageGeometryDataUtils.java    From geopackage-java with MIT License 4 votes vote down vote up
/**
 * Compare two geometries and verify they are equal
 * 
 * @param expected
 * @param actual
 * @param delta
 */
public static void compareGeometries(Geometry expected, Geometry actual,
		double delta) {
	if (expected == null) {
		TestCase.assertNull(actual);
	} else {
		TestCase.assertNotNull(actual);

		GeometryType geometryType = expected.getGeometryType();
		switch (geometryType) {

		case GEOMETRY:
			TestCase.fail("Unexpected Geometry Type of "
					+ geometryType.name() + " which is abstract");
		case POINT:
			comparePoint((Point) expected, (Point) actual, delta);
			break;
		case LINESTRING:
			compareLineString((LineString) expected, (LineString) actual,
					delta);
			break;
		case POLYGON:
			comparePolygon((Polygon) expected, (Polygon) actual, delta);
			break;
		case MULTIPOINT:
			compareMultiPoint((MultiPoint) expected, (MultiPoint) actual,
					delta);
			break;
		case MULTILINESTRING:
			compareMultiLineString((MultiLineString) expected,
					(MultiLineString) actual, delta);
			break;
		case MULTIPOLYGON:
			compareMultiPolygon((MultiPolygon) expected,
					(MultiPolygon) actual, delta);
			break;
		case GEOMETRYCOLLECTION:
			compareGeometryCollection((GeometryCollection<?>) expected,
					(GeometryCollection<?>) actual, delta);
			break;
		case CIRCULARSTRING:
			compareCircularString((CircularString) expected,
					(CircularString) actual, delta);
			break;
		case COMPOUNDCURVE:
			compareCompoundCurve((CompoundCurve) expected,
					(CompoundCurve) actual, delta);
			break;
		case CURVEPOLYGON:
			compareCurvePolygon((CurvePolygon<?>) expected,
					(CurvePolygon<?>) actual, delta);
			break;
		case MULTICURVE:
			TestCase.fail("Unexpected Geometry Type of "
					+ geometryType.name() + " which is abstract");
		case MULTISURFACE:
			TestCase.fail("Unexpected Geometry Type of "
					+ geometryType.name() + " which is abstract");
		case CURVE:
			TestCase.fail("Unexpected Geometry Type of "
					+ geometryType.name() + " which is abstract");
		case SURFACE:
			TestCase.fail("Unexpected Geometry Type of "
					+ geometryType.name() + " which is abstract");
		case POLYHEDRALSURFACE:
			comparePolyhedralSurface((PolyhedralSurface) expected,
					(PolyhedralSurface) actual, delta);
			break;
		case TIN:
			compareTIN((TIN) expected, (TIN) actual, delta);
			break;
		case TRIANGLE:
			compareTriangle((Triangle) expected, (Triangle) actual, delta);
			break;
		default:
			throw new GeoPackageException("Geometry Type not supported: "
					+ geometryType);
		}
	}
}
 
Example #10
Source File: FeatureUtils.java    From geopackage-java with MIT License 4 votes vote down vote up
/**
 * Validate the geometry
 * 
 * @param geometryType
 * @param geometry
 */
private static void validateGeometry(GeometryType geometryType,
		Geometry geometry) {

	switch (geometryType) {
	case POINT:
		TestCase.assertTrue(geometry instanceof Point);
		Point point = (Point) geometry;
		validatePoint(point, point);
		break;
	case LINESTRING:
		TestCase.assertTrue(geometry instanceof LineString);
		LineString lineString = (LineString) geometry;
		validateLineString(lineString, lineString);
		break;
	case POLYGON:
		TestCase.assertTrue(geometry instanceof Polygon);
		Polygon polygon = (Polygon) geometry;
		validatePolygon(polygon, polygon);
		break;
	case MULTIPOINT:
		TestCase.assertTrue(geometry instanceof MultiPoint);
		MultiPoint multiPoint = (MultiPoint) geometry;
		validateMultiPoint(multiPoint, multiPoint);
		break;
	case MULTILINESTRING:
		TestCase.assertTrue(geometry instanceof MultiLineString);
		MultiLineString multiLineString = (MultiLineString) geometry;
		validateMultiLineString(multiLineString, multiLineString);
		break;
	case MULTIPOLYGON:
		TestCase.assertTrue(geometry instanceof MultiPolygon);
		MultiPolygon multiPolygon = (MultiPolygon) geometry;
		validateMultiPolygon(multiPolygon, multiPolygon);
		break;
	case GEOMETRYCOLLECTION:
		TestCase.assertTrue(geometry instanceof GeometryCollection);
		GeometryCollection<?> geometryCollection = (GeometryCollection<?>) geometry;
		validateGeometryCollection(geometryCollection, geometryCollection);
		break;
	default:

	}
}
 
Example #11
Source File: GeoPackageGeometryDataUtils.java    From geopackage-android with MIT License 4 votes vote down vote up
/**
 * Compare two geometries and verify they are equal
 *
 * @param expected
 * @param actual
 * @param delta
 */
public static void compareGeometries(Geometry expected, Geometry actual,
                                     double delta) {
    if (expected == null) {
        TestCase.assertNull(actual);
    } else {
        TestCase.assertNotNull(actual);

        GeometryType geometryType = expected.getGeometryType();
        switch (geometryType) {

            case GEOMETRY:
                TestCase.fail("Unexpected Geometry Type of "
                        + geometryType.name() + " which is abstract");
            case POINT:
                comparePoint((Point) expected, (Point) actual, delta);
                break;
            case LINESTRING:
                compareLineString((LineString) expected, (LineString) actual,
                        delta);
                break;
            case POLYGON:
                comparePolygon((Polygon) expected, (Polygon) actual, delta);
                break;
            case MULTIPOINT:
                compareMultiPoint((MultiPoint) expected, (MultiPoint) actual,
                        delta);
                break;
            case MULTILINESTRING:
                compareMultiLineString((MultiLineString) expected,
                        (MultiLineString) actual, delta);
                break;
            case MULTIPOLYGON:
                compareMultiPolygon((MultiPolygon) expected,
                        (MultiPolygon) actual, delta);
                break;
            case GEOMETRYCOLLECTION:
                compareGeometryCollection((GeometryCollection<?>) expected,
                        (GeometryCollection<?>) actual, delta);
                break;
            case CIRCULARSTRING:
                compareCircularString((CircularString) expected,
                        (CircularString) actual, delta);
                break;
            case COMPOUNDCURVE:
                compareCompoundCurve((CompoundCurve) expected,
                        (CompoundCurve) actual, delta);
                break;
            case CURVEPOLYGON:
                compareCurvePolygon((CurvePolygon<?>) expected,
                        (CurvePolygon<?>) actual, delta);
                break;
            case MULTICURVE:
                TestCase.fail("Unexpected Geometry Type of "
                        + geometryType.name() + " which is abstract");
            case MULTISURFACE:
                TestCase.fail("Unexpected Geometry Type of "
                        + geometryType.name() + " which is abstract");
            case CURVE:
                TestCase.fail("Unexpected Geometry Type of "
                        + geometryType.name() + " which is abstract");
            case SURFACE:
                TestCase.fail("Unexpected Geometry Type of "
                        + geometryType.name() + " which is abstract");
            case POLYHEDRALSURFACE:
                comparePolyhedralSurface((PolyhedralSurface) expected,
                        (PolyhedralSurface) actual, delta);
                break;
            case TIN:
                compareTIN((TIN) expected, (TIN) actual, delta);
                break;
            case TRIANGLE:
                compareTriangle((Triangle) expected, (Triangle) actual, delta);
                break;
            default:
                throw new GeoPackageException("Geometry Type not supported: "
                        + geometryType);
        }
    }
}
 
Example #12
Source File: FeatureUtils.java    From geopackage-android with MIT License 4 votes vote down vote up
/**
 * Validate the geometry
 *
 * @param geometryType
 * @param geometry
 */
private static void validateGeometry(GeometryType geometryType,
                                     Geometry geometry) {

    switch (geometryType) {
        case POINT:
            TestCase.assertTrue(geometry instanceof Point);
            Point point = (Point) geometry;
            validatePoint(point, point);
            break;
        case LINESTRING:
            TestCase.assertTrue(geometry instanceof LineString);
            LineString lineString = (LineString) geometry;
            validateLineString(lineString, lineString);
            break;
        case POLYGON:
            TestCase.assertTrue(geometry instanceof Polygon);
            Polygon polygon = (Polygon) geometry;
            validatePolygon(polygon, polygon);
            break;
        case MULTIPOINT:
            TestCase.assertTrue(geometry instanceof MultiPoint);
            MultiPoint multiPoint = (MultiPoint) geometry;
            validateMultiPoint(multiPoint, multiPoint);
            break;
        case MULTILINESTRING:
            TestCase.assertTrue(geometry instanceof MultiLineString);
            MultiLineString multiLineString = (MultiLineString) geometry;
            validateMultiLineString(multiLineString, multiLineString);
            break;
        case MULTIPOLYGON:
            TestCase.assertTrue(geometry instanceof MultiPolygon);
            MultiPolygon multiPolygon = (MultiPolygon) geometry;
            validateMultiPolygon(multiPolygon, multiPolygon);
            break;
        case GEOMETRYCOLLECTION:
            TestCase.assertTrue(geometry instanceof GeometryCollection);
            GeometryCollection<?> geometryCollection = (GeometryCollection<?>) geometry;
            validateGeometryCollection(geometryCollection, geometryCollection);
            break;
        default:

    }
}
 
Example #13
Source File: GoogleMapShapeConverterUtils.java    From geopackage-android-map with MIT License 4 votes vote down vote up
/**
 * Test shapes
 * 
 * @param geoPackage
 * @throws SQLException
 */
public static void testShapes(GeoPackage geoPackage) throws SQLException {

	GeometryColumnsDao geometryColumnsDao = geoPackage
			.getGeometryColumnsDao();

	if (geometryColumnsDao.isTableExists()) {
		List<GeometryColumns> results = geometryColumnsDao.queryForAll();

		for (GeometryColumns geometryColumns : results) {

			FeatureDao dao = geoPackage.getFeatureDao(geometryColumns);

			GoogleMapShapeConverter converter = new GoogleMapShapeConverter(
					dao.getProjection());
			converter.setExteriorOrientation(null);
			converter.setHoleOrientation(null);

			// Query for all
			FeatureCursor cursor = dao.queryForAll();
			while (cursor.moveToNext()) {
				FeatureRow featureRow = cursor.getRow();

				GeoPackageGeometryData geometryData = featureRow
						.getGeometry();

				if (geometryData != null) {
					Geometry geometry = geometryData.getGeometry();
					GeometryType geometryType = geometry.getGeometryType();

					switch (geometryType) {
					case POINT:
						convertPoint(converter, (Point) geometry);
						break;
					case LINESTRING:
						convertLineString(converter, (LineString) geometry);
						break;
					case POLYGON:
						convertPolygon(converter, (Polygon) geometry);
						break;
					case MULTIPOINT:
						convertMultiPoint(converter, (MultiPoint) geometry);
						break;
					case MULTILINESTRING:
						convertMultiLineString(converter,
								(MultiLineString) geometry);
						break;
					case MULTIPOLYGON:
						convertMultiPolygon(converter,
								(MultiPolygon) geometry);
						break;
					case CIRCULARSTRING:
						convertLineString(converter,
								(CircularString) geometry);
						break;
					case COMPOUNDCURVE:
						convertCompoundCurve(converter,
								(CompoundCurve) geometry);
						break;
					case POLYHEDRALSURFACE:
						convertMultiPolygon(converter,
								(PolyhedralSurface) geometry);
						break;
					case TIN:
						convertMultiPolygon(converter, (TIN) geometry);
						break;
					case TRIANGLE:
						convertPolygon(converter, (Triangle) geometry);
						break;
					default:
					}
				}

			}
			cursor.close();

		}
	}

}
 
Example #14
Source File: GoogleMapShapeConverter.java    From geopackage-android-map with MIT License 4 votes vote down vote up
/**
 * Convert a {@link Geometry} to a Map shape and add it
 *
 * @param map      google map
 * @param geometry geometry
 * @return google map shape
 */
@SuppressWarnings("unchecked")
public GoogleMapShape addToMap(GoogleMap map, Geometry geometry) {

    GoogleMapShape shape = null;

    GeometryType geometryType = geometry.getGeometryType();
    switch (geometryType) {
        case POINT:
            shape = new GoogleMapShape(geometryType, GoogleMapShapeType.MARKER,
                    addLatLngToMap(map, toLatLng((Point) geometry)));
            break;
        case LINESTRING:
            shape = new GoogleMapShape(geometryType,
                    GoogleMapShapeType.POLYLINE, addPolylineToMap(map,
                    toPolyline((LineString) geometry)));
            break;
        case POLYGON:
            shape = new GoogleMapShape(geometryType,
                    GoogleMapShapeType.POLYGON, addPolygonToMap(map,
                    toPolygon((Polygon) geometry)));
            break;
        case MULTIPOINT:
            shape = new GoogleMapShape(geometryType,
                    GoogleMapShapeType.MULTI_MARKER, addLatLngsToMap(map,
                    toLatLngs((MultiPoint) geometry)));
            break;
        case MULTILINESTRING:
            shape = new GoogleMapShape(geometryType,
                    GoogleMapShapeType.MULTI_POLYLINE, addPolylinesToMap(map,
                    toPolylines((MultiLineString) geometry)));
            break;
        case MULTIPOLYGON:
            shape = new GoogleMapShape(geometryType,
                    GoogleMapShapeType.MULTI_POLYGON, addPolygonsToMap(map,
                    toPolygons((MultiPolygon) geometry)));
            break;
        case CIRCULARSTRING:
            shape = new GoogleMapShape(geometryType,
                    GoogleMapShapeType.POLYLINE, addPolylineToMap(map,
                    toPolyline((CircularString) geometry)));
            break;
        case COMPOUNDCURVE:
            shape = new GoogleMapShape(geometryType,
                    GoogleMapShapeType.MULTI_POLYLINE, addPolylinesToMap(map,
                    toPolylines((CompoundCurve) geometry)));
            break;
        case CURVEPOLYGON:
            shape = new GoogleMapShape(geometryType,
                    GoogleMapShapeType.POLYGON, addPolygonToMap(map,
                    toCurvePolygon((CurvePolygon) geometry)));
            break;
        case POLYHEDRALSURFACE:
            shape = new GoogleMapShape(geometryType,
                    GoogleMapShapeType.MULTI_POLYGON, addPolygonsToMap(map,
                    toPolygons((PolyhedralSurface) geometry)));
            break;
        case TIN:
            shape = new GoogleMapShape(geometryType,
                    GoogleMapShapeType.MULTI_POLYGON, addPolygonsToMap(map,
                    toPolygons((TIN) geometry)));
            break;
        case TRIANGLE:
            shape = new GoogleMapShape(geometryType,
                    GoogleMapShapeType.POLYGON, addPolygonToMap(map,
                    toPolygon((Triangle) geometry)));
            break;
        case GEOMETRYCOLLECTION:
            shape = new GoogleMapShape(geometryType,
                    GoogleMapShapeType.COLLECTION, addToMap(map,
                    (GeometryCollection<Geometry>) geometry));
            break;
        default:
            throw new GeoPackageException("Unsupported Geometry Type: "
                    + geometryType.getName());
    }

    return shape;
}
 
Example #15
Source File: GoogleMapShapeConverter.java    From geopackage-android-map with MIT License 4 votes vote down vote up
/**
 * Convert a {@link Geometry} to a Map shape
 *
 * @param geometry geometry
 * @return google map shape
 */
@SuppressWarnings("unchecked")
public GoogleMapShape toShape(Geometry geometry) {

    GoogleMapShape shape = null;

    GeometryType geometryType = geometry.getGeometryType();
    switch (geometryType) {
        case POINT:
            shape = new GoogleMapShape(geometryType,
                    GoogleMapShapeType.LAT_LNG, toLatLng((Point) geometry));
            break;
        case LINESTRING:
            shape = new GoogleMapShape(geometryType,
                    GoogleMapShapeType.POLYLINE_OPTIONS,
                    toPolyline((LineString) geometry));
            break;
        case POLYGON:
            shape = new GoogleMapShape(geometryType,
                    GoogleMapShapeType.POLYGON_OPTIONS,
                    toPolygon((Polygon) geometry));
            break;
        case MULTIPOINT:
            shape = new GoogleMapShape(geometryType,
                    GoogleMapShapeType.MULTI_LAT_LNG,
                    toLatLngs((MultiPoint) geometry));
            break;
        case MULTILINESTRING:
            shape = new GoogleMapShape(geometryType,
                    GoogleMapShapeType.MULTI_POLYLINE_OPTIONS,
                    toPolylines((MultiLineString) geometry));
            break;
        case MULTIPOLYGON:
            shape = new GoogleMapShape(geometryType,
                    GoogleMapShapeType.MULTI_POLYGON_OPTIONS,
                    toPolygons((MultiPolygon) geometry));
            break;
        case CIRCULARSTRING:
            shape = new GoogleMapShape(geometryType,
                    GoogleMapShapeType.POLYLINE_OPTIONS,
                    toPolyline((CircularString) geometry));
            break;
        case COMPOUNDCURVE:
            shape = new GoogleMapShape(geometryType,
                    GoogleMapShapeType.MULTI_POLYLINE_OPTIONS,
                    toPolylines((CompoundCurve) geometry));
            break;
        case CURVEPOLYGON:
            shape = new GoogleMapShape(geometryType,
                    GoogleMapShapeType.POLYGON_OPTIONS,
                    toCurvePolygon((CurvePolygon) geometry));
            break;
        case POLYHEDRALSURFACE:
            shape = new GoogleMapShape(geometryType,
                    GoogleMapShapeType.MULTI_POLYGON_OPTIONS,
                    toPolygons((PolyhedralSurface) geometry));
            break;
        case TIN:
            shape = new GoogleMapShape(geometryType,
                    GoogleMapShapeType.MULTI_POLYGON_OPTIONS,
                    toPolygons((TIN) geometry));
            break;
        case TRIANGLE:
            shape = new GoogleMapShape(geometryType,
                    GoogleMapShapeType.POLYGON_OPTIONS,
                    toPolygon((Triangle) geometry));
            break;
        case GEOMETRYCOLLECTION:
            shape = new GoogleMapShape(geometryType,
                    GoogleMapShapeType.COLLECTION,
                    toShapes((GeometryCollection<Geometry>) geometry));
            break;
        default:
            throw new GeoPackageException("Unsupported Geometry Type: "
                    + geometryType.getName());
    }

    return shape;
}
 
Example #16
Source File: GoogleMapShapeConverter.java    From geopackage-android-map with MIT License 2 votes vote down vote up
/**
 * Convert a {@link MultiLatLng} to a {@link MultiPoint}
 *
 * @param latLngs lat lngs
 * @return multi point
 */
public MultiPoint toMultiPoint(List<LatLng> latLngs) {
    return toMultiPoint(latLngs, false, false);
}
 
Example #17
Source File: GoogleMapShapeConverter.java    From geopackage-android-map with MIT License 2 votes vote down vote up
/**
 * Convert a {@link MultiLatLng} to a {@link MultiPoint}
 *
 * @param latLngs lat lngs
 * @param hasZ    has z flag
 * @param hasM    has m flag
 * @return multi point
 */
public MultiPoint toMultiPoint(MultiLatLng latLngs, boolean hasZ,
                               boolean hasM) {
    return toMultiPoint(latLngs.getLatLngs(), hasZ, hasM);
}
 
Example #18
Source File: GoogleMapShapeConverter.java    From geopackage-android-map with MIT License 2 votes vote down vote up
/**
 * Convert a {@link MultiLatLng} to a {@link MultiPoint}
 *
 * @param latLngs lat lngs
 * @return multi point
 */
public MultiPoint toMultiPoint(MultiLatLng latLngs) {
    return toMultiPoint(latLngs, false, false);
}