use of org.geojson.GeoJsonObject in project geojson-jackson by opendatalab-de.
the class PointTest method itShouldDeserializeAPoint.
@Test
public void itShouldDeserializeAPoint() throws Exception {
GeoJsonObject value = mapper.readValue("{\"type\":\"Point\",\"coordinates\":[100.0,5.0]}", GeoJsonObject.class);
assertNotNull(value);
assertTrue(value instanceof Point);
Point point = (Point) value;
assertLngLatAlt(100, 5, Double.NaN, point.getCoordinates());
}
use of org.geojson.GeoJsonObject in project geojson-jackson by opendatalab-de.
the class CrsTest method itShouldParseCrsWithLink.
@Test
public void itShouldParseCrsWithLink() throws Exception {
GeoJsonObject value = mapper.readValue("{\"crs\": { \"type\": \"link\", \"properties\": " + "{ \"href\": \"http://example.com/crs/42\", \"type\": \"proj4\" }}," + "\"type\":\"Point\",\"coordinates\":[100.0,5.0]}", GeoJsonObject.class);
assertNotNull(value);
assertEquals(CrsType.link, value.getCrs().getType());
}
use of org.geojson.GeoJsonObject in project geojson-jackson by opendatalab-de.
the class PointTest method itShouldDeserializeAPointWithAdditionalAttributes.
@Test
public void itShouldDeserializeAPointWithAdditionalAttributes() throws IOException {
GeoJsonObject value = mapper.readValue("{\"type\":\"Point\",\"coordinates\":[100.0,5.0,123,456,789.2]}", GeoJsonObject.class);
Point point = (Point) value;
assertLngLatAlt(100, 5, 123, new double[] { 456d, 789.2 }, point.getCoordinates());
}
Aggregations