Re: [josm-dev] Function to select or download a sequence of ways?

2010-03-15 Thread Marko Mäkelä
Hello Martin, hello Stephan,

On Mon, Mar 15, 2010 at 12:38:36AM +0100, Stephan Knauss wrote:
 Hello Martin,
 
 Martin Koppenhoefer wrote:
  another selection-feature I'm missing quite often (maybe it is already
  there and I don't know how to use it) is the use of the
  selection-rectangle to select ways but not nodes. Currently if you
  select by rectangle you will only select nodes, and ways completely
  surrounded. The selection I am talking about would select all ways
  intersected or completely within the selection rectangle, but not the
  contained nodes.
 
 I also don't know whether thnere is a more direct way or not. In case I 
 need to select a bunch of ways I do like this:
 
 1) Use rectangle to select area containing all desired ways (including 
 all nodes. Hold alt-key to select ways that have nodes inside selection)
 2) use search feature to search for type:node and remove from selection
 3) in case selection contains relations, repeat step 2 with relations

What I have done is select the area (or all objects) and then search for
type:way in the selection.  That can be combined with other attributes,
such as type:way highway=primary.

Marko

___
josm-dev mailing list
josm-dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/josm-dev


Re: [josm-dev] Function to select or download a sequence of ways?

2010-03-14 Thread Marko Mäkelä
Hi Karl,

 To the best of my knowlege there is no such function yet  ...

Now there is:
http://wiki.openstreetmap.org/wiki/JOSM/Plugins/WaySelectorPlugin

Thanks to your reply and the availability of WayDownloaderPlugin
source code, I got an easy start.

I posted some ideas for further development to the above wiki page,
but the plugin already scratches my itch (selecting the mainland coastline
in a large natural=coastline map extract).

 (3) you can listen to the current selection. See 
 org.openstreetmap.josm.data.osm.event.SelectionEventManager

I might look at this later, to update the enabled/disabled state
of the plugin based on the current selection.

Best regards,

Marko

___
josm-dev mailing list
josm-dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/josm-dev


Re: [josm-dev] Function to select or download a sequence of ways?

2010-03-14 Thread Martin Koppenhoefer
2010/3/9 Marko Mäkelä marko.mak...@iki.fi:
 Before I start reinventing the wheel in JOSM, I would like to know if there
 is a function or plugin that allows to select a non-branching sequence of
 ways.  It would be nice if the selection function could optionally be
 restricted to the current selection, just like the search dialog, and if
 some predicates could be assigned to the ways, say, highway=tertiary or
 natural=coastline, so that any branches where the predicate does not hold
 would be ignored.


another selection-feature I'm missing quite often (maybe it is already
there and I don't know how to use it) is the use of the
selection-rectangle to select ways but not nodes. Currently if you
select by rectangle you will only select nodes, and ways completely
surrounded. The selection I am talking about would select all ways
intersected or completely within the selection rectangle, but not the
contained nodes.

cheers,
Martin

___
josm-dev mailing list
josm-dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/josm-dev


Re: [josm-dev] Function to select or download a sequence of ways?

2010-03-14 Thread Stephan Knauss
Hello Martin,

Martin Koppenhoefer wrote:
 another selection-feature I'm missing quite often (maybe it is already
 there and I don't know how to use it) is the use of the
 selection-rectangle to select ways but not nodes. Currently if you
 select by rectangle you will only select nodes, and ways completely
 surrounded. The selection I am talking about would select all ways
 intersected or completely within the selection rectangle, but not the
 contained nodes.

I also don't know whether thnere is a more direct way or not. In case I 
need to select a bunch of ways I do like this:

1) Use rectangle to select area containing all desired ways (including 
all nodes. Hold alt-key to select ways that have nodes inside selection)
2) use search feature to search for type:node and remove from selection
3) in case selection contains relations, repeat step 2 with relations

Now you have a selection containing only the ways


Stephan

___
josm-dev mailing list
josm-dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/josm-dev


Re: [josm-dev] Function to select or download a sequence of ways?

2010-03-09 Thread Karl Guggisberg
Hi Marko

To the best of my knowlege there is no such function yet  ...

  As a further development, it could be useful to create a selective 
download function (follow this way until reaching a branch or a given 
bounding box).
... except for this function which sounds like what the waydownloader 
plugin provides.

Selection is a core thing. You can use it from plugins in three ways.
(1) you can influence the current selection. See setSelected() on 
DataSet. Invoke it on the current data layer (Main.main.getEditLayer())
(2) you can get the current selection. See getSelected() on DataSet. 
Invoke it on the current data layer (Main.main.getEditLayer())
(3) you can listen to the current selection. See 
org.openstreetmap.josm.data.osm.event.SelectionEventManager

Regards
Karl



Am 09.03.2010 10:07, schrieb Marko Mäkelä:
 Before I start reinventing the wheel in JOSM, I would like to know if there
 is a function or plugin that allows to select a non-branching sequence of
 ways.  It would be nice if the selection function could optionally be
 restricted to the current selection, just like the search dialog, and if
 some predicates could be assigned to the ways, say, highway=tertiary or
 natural=coastline, so that any branches where the predicate does not hold
 would be ignored.

 With such a selection function, it would be easy to select the coastline of
 an area within a natural=coastline extract of the planet extract, or to select
 a section of highway or railway for defining a route relation, for instance.

 Last, some questions to help getting me started, in case this does not
 exist yet.  Is the selection a core thing, or can this be done in a plugin?
 Where should I start looking first?

 As a further development, it could be useful to create a selective download
 function (follow this way until reaching a branch or a given bounding box).

 Best regards,

   Marko

 ___
 josm-dev mailing list
 josm-dev@openstreetmap.org
 http://lists.openstreetmap.org/listinfo/josm-dev



___
josm-dev mailing list
josm-dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/josm-dev