Ignore:
Timestamp:
2017-09-09T17:48:13+02:00 (2 years ago)
Author:
Don-vip
Message:

see #15229 - see #15182 - remove GUI references from GeoJSONWriter

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/GeoJSONWriter.java

    r12620 r12806  
    4343public class GeoJSONWriter {
    4444
    45     private final OsmDataLayer layer;
     45    private final DataSet data;
    4646    private final Projection projection;
    4747    private static final boolean SKIP_EMPTY_NODES = true;
     
    5151     * @param layer The OSM data layer to save
    5252     * @since 10852
    53      */
     53     * @deprecated To be removed end of 2017. Use {@link #GeoJSONWriter(DataSet)} instead
     54     */
     55    @Deprecated
    5456    public GeoJSONWriter(OsmDataLayer layer) {
    55         this.layer = layer;
     57        this(layer.data);
     58    }
     59
     60    /**
     61     * Constructs a new {@code GeoJSONWriter}.
     62     * @param ds The OSM data set to save
     63     * @since 12806
     64     */
     65    public GeoJSONWriter(DataSet ds) {
     66        this.data = ds;
    5667        this.projection = ProjectionPreference.wgs84.getProjection();
    5768    }
     
    7990                    .add("type", "FeatureCollection")
    8091                    .add("generator", "JOSM");
    81             appendLayerBounds(layer.data, object);
    82             appendLayerFeatures(layer.data, object);
     92            appendLayerBounds(data, object);
     93            appendLayerFeatures(data, object);
    8394            writer.writeObject(object.build());
    8495            return stringWriter.toString();
Note: See TracChangeset for help on using the changeset viewer.