You are not logged in.

#1 2021-07-08 11:56:58

CosminPit
Member
Registered: 2021-07-08
Posts: 4

JOSM: How can I select the entire geometry of a GeoJSON Feature

Hi guys!

I have a simple GeoJSON file as below (it represents a simple rectangle):

{
    "type": "FeatureCollection",
    "features": [
        {
            "type": "Feature",
            "geometry": {
                "type": "MultiLineString",
                "coordinates": [
                    [[24.081728100515615,56.907953930904874],[24.081728100515615,56.908400069095116]],
                    [[24.082185899484383,56.907953930904874],[24.082185899484383,56.908400069095116]],
                    [[24.081728100515615,56.907953930904874],[24.082185899484383,56.907953930904874]],
                    [[24.081728100515615,56.908400069095116],[24.082185899484383,56.908400069095116]]
                ]
            }
        }
    ]
}

After loading it in JOSM I couldn't find a simple way to select the entire geometry of that feature. With simple mouse clicks I can select only individual segments. I'm interested in selecting a complex geometry with a simple key combination and eventually a few mouse clicks. Is this possible?

If using a Polygon in the above example instead of a MultiLineString, a simple click on one of the segments will select the entire geometry. I suspect JOSM cannot handle Multi* geometries.

NOTE: Selecting a rectangular region with the mouse is not an option in my case. I have a big GeoJSON file with multiple features described by complex geometries, so I cannot easily identify the elements of a particular feature. I want to select just one element/segment and see also the others that describe the same feature.

Thanks!

Offline

#2 2021-07-08 18:34:35

BCNorwich
Member
From: Norwich, Norfolk, UK
Registered: 2010-07-31
Posts: 149

Re: JOSM: How can I select the entire geometry of a GeoJSON Feature

Have you tried Ctrl + click, this will select as many objects as you want.

Offline

#3 2021-07-08 19:41:04

CosminPit
Member
Registered: 2021-07-08
Posts: 4

Re: JOSM: How can I select the entire geometry of a GeoJSON Feature

Thanks @BCNorwich. This seems suboptimal since each segment/object should be selected. A typical feature can contain up to 10-20 such objects, and the entire file contains a few 1000s of such features. Also as mentioned in the NOTE part, in some cases it is not obvious if two objects are part of the same feature (in order to be selected together). Ideally, I'd like to select one object and see the related ones as well (i.e. see the entire feature).

Offline

#4 2021-07-09 07:21:49

PHerison
Member
From: Rhein-Main
Registered: 2008-04-04
Posts: 1,669

Re: JOSM: How can I select the entire geometry of a GeoJSON Feature

Installing https://josm.openstreetmap.de/wiki/Help … ilsPlugin2 in JOSM you can use Ctrl+Shift+E to select connected ways of a selected object.

Online

#5 2021-07-09 09:46:54

CosminPit
Member
Registered: 2021-07-08
Posts: 4

Re: JOSM: How can I select the entire geometry of a GeoJSON Feature

Thanks for suggestion @PHerison! That will help to a certain extent, but the objects of a particular feature may not be connected.

From what I've seen so far, it seems JOSM can tackle only one shape/perimeter (connex component) at a time. For example even if a geometry is of Polygon type, but containing holes, it seems impossible to select all perimeters at once without picking them individually.

Offline

#6 2021-07-09 10:43:03

PHerison
Member
From: Rhein-Main
Registered: 2008-04-04
Posts: 1,669

Re: JOSM: How can I select the entire geometry of a GeoJSON Feature

You can try to use JOSM's search-capabilities to get the desired result selected. Hover with the mouse over the search-button to get some help or consult the wiki for more information about search-parameters in JOSM.

Online

#7 2021-07-09 16:19:38

Tordanik
Moderator
From: Germany
Registered: 2008-06-17
Posts: 2,683
Website

Re: JOSM: How can I select the entire geometry of a GeoJSON Feature

Yes, the search could be a workaround. Especially if you can make sure that each geometry has some unique attribute that can then be used to search for it. (You can then right-click on the tag and use "Search Key/Value/Type".)

CosminPit wrote:

I suspect JOSM cannot handle Multi* geometries.

Seeing how JOSM is an OSM editor first and foremost, and the OSM data model doesn't have Multi* geometries, I expect that JOSM converts those into multiple regular geometries when importing GeoJSON.

For a Polygon with holes, JOSM might create a multipolygon relation. If that's the case, you should have the option of selecting all members of the relation.


OSM in 3D: OSM2World

Offline

#8 2021-07-12 15:41:47

CosminPit
Member
Registered: 2021-07-08
Posts: 4

Re: JOSM: How can I select the entire geometry of a GeoJSON Feature

Thanks guys! I'll have a look at the search feature.

Offline

Board footer

Powered by FluxBB