Changeset 10852 in josm for trunk/test/unit


Ignore:
Timestamp:
2016-08-19T02:40:50+02:00 (4 years ago)
Author:
Don-vip
Message:

fix #13358 - GeoJSON no longer permits projections other than WGS84, see https://tools.ietf.org/html/rfc7946

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/io/GeoJSONWriterTest.java

    r10817 r10852  
    44import static org.junit.Assert.assertEquals;
    55import static org.junit.Assert.assertTrue;
     6
     7import java.io.FileInputStream;
    68
    79import org.junit.BeforeClass;
     
    1315import org.openstreetmap.josm.data.osm.Node;
    1416import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    15 import org.openstreetmap.josm.gui.preferences.projection.ProjectionPreference;
    16 
    17 import java.io.FileInputStream;
    1817
    1918/**
     
    4140        ds.addPrimitive(node);
    4241        final OsmDataLayer layer = new OsmDataLayer(ds, "foo", null);
    43         final GeoJSONWriter writer = new GeoJSONWriter(layer, ProjectionPreference.wgs84.getProjection());
     42        final GeoJSONWriter writer = new GeoJSONWriter(layer);
    4443        assertEquals(("" +
    4544                "{\n" +
    4645                "    'type':'FeatureCollection',\n" +
    47                 "    'crs':{\n" +
    48                 "        'type':'name',\n" +
    49                 "        'properties':{\n" +
    50                 "            'name':'EPSG:4326'\n" +
    51                 "        }\n" +
    52                 "    },\n" +
    5346                "    'generator':'JOSM',\n" +
    5447                "    'features':[\n" +
     
    7366    /**
    7467     * Unit test for multipolygon
     68     * @throws Exception if an error occurs
    7569     */
    7670    @Test
     
    7973            DataSet ds = OsmReader.parseDataSet(in, null);
    8074            final OsmDataLayer layer = new OsmDataLayer(ds, "foo", null);
    81             final GeoJSONWriter writer = new GeoJSONWriter(layer, ProjectionPreference.wgs84.getProjection());
     75            final GeoJSONWriter writer = new GeoJSONWriter(layer);
    8276            assertTrue(writer.write().contains("MultiPolygon"));
    8377        }
Note: See TracChangeset for help on using the changeset viewer.