Modify

Opened 4 years ago

Closed 4 years ago

Last modified 3 years ago

#19041 closed defect (fixed)

JOSM creates unconnected polygons when reading GeoJSON files

Reported by: Mashin Owned by: team
Priority: normal Milestone: 20.05
Component: Core geojson Version: tested
Keywords: Cc:

Description

When two polygons share a node, JOSM renders them as two separate polygons with two separate nodes. I would expect that those two nodes would be merged into one. When loading the same data from shapefile, two adjoined polygons are rendered.

Attachments (0)

Change History (7)

comment:1 by Don-vip, 4 years ago

Owner: changed from team to Mashin
Status: newneedinfo

Thanks for your report, however your ticket is incomplete and therefore not helpful in its current form.

Please add all needed information according to this list:

  • The required parts of the Status Report from your JOSM.
  • Describe what behaviour you expected.
  • Describe what did happen instead.
  • Describe if and how the issue is reproducible.
  • Add any relevant information like error messages or screenshots.

To ensure that all technical relevant information is contained, create new tickets by clicking in JOSMs Main Menu on Helpsource:trunk/resources/images/bug.svg Report Bug.


comment:2 by anonymous, 4 years ago

What steps will reproduce the problem?

  1. Load following geojson file into JOSM:

{
"type": "FeatureCollection",
"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } },
"features": [
{ "type": "Feature", "properties": { "building": "yes" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -73.461245057664058, 41.088676384187671],[ -73.461273825957079, 41.088666460158429], [ -73.461254461049478, 41.088629975809461], [ -73.46124642078972, 41.088614826871861], [ -73.461326933587827, 41.088590364879529],[ -73.461276736368646, 41.08873607166479], [ -73.461245057664058, 41.088676384187671] ] ] } },
{ "type": "Feature", "properties": { "building": "yes" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -73.461254461049478, 41.088629975809461], [ -73.461273825957079, 41.088666460158429], [ -73.461245057664058, 41.088676384187671], [ -73.461237378211962, 41.088678318492917], [ -73.461218240949378, 41.088641971392484], [ -73.461254461049478, 41.088629975809461] ] ] } }
]
}

What is the expected result?

I would expect that these 3 points: [ -73.461254461049478, 41.088629975809461] , [ -73.461273825957079, 41.088666460158429] and [ -73.461245057664058, 41.088676384187671]
would be rendered as merged node that is shared between both polygons/ways (touching polygons). So then when you pull those nodes in GUI both ways are being edited.

What happens instead?

JOSM renders each of these points as two separate nodes that are positioned on top of each other. (This also raises an error in the validator)

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

URL:https://josm.openstreetmap.de/svn/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2020-04-06 02:17:07 +0200 (Mon, 06 Apr 2020)
Build-Date:2020-04-06 00:18:43
Revision:16239
Relative:URL: ^/trunk

Identification: JOSM/1.5 (16239 en) Mac OS X 10.14.6
OS Build number: Mac OS X 10.14.6 (18G3020)
Memory Usage: 858 MB / 1820 MB (545 MB allocated, but free)
Java version: 1.8.0_241-b07, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM
Screen: Display 69733632 1440x900, Display 731409282 2560x1440
Maximum Screen Size: 2560x1440
VM arguments: [-Djava.security.policy=file:<java.home>/lib/security/javaws.policy, -DtrustProxy=true, -Djnlpx.home=<java.home>/bin, -Djava.security.manager, -Djnlpx.origFilenameArg=${HOME}/Library/Application Support/Oracle/Java/Deployment/cache/6.0/56/1ee8cfb8-2bc3e844, -Djnlpx.remove=false, -Dsun.awt.warmup=true, -Djava.util.Arrays.useLegacyMergeSort=true, -Djnlpx.heapsize=NULL,2048m, -Dmacosx.jnlpx.dock.name=JOSM, -Dmacosx.jnlpx.dock.icon=${HOME}/Library/Application Support/Oracle/Java/Deployment/cache/6.0/25/4c122699-4466e0ba.icns, -Djnlp.application.href=https://josm.openstreetmap.de/download/josm.jnlp , -Djnlpx.jvm="<java.home>/bin/java"]
Dataset consistency test: No problems found

Plugins:
+ FastDraw (35405)
+ MicrosoftStreetside (35248)
+ PicLayer (35405)
+ apache-commons (35362)
+ apache-http (35092)
+ buildings_tools (35405)
+ editgpx (35248)
+ ejml (35313)
+ geochat (35405)
+ geotools (35169)
+ javafx-osx (35375)
+ jaxb (35092)
+ jna (35092)
+ jts (35122)
+ log4j (35092)
+ merge-overlap (35248)
+ opendata (35405)
+ reverter (35405)
+ terracer (35327)
+ utilsplugin2 (35405)

Tagging presets:
+ https://josm.openstreetmap.de/josmfile?page=Presets/Freemap&preset&zip=1

Map paint styles:
- https://josm.openstreetmap.de/josmfile?page=Styles/LessObtrusiveNodes&style&zip=1
- https://github.com/simon04/coloured-addresses.mapcss/raw/master/dist/coloured-addresses.mapcss
- https://josm.openstreetmap.de/josmfile?page=Styles/ParkingLanes&style&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Lane_features_ryg&style&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Lane_features&style&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Lane_and_Road_Attributes&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Cycleways&style&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Sidewalks&style&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Maxspeed&style&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/LitObjects&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Lit&style&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Osmc&style&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/SlovakiaBicycleRoutes&style&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Coloured_Streets&style&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Maxspeed&zip=1
- https://github.com/TelenavMapping/Community_MapRoulette/blob/master/maxspeed.mapcss

Last errors/warnings:
- W: Not a single layer for the name 'MapBox Satellite': []
- W: Not a single layer for the name 'MapBox Satellite': []
- W: Failed to parse Mappaint styles from 'https://github.com/TelenavMapping/Community_MapRoulette/blob/master/maxspeed.mapcss'. Error was: Encountered " "<" "< "" at line 7, column 1.
- E: org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.ParseException: Encountered " "<" "< "" at line 7, column 1.
Version 0, edited 4 years ago by anonymous (next)

comment:3 by Don-vip, 4 years ago

Owner: changed from Mashin to team
Status: needinfonew

comment:4 by evod, 4 years ago

This behavior is not limited to touching polygons but also happens for

  • simple ways sharing a node
  • nodes with tags that are part of a way

Here is a small example containing OSM data. Originally one node with tags where two roads touch (see https://www.openstreetmap.org/node/308628175) is transformed into three nodes after importing the geojson into JOSM.

It would be great if the JSON import could automatically merge these nodes into one.

{
    "type": "FeatureCollection",
    "generator": "JOSM",
    "bbox": [
        16.37912810000,
        48.21907860000,
        16.37917880000,
        48.21910240000
    ],
    "features": [
        {
            "type": "Feature",
            "properties": {
                "highway": "pedestrian",
                "lit": "yes",
                "name": "Alexander-Poch-Platz"
            },
            "geometry": {
                "type": "LineString",
                "coordinates": [
                    [
                        16.37915300000,
                        48.21909140000
                    ],
                    [
                        16.37901950000,
                        48.21898070000
                    ],
                    [
                        16.37896840000,
                        48.21868790000
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "properties": {
                "barrier": "bollard",
                "bicycle": "yes",
                "bollard": "removable",
                "foot": "yes",
                "material": "metal"
            },
            "geometry": {
                "type": "Point",
                "coordinates": [
                    16.37915300000,
                    48.21909140000
                ]
            }
        },
        {
            "type": "Feature",
            "properties": {
                "bicycle": "private",
                "foot": "yes",
                "highway": "residential",
                "lit": "yes",
                "maxspeed": "30",
                "motor_vehicle": "private",
                "name": "Alexander-Poch-Platz",
                "source:maxspeed": "AT:zone:30",
                "surface": "asphalt"
            },
            "geometry": {
                "type": "LineString",
                "coordinates": [
                    [
                        16.37921260000,
                        48.21939120000
                    ],
                    [
                        16.37915300000,
                        48.21909140000
                    ]
                ]
            }
        }
    ]
}
Last edited 3 years ago by Don-vip (previous) (diff)

comment:5 by simon04, 4 years ago

Resolution: fixed
Status: newclosed

In 16311/josm:

fix #19041 - GeoJSONReader: reuse node on same at same position to

Avoids multiple nodes on top of each other. Avoid creating unconnected polygons.

comment:6 by simon04, 4 years ago

Milestone: 20.04

comment:7 by Klumbumbus, 4 years ago

Milestone: 20.0420.05

Milestone renamed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.