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

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

Introduction

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

Prototype

public GeoJsonPoint(double x, double y) 

Source Link

Document

Creates GeoJsonPoint for given coordinates.

Usage

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

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

    String json = "{ \"type\": \"Point\", \"coordinates\": [10.0, 20.0] }";

    assertThat(mapper.readValue(json, GeoJsonPoint.class), is(new GeoJsonPoint(10D, 20D)));
}