Example usage for org.springframework.data.mongodb.core.geo GeoJsonMultiPoint GeoJsonMultiPoint

List of usage examples for org.springframework.data.mongodb.core.geo GeoJsonMultiPoint GeoJsonMultiPoint

Introduction

In this page you can find the example usage for org.springframework.data.mongodb.core.geo GeoJsonMultiPoint GeoJsonMultiPoint.

Prototype

public GeoJsonMultiPoint(List<Point> points) 

Source Link

Document

Creates a new GeoJsonMultiPoint for the given Point s.

Usage

From source file:org.springframework.data.mongodb.core.geo.GeoJsonModuleUnitTests.java

/**
 * @see DATAMONGO-1181// ww  w. j av a 2s . c o  m
 */
@Test
public void shouldDeserializeGeoJsonMultiPointCorrectly()
        throws JsonParseException, JsonMappingException, IOException {

    String json = "{ \"type\": \"MultiPoint\", \"coordinates\": [ [10.0, 20.0], [30.0, 40.0], [50.0, 60.0] ]}";

    assertThat(mapper.readValue(json, GeoJsonLineString.class),
            is(new GeoJsonMultiPoint(Arrays.asList(new Point(10, 20), new Point(30, 40), new Point(50, 60)))));
}