Opened 9 years ago

Last modified 6 years ago

#14761 closed defect

Deleted featured are not removed from geojson — at Initial Version

Reported by: Alexander Kachkaev <alexander@…> Owned by: team
Priority: normal Milestone: 17.05
Component: Core geojson Version:
Keywords: template_report geojson Cc:

Description

I noticed that when the layer saved as a geojson contains just-deleted map features, these objects remain in the file output.

What steps will reproduce the problem?

  1. Create a new layer and draw something like this:

https://cloud.githubusercontent.com/assets/608862/25855110/2ab46b00-34ca-11e7-93c4-b8fc353326cd.png

  1. Save the file as geojson
{
    "type":"FeatureCollection",
    "generator":"JOSM",
    "features":[
        {
            "type":"Feature",
            "properties":{
                "point":"second"
            },
            "geometry":{
                "type":"Point",
                "coordinates":[
                    151.21727210459,
                    -33.86300877248
                ]
            }
        },
        {
            "type":"Feature",
            "properties":{
                "polygon":"second"
            },
            "geometry":{
                "type":"LineString",
                "coordinates":[
                    [
                        151.20927709856,
                        -33.86539573445
                    ],
                    [
                        151.20972625620,
                        -33.86852852075
                    ],
                    [
                        151.21412800109,
                        -33.86852852075
                    ],
                    [
                        151.20927709856,
                        -33.86539573445
                    ]
                ]
            }
        },
        {
            "type":"Feature",
            "properties":{
                "line":"second"
            },
            "geometry":{
                "type":"LineString",
                "coordinates":[
                    [
                        151.21826025140,
                        -33.86837934306
                    ],
                    [
                        151.20963642467,
                        -33.86226283318
                    ]
                ]
            }
        },
        {
            "type":"Feature",
            "properties":{
                "point":"first"
            },
            "geometry":{
                "type":"Point",
                "coordinates":[
                    151.20397703838,
                    -33.86293417884
                ]
            }
        },
        {
            "type":"Feature",
            "properties":{
                "polygon":"first"
            },
            "geometry":{
                "type":"LineString",
                "coordinates":[
                    [
                        151.19517354860,
                        -33.86517195960
                    ],
                    [
                        151.19544304318,
                        -33.86919981715
                    ],
                    [
                        151.19957529349,
                        -33.86919981715
                    ],
                    [
                        151.19517354860,
                        -33.86517195960
                    ]
                ]
            }
        },
        {
            "type":"Feature",
            "properties":{
                "line":"first"
            },
            "geometry":{
                "type":"LineString",
                "coordinates":[
                    [
                        151.20442619603,
                        -33.86830475412
                    ],
                    [
                        151.19598203235,
                        -33.86211364454
                    ]
                ]
            }
        }
    ]
}

Delete some geometries from the layer and save it again
https://cloud.githubusercontent.com/assets/608862/25855115/2c290b6c-34ca-11e7-9d48-c0758560e77f.png

What is the expected result?

The second file is not expected to contain 'ghost' geometries, i.e. those that were just delete.

What happens instead?

The second file does contain 'ghost' geometries, i.e. the point with the coordinates plus two linestrings with the empty arrays of points.

{
    "type":"FeatureCollection",
    "generator":"JOSM",
    "features":[
        {
            "type":"Feature",
            "properties":{
                "point":"second"
            },
            "geometry":{
                "type":"Point",
                "coordinates":[
                    151.21727210459,
                    -33.86300877248
                ]
            }
        },
        {
            "type":"Feature",
            "properties":{
                "polygon":"second"
            },
            "geometry":{
                "type":"LineString",
                "coordinates":[
                ]
            }
        },
        {
            "type":"Feature",
            "properties":{
                "line":"second"
            },
            "geometry":{
                "type":"LineString",
                "coordinates":[
                ]
            }
        },
        {
            "type":"Feature",
            "properties":{
                "point":"first"
            },
            "geometry":{
                "type":"Point",
                "coordinates":[
                    151.20397703838,
                    -33.86293417884
                ]
            }
        },
        {
            "type":"Feature",
            "properties":{
                "polygon":"first"
            },
            "geometry":{
                "type":"LineString",
                "coordinates":[
                    [
                        151.19517354860,
                        -33.86517195960
                    ],
                    [
                        151.19544304318,
                        -33.86919981715
                    ],
                    [
                        151.19957529349,
                        -33.86919981715
                    ],
                    [
                        151.19517354860,
                        -33.86517195960
                    ]
                ]
            }
        },
        {
            "type":"Feature",
            "properties":{
                "line":"first"
            },
            "geometry":{
                "type":"LineString",
                "coordinates":[
                    [
                        151.20442619603,
                        -33.86830475412
                    ],
                    [
                        151.19598203235,
                        -33.86211364454
                    ]
                ]
            }
        }
    ]
}

Please provide any additional information below. Attach a screenshot if possible.

URL:http://josm.openstreetmap.de/svn/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2017-05-02 23:28:33 +0200 (Tue, 02 May 2017)
Build-Date:2017-05-02 21:34:40
Revision:12039
Relative:URL: ^/trunk

Identification: JOSM/1.5 (12039 en) Linux Ubuntu 16.04.2 LTS
Memory Usage: 1022 MB / 4357 MB (586 MB allocated, but free)
Java version: 1.8.0_121-8u121-b13-0ubuntu1.16.04.2-b13, Oracle Corporation, OpenJDK 64-Bit Server VM
Screen: :0.0 2560x1440
Maximum Screen Size: 2560x1440
Java package: openjdk-8-jre:amd64-8u121-b13-0ubuntu1.16.04.2
VM arguments: [-Djosm.restart=true, -Djava.net.useSystemProxies=true]
Dataset consistency test: No problems found

Plugins:
+ Create_grid_of_ways (32699)
+ apache-commons (32994)
+ ejml (32680)
+ geotools (33042)
+ jts (32699)
+ opendata (33245)
+ photo_geotagging (33088)
+ utilsplugin2 (33297)

Change History (0)

Note: See TracTickets for help on using tickets.