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

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

Introduction

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

Prototype

public GeoJsonLineString(List<Point> points) 

Source Link

Document

Creates a new GeoJsonLineString for the given Point s.

Usage

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

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

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

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