Search in sources :

Example 1 with MultiLineString

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));
}
Also used : MultiLineString(org.geojson.MultiLineString) LngLatAlt(org.geojson.LngLatAlt) Test(org.junit.Test)

Aggregations

LngLatAlt (org.geojson.LngLatAlt)1 MultiLineString (org.geojson.MultiLineString)1 Test (org.junit.Test)1