use of org.geojson.MultiLineString in project geojson-jackson by opendatalab-de.
the class MultiLineStringTest method itShouldSerialize.
@Test
public void itShouldSerialize() throws Exception {
MultiLineString multiLineString = new MultiLineString();
multiLineString.add(Arrays.asList(new LngLatAlt(100, 0), new LngLatAlt(101, 1)));
multiLineString.add(Arrays.asList(new LngLatAlt(102, 2), new LngLatAlt(103, 3)));
assertEquals("{\"type\":\"MultiLineString\",\"coordinates\":" + "[[[100.0,0.0],[101.0,1.0]],[[102.0,2.0],[103.0,3.0]]]}", mapper.writeValueAsString(multiLineString));
}
Aggregations