Re: [josm-dev] License Change Phase III

2011-04-12 Thread Paul Hartmann

Frederik Ramm wrote:

Hi,

   when the API is switched to license change phase 3, any attempt to 
open a changeset by someone who hasn't yet either agreed to, or 
rejected, the contributor terms will be met with a 403 Forbidden error 
code.


Will JOSM display the content of that error message to the user (so that 
the user knows why they got the message and that they need to log in to 
openstreetmap.org etc.etc.)?


Should we make an effort to catch the error in order to allow a 
translation?


No, I just did some tests and to the best of my knowledge, the following will 
happen:

* If an Error field is present in the header, JOSM will print it to the command 
line, but *not* the response body.
* Otherwise it will print the response body to the command line.
* There will be a message dialog with the text:

Authorisation at the OSM server with the OAuth token 'null' failed. 
The token is not authorised to access the protected 
resource 'http://api06.openstreetmap.org/api/0.6/changeset/*/upload'.

Please launch the preferences dialog and retrieve another OAuth token.

  Note, that this is shown even if no OAuth is involved, so the message is 
bogus.

Suggested course of action: 
* Fix the message and make a release ASAP.

* Wait for the server change to happen and check if it really works. Make a 
point release if not.

Especially helpful would be an opportunity to test on the development server or 
at least have a prepared git branch of the rails code prior to the change.

Paul

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


[josm-dev] JOSM tested

2011-04-14 Thread Paul Hartmann

Hi,

We have released 4021 as a new tested version. 


The problem regarding the Licence Change Phase III is (hopefully) fixed. Please 
keep the repository stable until the changes to the server are implemented, so 
we can add a point release if necessary.

Paul

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


Re: [josm-dev] Scripting plugin

2011-04-14 Thread Paul Hartmann

Jo wrote:

I'm back on track with the scripting plugin. I created a Jython script that
helps to find probable spelling errors in street names. It's quite specific
in that it supports the bilingual status of Brussels.

#!/bin/jython

#
# Spell checking.py  - Helps to locate probable spell errors
#
from javax.swing import JOptionPane
from org.openstreetmap.josm import Main
import org.openstreetmap.josm.command as Command
import org.openstreetmap.josm.data.osm.Node as Node
import org.openstreetmap.josm.data.osm.Way as Way
import org.openstreetmap.josm.data.osm.TagCollection as TagCollection
import org.openstreetmap.josm.data.osm.DataSet as DataSet

corrections = {'fr': [('Dr. ', 'Docteur '),('R. ', 'Rue '), ('Av. ',
'Avenue '), ('Bd. ', 'Boulevard '),
  ('Sq.', 'Square'), ('Pl.', 'Place'),
  (' De ', ' de '), (' Le ', ' le '), (' La ', ' la '),
(' Du ', ' du '), (' Des ', ' des '), (' Les ', ' les '),
  (' Au ', ' au '),(' Aux ', ' aux '),('À', 'à'),(' Den
',' den '), ( Sur ,  sur ),
  ( D', d'), ( L', l'), (' ,'),
  (Ecole ,École ), (Eglise, Église),
(Chateau, Château), (Cable, Câble), (General, Général)],
   'nl': [( Voor ,  voor ), ( Op ,  op ), ( Pour , 
pour ), ( Naar ,  naar ), ( Ter ,  ter ), ( En ,  en ), ( Van
,  van ),
  ('T , 't ), ('S , 's ), (-Ter-, -ter-),
( Het ,  het ),
  ( Straat, straat), ( Weg, weg), ( Laan,
laan), ( Steenweg, steenweg),
  ( Baan, baan), (Oudebaan, Oude Baan),
(Grotebaan, Grote Baan),
  (de Lijn, De Lijn)]}

commandsList = []
streetnames = {}

def getMapView():
if Main.main and Main.main.map:
return Main.main.map.mapView
else:
return None

def myOwnCapitalize(word):
# JOptionPane.showMessageDialog(Main.parent, word.decode('utf-8'))
if word:
return word[0].upper() + word[1:]
else:
return u

mv = getMapView()

if mv and mv.editLayer and mv.editLayer.data:
selectedNodes = mv.editLayer.data.getSelectedNodes()
selectedWays = mv.editLayer.data.getWays()
selectedRelations = mv.editLayer.data.getSelectedRelations()

if not(selectedNodes or selectedWays or selectedRelations):
JOptionPane.showMessageDialog(Main.parent, Please select
something)
else:
for way in selectedWays:
for isoLang in ['nl', 'fr', '']:
correctedName = result = u''
if isoLang:
nameColonIso = 'name:' + isoLang
else:
nameColonIso = 'name'
if way.hasKey(nameColonIso):
name=str(way.get(nameColonIso).encode('utf-8'))
if name in streetnames:
if streetnames[name] == 'ignore':
continue
else:
correctedName = streetnames[name]
else:
Main.main.getCurrentDataSet().setSelected(way)
# dummy = mv.editLayer.data.getSelected()
#
mv.zoomTo(Main.main.getEditLayer().data.getSelected())
# JOptionPane.showMessageDialog(Main.parent,
name.decode('utf-8'))
for subname in name.split(;):
for word in subname.split( ):
if word:
if - in word and len(word)1:
dashes = word.split(-)

correctedName +=
myOwnCapitalize(dashes[0])
for dash in dashes[1:]:
# if dash[0] == ' ':
# correctedName += u- +
myOwnCapitalize(dash[1:])
# else:
correctedName += u- +
myOwnCapitalize(dash.strip())
elif ' in word and not(. in word):
apo=word.split(')
if apo[0]: correctedName +=
myOwnCapitalize(apo[0])
correctedName += '
if apo[1]: correctedName +=
myOwnCapitalize(apo[1])
elif . in word or len(word)1 and
word[1]==word[1].upper() or len(word)2 and word[2]==word[2].upper():
correctedName += word
else:
correctedName +=
myOwnCapitalize(word)
correctedName += ' '
correctedName = correctedName.strip() + ';'
if correctedName and correctedName[-1] == ';':
correctedName = 

Re: [josm-dev] recent modification on snapping?

2011-05-07 Thread Paul Hartmann

M∡rtin Koppenhoefer wrote:

Has there been recently a modification on the snapping code? I have a
really annoying problem drawing ways in r.4074 which does sometimes
not allow me to draw another node close to an existing one. Is it
possible that there was a new bug introduced (because otherwise this
might also have to do with my switching to current ubuntu 11.04).


Possible, please write a bug report: http://josm.openstreetmap.de/newticket

We'll need a more precise description of the problem and it would help if you 
could name a previous version that definitely does not show this odd behaviour. 
(You can download older versions here: http://josm.openstreetmap.de/download/)

Bye, Paul

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


Re: [josm-dev] New plugin followline

2011-05-08 Thread Paul Hartmann

Germán Márquez Mejía wrote:

Hi list,

I've made a plugin [0] that draws a line over the path of another. Pretty much 
like the F shortcut in Potlatch2. It's not awfully good, but I myself find it 
really useful.


Do you know this patch? http://josm.openstreetmap.de/ticket/4190

It works quite well in principle, but the problem is user interaction. If you 
have a better solution, we could integrate it into JOSM core directly. 
Alternatively you can add your feature to UtilsPlugin2 or create a new plugin. 
I think contourmerge plugin is also related to this topic.

I understand I must ask here first for write permissions to the SVN server in 
order to commit it and make it available for other users/developers, so that's 
what I'm doing :)


JOSM team does not manage svn.openstreetmap.org accounts, see 
http://wiki.openstreetmap.org/wiki/SVN how to get one. (Shouldn't be a problem, 
thought.)

Regards, Paul

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


Re: [josm-dev] Reusing conflict panels for conflation plugin

2011-05-18 Thread Paul Hartmann

Josh Doe wrote:

I'm back to working on a UI for performing conflation as I've
mentioned on this list before. Right now I've got a series of tabs,
the first allows the user to freeze/restore two selections (Mine and
Theirs), the next configures the matching options, and the third
presents the results.

The results are the most important, and what I'm thinking about doing
is having a table which shows the matched pairs, including the
distance between them, and then below that table reusing the TagMerger
panel. The user can select any row (matched pair) in the list, and the
tags will then be shown to be merged below. Some enhancements could
include a popup/context menu to allow applying the same operation to a
selection of pairs, with options like My Tags, My Geometry, My
Tags, Their Geometry, Their Tags, My Geometry, and Their Tags,
Their Geometry.

Is reusing the TagMerger panel good practice? I think the only thing I
don't like is the local dataset/server dataset labels, but if
that's the only issue it's not worth maintaining a nearly identical
copy.

Two reasons why I don't want to use the existing conflict dialogs is
because sometimes I'll be merging disparate primitive types (e.g. a
node with a way), and also the current system is not suitable for
rapidly moving through hundreds of conflicts.

Any suggestions are appreciated.


When in doubt, just copy  paste. The code can still be refactored and unified 
later.
For small changes, like the text label, you can send us a patch that adds:

protected String getLocalDatasetText() {
  return tr(local dataset);
}

then, override this method in your plugin. (But within reason, the code 
shouldn't get too cluttered.)

There hasn't been much development related to conflicts lately. So if you can 
help to add batch resolution of conflicts, I'm probably not the only one who 
would be very grateful.

Paul


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


Re: [josm-dev] Plugin images from osm in JOSM wiki

2011-05-24 Thread Paul Hartmann

colliar wrote:

Hi

I tried to add the utils2 icon on the JOSM wiki, but I did not get
around using a path including a revision.
Is there a possibility without a revision in the path ?

cu colliar


You can replace version number by HEAD (upper case, without the quotes). 
Btw., there are 2 places with UtilsPlugin2 doc:

http://wiki.openstreetmap.org/wiki/JOSM/Plugins/utilsplugin2 and 
http://josm.openstreetmap.de/wiki/Help/Plugins/UtilsPlugin2. It should probably 
be merged and put in one place, otherwise both versions will get out of sync.

Paul

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


[josm-dev] [PATCH] OsmPrimitive / PrimitiveData refactoring

2011-05-26 Thread Paul Hartmann

Hi,

There are two structures

OsmPrimitive / Node / Way / Relation

and

PrimitiveData / NodeData / WayData / RelationData.

Both have much in common, however, the class trees are unrelated at the moment. 
In order to avoid code duplication when it really doesn't matter if you have an 
object from the 1st or from the 2nd category, I put common features to an 
interface and added an abstract base class [1,2]. The above classes can be 
replaced by the respective interface

 IPrimitive / INode / IWay / IRelation

when only common functionality is needed. Commit [3] shows, how this would look 
in practice: In my use case, I'd like to upload PrimitiveData objects without 
converting them to OsmPrimitive first.

Haven't checked the history stuff, maybe this can be consolidated as well, 
somehow.

[1] https://github.com/bastik/josm/commit/a91ea53
[2] https://github.com/bastik/josm/commit/780d186
[3] https://github.com/bastik/josm/commit/7b1d245

Paul

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


Re: [josm-dev] [PATCH] OsmPrimitive / PrimitiveData refactoring

2011-05-29 Thread Paul Hartmann

Paul Hartmann wrote:

[1] https://github.com/bastik/josm/commit/a91ea53
[2] https://github.com/bastik/josm/commit/780d186
[3] https://github.com/bastik/josm/commit/7b1d245


Applied (4098-4100). I was prepared to recompile most of the plugins, but it 
seems to be no problem to move methods to super class. Lucky me.

Paul

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


Re: [josm-dev] License change plugin

2011-07-02 Thread Paul Hartmann

On 07/02/2011 06:11 PM, Frederik Ramm wrote:

Maybe we should do away with the distinction between non-agreeing and
undecided users; anyone who is still undecided today is probably very
likely to be unreachable and thus this would be a clear data loss.


There are imports, where the license situation still has to be 
clarified, but a positive outcome is expected.


Paul

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


Re: [josm-dev] addr mask / last tag takeover / dysfunctional when building=yes on way

2011-07-07 Thread Paul Hartmann

On 07/07/2011 11:57 AM, Kay Drangmeister wrote:

Am 07.07.2011, 10:04 Uhr, schrieb Dirk Stöcker
openstreet...@dstoecker.de:


The defaults do not work.



refusing an obvious choice of offering the last
city/postcode/street the user entered is - oem - a strange decision.


Thus we
have choosen the current variant which means a simple and understandable
rule: Only use defaults when not already tagged.


My opinion: it worked well before.


Which version?

Paul

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


Re: [josm-dev] Customizable name formatter

2011-07-20 Thread Paul Hartmann
On 07/19/2011 09:40 PM, Jiri Klement wrote:
 Hi,
 
 I think it would be useful to make formating of primitives
 configurable (ie modify DefaultNameFormater class). For example we use
 special tagging for hiking routes in Czech Republic and it would be
 nice to have these routes displayed differently in relation list view.
 It's possible to write plugin for it (see #6535), but it seems like
 overkill in this case.
 
 Idea is to have name templates in tagging preset file that will be
 used to create primitive display name. Templates are inspired by
 mkgmap rules, syntax proposal:
 
 House {addr:housename} - Use string House  and value of addr:housename tag
 
 ?{ 'House number {addr:housenumber} at {addr:street}' | 'House number
 {addr:housenumber}'  } - use first variant if condition is satisfied
 (that is both addr:housenumber and addr:street tags exists), second
 variant otherwise.
 
 ?{ admin_level = 2 'NUTS 1' | admin_level = 4 'NUTS 2' | admin_level
 = 6 'NUTS 3' |  '{admin_level}'}  - as above, but condition is
 explicitly defined using search expression.

Could be useful for labelling objects on the map as well. Like #6122,
but better.

 Name templates can be distributed as part of tagging preset file.
 There is already code that lookup tagging preset for primitive that is
 used to show presets in Properties dialog. Also there is already
 infrastructure for sharing presets. It seems to me like practical
 solution though it's a bit unclean to mix presets and name templates
 together.
 
 Other possibility is use separated files, then searching for
 appropriate template for primitive would be best done by search/filter
 expression. Or this is not suitable for core at all and it should be
 rather provided via plugin.
 
 It might useful to make it possible to define custom icon for primitive as 
 well.

We already have the situation, that certain presets are more useful in
combination with a map style that covers the same topic. So on the long
run we could abandon stand-alone presets  styles and have packages or
extensions instead.

These would contain one or more presets, map styles, name formatters, etc.

Paul

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


Re: [josm-dev] MapCSS selector operators

2011-07-26 Thread Paul Hartmann
On 07/26/2011 09:51 AM, Malcolm Herring wrote:
 On 25/07/2011 19:41, Paul Hartmann wrote:

 I'd call it a missing feature. There is no != or =~ operator for eval
 expressions [1]. You can work around the first limitation like this:

 I was not using it within an eval expression, but with the result:
 
 eval(prop(someproperty))=somevalue works as expected.
 eval(prop(someproperty))!=somevalue causes a parsing error.

'eval' is a function that does nothing, so
[eval(prop(someproperty)=somevalue)],
[eval(prop(someproperty))=somevalue] and [prop(someproperty)=somevalue)]
is pretty much the same in JOSM. However, a simple
[{key}{operator}{value}] conditions is treated special (mostly for
efficiency reasons).

 Of course, if 'set' were implemented, I would not be using eval in
 selectors in the first place. As Komяpa pointed out, this is not kosher
 MapCSS.
 
 So should I submit a bug ticket for something that should not be there,
 or a feature request ticket for implementation of 'set'?

An != operator for eval expressions should definitely be there. Whether
you use it within selectors is your own choice.

Anyway, would be good to have 'set' implemented, as well. I still don't
know what it does exactly, though. E.g. can you write something like this?

*[religion][religion!=christian][religion!=jewish] {
  set religion=INT-generic;
}

way[landuse=cemetery][religion=INT-generic] {...}

This would be similar to how Mapnik manipulates the tags in a data base
query.

Paul

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


Re: [josm-dev] Autogenerated JAXB files in JOSM SVN

2011-08-20 Thread Paul Hartmann
On 08/20/2011 09:58 AM, Giovanni Mascellani wrote:
 On 15/08/2011 19:14, Jiri Klement wrote:
 Hi,

 The files were generated using xjc tool from wms-cache.xsd file. JAXB
 is used to simplify reading of xml files - xml is automatically
 transformed into java objects that are easier to process than for
 example SAX events.
 
 Thanks for the explanation. Anyway, I cannot find the file wms-cache.xsd
 anywhere. Is it on the SVN? If not, could you send me one copy?

$ find -name wms-cache.xsd
./data_nodist/wms-cache.xsd

 The files doesn't need to be checked in svn, it would be quite easy to
 generated them using xjc ant task. Anyway, I didn't think it was worth
 the effort, especially when there are plenty of unnecessary files in
 workspace (like apache stuff connected via svn externals and other
 classes copied from different projects).
 
 Yes, that repository really would benefit from a bit of cleaning work.

For example?

 Anyway, I really encourage you to keep the file wms-cache.xsd. You can
 also keep the generated files if you think this eases your work.
 Consider also that Josm is distributed under the GPL license, and the
 GPL mandates that every source file must be available (there are many
 ways in which some one can accomplish to this requisite: probably the
 easiest is to keep all the sources in the SVN).
 
 Thanks, Giovanni.

Giovanni, thanks for packaging JOSM for Debian!

I'd love to have an up to date deb-repository for josm-latest  -tested.
My first attempt failed, this is way more involved, than I expected. :)

Paul

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


Re: [josm-dev] r4188 - removal of debug code

2011-08-21 Thread Paul Hartmann
On 08/21/2011 02:21 PM, Dirk Stöcker wrote:
 On Sun, 21 Aug 2011, Stefan Breunig wrote:
 
 I'd have a really hard time believing that the JVM can't optimize stuff
 like this:

 and right you are;
 http://stackoverflow.com/questions/1813853/ifdef-ifndef-in-java/1813871#1813871


 It's compiled out, even if the main function isn't static. If you are
 in doubt, just javap -c at the class file and search for a debug string
 with debug = false and with debug = true and see if it works for the
 class at hand.
 
 Hmm, I don't really trust this. It possibly works for easy situations,
 but I have seen to much this should be optimized out code remain in
 release versions to really rely on that feature.

Then just use the pattern in the easiest possible form - it does all
that is required. Even if the unlikely event should happen and the debug
code remains in the class file, it doesn't matter in this case. For most
parts of the sources, performance is not an issue, so a no op call here
an there is basically nothing.

There are clearly limits, what the Java Compiler can optimise out, e.g.
everything that could be accessed by reflection must stay.

For a similar reason I don't really like the java logging framework. You
always have the cost of argument construction, even if the logger is
turned off. (Yes, you can do 'if (logger.isDebugEnabled() {
logger.debug(...); }' but it's quite verbose.)

 I know sometimes I'm old-fashioned (not wanting git, don't using all
 these fancy new tools for specific tasks, not relying on compiler
 automatics, ...), but most of this comes from experience: E.g. if you do
 re-engineering of Assembler code to find a bug in your software and
 find, that the compiler is broken you loose your trust in compilers.

 I hope you all can live with that. :-)
 
 P.S. I'm even one of the few people not using IDE's at all, as I learned
 programming before graphical-all-in-one-interfaces became available.
 Which on the other hand means I still can work from 80x25 ASCII remote
 terminals without any problems.

Now I know, why you don't do unit testing: It's a pain without an IDE.
:) Anyway, you should give IDEs a try, e.g. interactive debugging can be
quite useful.

Paul

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


Re: [josm-dev] implementing a windows menu (bug #59)

2011-08-27 Thread Paul Hartmann
On 08/27/2011 11:02 AM, Dirk Stöcker wrote:
 On Sat, 27 Aug 2011, Stefan Breunig wrote:
 
 More important though: to achieve this I create the map frame once on
 start and never destroy it. Is there any disadvantage I missed? I know
 about the bug where the view in the download diag is reset to 0.0, 0.0
 and that code depending on notifyMapFrameChanged will have to be
 adjusted and simply assume the map frame is there.
 
 If this really is a good idea?

Basically all plugins implement mapFrameInitialized. Does this method
with two arguments still make sense, when your patch is applied?

Can you explain the reason for the change in more detail? (Btw. it is
difficult to read your patch because most of all the formatting diffs.)

What about the toggle buttons in the lower left? They could be hidden by
default, with an advanced option, to bring them back.

Paul

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


Re: [josm-dev] implementing a windows menu (bug #59)

2011-08-27 Thread Paul Hartmann
On 08/27/2011 01:03 PM, Stefan Breunig wrote:
 Basically all plugins implement mapFrameInitialized. Does this
 method with two arguments still make sense, when your patch is
 applied?
 
 No, my plan was to get rid of it altogether so plugins can simply use
 Main.map or similar to get the MapFrame. Since it would never be
 destroyed there would be no need to listen to new map frames. (This is
 not in the patch yet).
 
 Can you explain the reason for the change in more detail?
 To display the toolbar buttons, the items in the Windows menu and in the
 prefs → toolbar dialog they have to be actually present. I.e. they need
 to be created before they can be displayed and they will be removed if
 the dialog is destroyed. Without these changes the toolbar
 buttons/window menu items would become visible if a map frame is created
 (any layer opened) or destroyed (all layers closed). If found this to be
 rather uncommon and especially the need to have a map frame open in
 order to configure the toolbar properly sounded bad UI wise. So what I
 needed to do was to register the toggle dialogs early. While it would be
 possible to add an extra hook so that their menu entries can be created
 before there's an actual map frame I found it to be much easier to
 simply create the map frame on start and just never destroy it to keep
 the menu items valid. I found no deal-breaking disadvantages to this,
 there only appear to be minor bugs and the plugin API will change.

Still seems to me like an ad hoc change that is not really needed. You
could add proxy actions that are disabled when the mapframe is null.

I like the idea that you can close all layers and memory footprint drops
down to the level after fresh start. There has been some work to get rid
of memory leaks and carefully unregister listeners and so on. This is
probably still possible with your approach, but it complicates things.

Paul

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


Re: [josm-dev] Version 4327 is from 32nd of July.

2011-08-30 Thread Paul Hartmann
On 08/30/2011 12:13 PM, Martin Koppenhoefer wrote:
 the startpage shows this:
 2011-07-32 (4327)
 Select and delete mode now have better visual indication what the next
 action will do (highlighting, cursor changes).
 
 can this be changed to
 2011-08-21 ?

You can fix this yourself, it's a wiki.

Cheers, Paul

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


Re: [josm-dev] perform GET from Jython script

2011-09-17 Thread Paul Hartmann
On 09/15/2011 08:08 PM, Jo wrote:
 Hi Paul,
 
 I know how to set something selected, but now I'd like to also zoom into
 this selection automatically. Could you point me in the right direction for
 accomplishing that?

Open MainMenu and look for these Actions in the View menu (that's how I
would do it).

 PS: did you see the examples I posted?

Yes, much appreciated. :)

Cheers, Paul

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


Re: [josm-dev] perform GET from Jython script

2011-09-17 Thread Paul Hartmann
On 09/17/2011 04:19 PM, Jo wrote:
 I don't get any further than this:
 
 from javax.swing import JOptionPane
 from org.openstreetmap.josm import Main
 import org.openstreetmap.josm.data.osm.Node as Node
 import org.openstreetmap.josm.data.osm.Way as Way
 import org.openstreetmap.josm.data.osm.Relation as Relation
 import org.openstreetmap.josm.data.osm.TagCollection as TagCollection
 import org.openstreetmap.josm.data.osm.DataSet as DataSet
 import org.openstreetmap.josm.data.osm.RelationMember as RelationMember
 
 def getMapView():
 if Main.main and Main.main.map:
 return Main.main.map.mapView
 else:
 return None
 
 mv = getMapView()
 if mv and mv.editLayer and mv.editLayer.data:
 selected = mv.editLayer.data.getSelected()
 
 if not(selected):
 JOptionPane.showMessageDialog(Main.parent, Please select
 something)
 else:
 for element in selected:
 print dir(element.getBBox())
 print element.getBBox().bounds
 mv.zoomTo(element.getBBox().bounds)
 
 Mapview has a method of zoomTo, but I have no clue as to what to feed it.

You can try AutoScaleAction.zoomToSelection() or
AutoScaleAction.autoScale(selection).

Cheers, Paul

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


[josm-dev] pixel per degree

2011-09-19 Thread Paul Hartmann
Hi,

Why is it called pixelPerDegree in ImageryInfo? Apparently, the value
is in pixels per unit in projected space (pixelPerEastNorth).

There is an interesting bug in ImageryLayer.getPPD(), line 86: It
returns Main.getProjection().getDefaultZoomInPPD() when mapframe is
null. However the Projection-PPD is not the same, as the
Imagery-PPD, in fact they are inverse to each other. (Or
NavigatableComponent line 99 is wrong, I haven't investigated the full
history if this...)

I suggest to rename all this, so it makes more sense.

Paul

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


Re: [josm-dev] pixel per degree

2011-09-21 Thread Paul Hartmann
On 09/19/2011 05:33 PM, Dirk Stöcker wrote:
 On Mon, 19 Sep 2011, Paul Hartmann wrote:
 
 Why is it called pixelPerDegree in ImageryInfo? Apparently, the value
 is in pixels per unit in projected space (pixelPerEastNorth).
 
 Which is nonsense as well. It should not be relative to projected
 coordinates. 

What is the alternative? WMS cache as well as the global scale is
relative to projected coordinates.

One option would a scale in pixel per meter. But it changes with
location (also can be different in NS and EW direction). In order to use
the cache, you need the exact scale value in pixelPerEastNorth. When
converting back from pixelPerMeter to pixelPerEastNorth there will be a
rounding error.

 I think the sole idea behind this is the bookmark feature
 and this should not depend on projection.
 This is very old code (before we had proper projection support) and
 probably neeeds to be reworked. The idea of bookmarks is to have a
 cross-session caching possibility.

I was referring to everything that is named *pixelPerDegree or *PPD, not
just the bookmark feature.

Paul

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


Re: [josm-dev] updating mappaint styles

2011-09-22 Thread Paul Hartmann
On 09/22/2011 01:20 PM, Martin Koppenhoefer wrote:
 How / when are mappaint-styles updated? I did some updates to the
 mappaint-style for maxspeed signs (on its wikipage on josm.osm.de) but
 I don't get the modifications locally. I incremented the version
 number from 1.0 to 1.1 (now I discovered that this was changed to
 1.4_2011-09-22) and expected JOSM to download the newer version. Do
 I have to do something manually, and what?

That's on my todo list, currently there is no convenient way to clear
the mappaint style cache. You can manually delete the cache file in the
JOSM folder.

Paul

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


Re: [josm-dev] downloading referrers and incomplete relation members from a script

2011-10-04 Thread Paul Hartmann
On 10/04/2011 07:21 AM, Jo wrote:
 And it works... asynchronously. If I use this code in a larger script, the
 code following it gets executed before the download is ready. This, of
 course, creates problems since the rest of the code depends on what was
 being downloaded.
 
 Is there a way to make it wait? I've been trying countless scenarios All to
 no avail.

You can try something like this:

Main.worker.submit(new Runnable() {
public void run() {
// all code that depends on the
// downloaded referrers goes here
}
});

If this does not work, try wrapping it further in

SwingUtilities.invokeLater(new Runnable() {
public void run() {
...
}
});

or the other way around, possibly multiple times (alternating).

Basically you have two threads, one is for network IO and expensive
calculations (worker) and the other for the GUI and lightweight stuff
(EDT). The script runs in EDT and
DownloadReferrersAction.downloadReferrers(...) schedules a task for the
worker. Both threads have a list of tasks that are processed in
sequence, so the DownloadReferrersTask should be finished, when the
worker thread works off the next task from the list.

Hope this helps, the code isn't really written with quick and dirty
scripts in mind.

Paul

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


Re: [josm-dev] Dynamic buttons in side menus

2011-10-15 Thread Paul Hartmann
On 10/15/2011 05:50 PM, Dirk Stöcker wrote:
 On Sat, 15 Oct 2011, Ilya Zverev wrote:
 
 On Sat, 15 Oct 2011 17:11:42 +0300, Komяpa wrote:
  I got used to dynamic buttons almost immediately. Just clicked where
  they usually were, and they appeared right under mouse cursor.

 The key word being usually were. New users will feel a big WTF not
 seeing any buttons in those panels, and they won't get used to it
 (because why should they? there's simple and obvious potlatch). I too
 have 13whatever by 768 screen, and 4-5 panels enabled - and there's
 enough space. Even if it weren't, as I said, the panels are there not
 to watch, but to edit, and in either case one has to scroll the list.
 But now it is not as obvious: you see the line, but you can't get to
 it. You need a button, but you don't see it. The option undoubtely is
 useful for some, but it is not good UI decision, so I propose to turn
 it off by default, not remove.
 
 Wow, the same discussion as for virtual nodes. As I was unsure whether
 this should be default or now it was not default for a longer time in
 which I had a lot of people testing this. None of them really
 complained, but they like the additional freedom of the display in the
 right side.

The right hand side now looks more clearly arranged and uncluttered -
this is one positive thing I can say about these dynamic buttons.

Still, there is a serious flaw in the design: The visible space shrinks,
as soon as you hover above the dialogue. This is very irritating when
you don't intend to use the buttons, but try to interact with the list
entries directly.

E.g. say, there are three layers displayed in the layer dialogue and the
height is adjusted such that all three entries just fit in the list.
Now you like to hide the 3rd layer and attempt to click on the eye
symbol of that layer. But as soon as the mouse cursor reaches the icon,
it gets covered by the button row.

For the properties dialogue, you don't need the buttons at all. Alt-B
(now Alt-A) adds a new tag, double click edits it and click del-key
removes a tag. So in this case, the button row just gets in the way.

One possible solution would be to get rid of the buttons completely.
E.g. tag editing could be like in the relation editor (and Potlatch 2's
advanced tagging mode).

Paul

PS: For reference, here is the corresponding trac ticket:
http://josm.openstreetmap.de/ticket/6731

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


Re: [josm-dev] composing display name for relations from operator ref name from via to

2011-10-20 Thread Paul Hartmann
On 10/21/2011 12:00 AM, Jo wrote:
 Hi Paul,
 
 He created a wiki page:
 
 http://josm.openstreetmap.de/wiki/NameTemplate
 
 Which I took the liberty to correct and beef up a little. I have no
 idea if the order of items is still logically built up though, but it
 should clarify the usage of the feature at least. He has been very
 helpful to get me going, but he didn't change the wiki page any more.
 I hope he's happy with it.

Looks good, your improvements are very welcome!

 Of course, now I asked him to go one step further and whether it's
 possible to use tags from parent relations in the displayed name. (I
 guess not, but it would be useful for route relations which are part
 of network relations). In fact this is what one contributor in Belgium
 proposes to have as the name of hiking node network routes. ZD 10-12
 (Zuid-Dijleland from node 10 to node 12) and another user (old timer)
 opposes this, since his reasoning is that these routes simply don't
 have names. So the 10-12 has to go into 'note'. This then gives
 problem in Potlatch, since they simply display the long integer ID, if
 the route has no name, but that is another discussion altogether :-)

I think inclusion of parent relation tags is too specialized and
complicated for a general scheme. You could however write a
(minimalistic) plugin, that handles the formatting.
The necessary hooks are already implemented (see
http://josm.openstreetmap.de/ticket/6535)

Paul

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


Re: [josm-dev] Simple Addr Interpolation / utilsplugin2

2011-10-31 Thread Paul Hartmann
On 10/31/2011 05:34 PM, Werner Horsch wrote:
 thanks to Paul my Netbeans is up and running and I've started coding this
 plugin
 
 questions
 1) to the utilsplugin2 coders.
 do you mind if I add this functionality to this plugin?

Please extend the plugin AddrInterpolation. (Add another menu item if
you like.)

 2) is there a method to calculate distance between points and distance from
 a point to a way. what's the class containing it?
 For sure this is not a big deal to code but certainly there are a lot of
 geo-functions already coded in some library

Not really, most of the more complicated calculations are in screen
coordinates (projected coordinates to be precise). However, you can get
the spherical distance of two points in LatLon.greatCircleDistance.

Some stuff is in Geometry.java. For a way parallel to another street,
the following classes might be useful: MapPainter.OffsetIterator and
ParallelWays.

Paul

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


Re: [josm-dev] MapCSS selector to match way in multiple relations

2011-11-03 Thread Paul Hartmann
On 11/03/2011 08:44 AM, Martin Ždila wrote:
 Hello
 
 I'd like to create a MapCSS for hiking trails. In our country we use 4
 colours to mark hiking trails. Some ways may be parts of multiple
 trails. What I want is to draw parallel lines to such ways but not
 with fixed offset for each color.
 
 I found that offset style must be an absolute value and so I need to
 specify offset for all color combinations like this:
 
 relation[osmc:symbol^=red]  way::redLayer { color: red; offset: 5 }
 relation[osmc:symbol^=green]  way::greenLayer { color: green; offset: 5 }
 relation[osmc:symbol^=blue]  way::blueLayer { color: blue; offset: 5 }
 relation[osmc:symbol^=yellow]  way::yellowLayer { color: yellow; offset: 5 }
 
 /* Following rules should override previous per layer: */
 /* Following uses unsupported syntax: */
 
 relation[osmc:symbol^=red  osmc:symbol^=green ]  way::greenLayer {
 offset: 10 }
 relation[osmc:symbol^=red  osmc:symbol^=blue ]  way::greenBlue { offset: 10 
 }
 relation[osmc:symbol^=red  osmc:symbol^=yellow ]  way::greenYellow {
 offset: 10 }
 
 ... and many other combinations
 
 Is there a way to write it in some supported syntax? Or is there some
 different way to render marked trails as I described?

Hi Martin,

try this [1]. Eval is no fun at the moment, because there is so little
debugging output, but it should work.

Paul

[1]

relation[osmc:symbol^=red]  way {
red: true;
}
relation[osmc:symbol^=blue]  way {
blue: true;
}
relation[osmc:symbol^=green]  way {
green: true;
}

way::red_layer {
offset: 0;
}
way[prop(red,default)]::red_layer {
color: red;
width: 3;
offset: 5;
}

way::blue_layer {
offset: prop(offset,red_layer);
}
way[prop(blue,default)]::blue_layer {
color: blue;
width: 3;
offset: prop(offset,red_layer) + 5;
}

way::green_layer {
offset: prop(offset,blue_layer);
}
way[prop(green,default)]::green_layer {
color: green;
width: 3;
offset: prop(offset,blue_layer) + 5;
}

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


Re: [josm-dev] rendering maps to tiles

2011-11-03 Thread Paul Hartmann
On 11/03/2011 08:51 AM, Martin Ždila wrote:
 Hello
 
 Is there any plan to develop a feature of rendering map to image
 tiles? I think that rendering part JOSM is so feature rich that is is
 very near to include features of Maperitive. It would be great to have
 multiplatform map2tile rendering software.

Nothing planned in particular (as far as I know), but it's a good idea.
Should be possible to do this as a plugin, no need to ask for permission. :)

Paul

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


Re: [josm-dev] Print plugin

2011-11-13 Thread Paul Hartmann
On 11/13/2011 12:04 PM, Kai Pastor wrote:
 Hello,
 
 I've just published a plugin print which adds a basic map print
 capability to JOSM. The source code is in OSM SVN.

It's great!

Feel free to send patches, if you need some refactoring for JOSM core.
(Interesting you got it working without touching core code.)

Paul

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


Re: [josm-dev] PicLayer - modification

2011-11-23 Thread Paul Hartmann
On 11/18/2011 05:11 PM, Valeriy Pekarskyy wrote:
 And again - Hello!
 
 I have the next version for the testing :) may be anyone interested.
 
 http://dl.dropbox.com/u/11265861/PicLayer.jar - here is plugin jar
 http://dl.dropbox.com/u/11265861/piclayer.7z - compressed sources.
 
 Lot of refactoring done. New map modes introduced. Ability to hide
 action buttons from menu. Ability to use old controls. Realtime
 transformations (drag-n-drop)!

This is cool, I like the integration with the old controls and the
realtime transformation.

When rotating a transformed picture it seems a little strange.

 Still had no time to test of opening of old cal files, but it may work now.
 World files still do not work.
 There are some side effects when you try to rotate or scale map with
 points set, but it does not interfere plugin.
 
 Yeah - if anyone has designer skills to replace ugly red and green
 arrow pictures - welcome!
 
 How to use:
 1. Install the plugin.
 2. Download some data.
 3. PicLayer-from file/from clipboard.
 4. Select layer in layers list.
 5. Select green arrow mode in right toolbox - selecting mode.
 6. Click on key points at the picture. You also can move points at this mode.
 7. Select red arrow mode - that is transforming mode.
 8. Drag points at the picture - it transforms at the real time.
 
 Any comments are appreciated.

The snap radius for the points could be larger - it's like one or two
pixels. It would be really fancy to have changing mouse cursor and
mouse-over effects (like in select mode).

I'd really like to see this integrated into the main Piclayer Plugin.
Wold file support is the only major thing missing?

Paul


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


Re: [josm-dev] PicLayer - modification

2011-11-25 Thread Paul Hartmann
On 11/24/2011 10:44 AM, Valeriy Pekarskyy wrote:
 I set snap radius to 10px now, so it should be easier to adjust.

I snap radius seems to depend on zoom scale.

 World files work now, I have commited my changes to svn so anyone who
 wants to see the functionality in action can now update plugin from
 josm...
 
 Also - I changed wiki of plugin a bit to be up-to-date. Picture with
 animation in-action is added too:
 http://wiki.openstreetmap.org/w/images/2/20/Piclayer_usage.gif

I noticed a change for the 'move' tool: It used to keep the size of the
image constant (in meters). Now it changes with the distortion of the
projection. I guess it's no big deal, as most projections are very flat
at large scales. Also, most users will probably expect the new behaviour.

Paul

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


Re: [josm-dev] PicLayer - modification

2011-11-25 Thread Paul Hartmann
On 11/25/2011 12:07 PM, Valeriy Pekarskyy wrote:
 That are 10 px of the image. Will look what can be done with it.

It is a problem for high resolution images. Distance in screen pixels
would be better IMO.

 2011/11/25 Paul Hartmann phaau...@googlemail.com:
 On 11/24/2011 10:44 AM, Valeriy Pekarskyy wrote:
 I set snap radius to 10px now, so it should be easier to adjust.

 I snap radius seems to depend on zoom scale.

 World files work now, I have commited my changes to svn so anyone who
 wants to see the functionality in action can now update plugin from
 josm...

 Also - I changed wiki of plugin a bit to be up-to-date. Picture with
 animation in-action is added too:
 http://wiki.openstreetmap.org/w/images/2/20/Piclayer_usage.gif

 I noticed a change for the 'move' tool: It used to keep the size of the
 image constant (in meters). Now it changes with the distortion of the
 projection. I guess it's no big deal, as most projections are very flat
 at large scales. Also, most users will probably expect the new behaviour.
 
 Can you please be more detail, I cannot get what it means.

Forget this, it's rubbish.

Paul

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


Re: [josm-dev] JOSM API

2011-12-12 Thread Paul Hartmann
On 12/12/2011 06:23 PM, Frans Thamura wrote:
 hi all
 
 i am seeking doc related to JSOM API, and how JOSM communicate with OSM API

There is no doc, but all the calls to the OSM API are printed to the
command line, if you start JOSM from a console window.

 what happen if OSM API patched.

As soon as API 0.7 is introduced, JOSM will get updated. Not much we can
do about it right now. Maybe there is a better answer if you tell us
what the question is about.

Paul


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


Re: [josm-dev] JOSM API

2011-12-13 Thread Paul Hartmann
Hi Frans,

 where i can get information regarding to 0.7 development?

The OpenStreetMap API v. 0.7 is far in the future, so I think there is
no serious information at the moment. When there is development, there
will probably be an update on this page:

http://wiki.openstreetmap.org/wiki/API

 and which API in JOSM will use 0.7?
 
 i just think JOSM must produce JSOM API, so Java programmer can use
 the same api with JSOM for their development

What is JSOM API? Do you mean JSON?

This project is an editor application for OSM-Users and not a library.
If you have a Java project where you want to talk to the OSM-Server, you
can probably copypaste a lot of source code from JOSM, but it's still
some work to get it running.

Paul

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


[josm-dev] new package repository for Ubuntu

2011-12-13 Thread Paul Hartmann
Hi,

there's now a JOSM apt repository for Ubuntu. It provides two packages:

josm
The tested version
Replaces the package from the official Ubuntu repository.
josm-latest
The development version (nightly build)
Can be installed parallel to the josm package.

For details, see
https://josm.openstreetmap.de/wiki/Download#Ubunturepository

Paul

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


Re: [josm-dev] Stabilization ends

2011-12-18 Thread Paul Hartmann
On 12/18/2011 02:57 PM, Dirk Stöcker wrote:
 Hi,
 
 stabilization phase ended today. So patches accumulated over the last
 week may be integrated. We had a very long stabilization phase caused by
 Paul's idea to improve the preferences :-)
 
 I know this delay is one of the drawbacks of our current development
 model, but as it happens very seldom I think we can live with it (all
 other possible models have drawbacks also).
 
 The next release will be end of January, so we skip one release completely.
 
 As promised the three incomplete languages will be dropped with next
 release. Turkish and Greek have been improved and are not removed.

There are two new reports:

http://josm.openstreetmap.de/ticket/7158
http://josm.openstreetmap.de/ticket/7162

#7158 is probably a rare situation or special configuration. (We haven't
had any complaints so far.)

Not sure how serious #7162 is, but I'd feel more comfortable, if this
was fixed in the tested version.

Paul

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


Re: [josm-dev] share resources with other editors

2011-12-18 Thread Paul Hartmann
On 12/18/2011 04:04 PM, Jonathan Bennett wrote:
 On 18/12/2011 13:46, Dirk Stöcker wrote:
 
 Working together with the autors of other editors also would be a good
 idea, but until today all such tries failed miserably.
 
 I suspect what this needs is for one person to just go ahead and
 implement something, and for the other editor coders to see what they've
 done -- similar to how MapCSS got adopted.

The lowest hanging fruit would be to share TMS sources:

http://git.openstreetmap.org/potlatch2.git/blob/HEAD:/resources/imagery.xml
http://josm.openstreetmap.de/wiki/Maps

Both lists are quite long, but have surprisingly little overlap.

The format seems to be more or less compatible, in the sense that you
could automatically translate from one to the other.

Paul

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


Re: [josm-dev] new package repository for Ubuntu

2011-12-24 Thread Paul Hartmann
On 12/25/2011 02:01 AM, David Paleino wrote:
 On Tue, 13 Dec 2011 14:19:25 +0100, Paul Hartmann wrote:
 
 there's now a JOSM apt repository for Ubuntu. It provides two packages:

 josm
 The tested version
 Replaces the package from the official Ubuntu repository.
 
 Why would one need such a package? Isn't the official josm package good
 enough? What problems does it have?

I'm not aware of any problems.

The repository on josm.openstreetmap.de is only for users who want the
latest josm‑tested.jar, the very next day after it's release. It is an
alternative to the various update scripts.

From time to time we have to react to events in the OSM world (new
imagery, license change, ...). In these cases people rely on the new
features pretty soon. JOSM is developing fast - I would never start a
version that is one year old, except for bisecting a bug. :)

Therefore the Ubuntu distribution model with fixed versions for half a
year isn't really suitable for our project. (May be different on Debian,
where you can install from unstable (?).)

Paul

PS: I borrowed the start script, man page and menu file from the
Debian package, hope that's Ok.

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


Re: [josm-dev] Created a plugin, want to distribute it.

2012-01-08 Thread Paul Hartmann
On 01/08/2012 03:04 PM, Josh Doe wrote:
 On Jan 8, 2012 8:31 AM, Morten Olsen Lysgaard mor...@lysgaard.no wrote:

 Hi guys.
 I've created a plugin that lets you create geometry based on lat lon
 coordinates.
 It's like a beefed up version of the Add Node tool.
 It takes a list of coordinates in text form, and then created a set of
 nodes, a way or a closed way depending on what you want.
 Right now it can only add new geometry, but i plan to let it change
 existing geometry by letting you select a feature first and then
 using the tool.

 The reason i made this is that I need it for my aviation project where
 airspaces often are defined by coordinates.
 I figured the tool also could be good for OpenStreetMap, there probably
 are things other than airspaces that are defined by
 coordinates.

 I'd like to have this plugin in the JOSM SVN. What is required of me/it
 to get that?
 
 I think this would fit in with utilsplugin2. Make a patch and attach it to
 a ticket.
 Josh

+1. If you plan further development, you might want to get an osm
svn-account. See [1] and [2] for details.

[1] http://wiki.openstreetmap.org/wiki/SVN
[2] http://josm.openstreetmap.de/wiki/DevelopersGuide/SVN_Account

Paul

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


Re: [josm-dev] License Change Plugin slows down drawing

2012-01-11 Thread Paul Hartmann
On 01/10/2012 11:23 PM, Frederik Ramm wrote:
 Hi,
 
whenver a license change layer is active and you have lots of objects
 loaded, JOSM becomes noticeably slower.
 
 I could use a little help here. Since many of you have tweaked JOSM's
 drawing performance in the past, maybe you only need to take a quick
 look at this drawing code
 
 http://trac.openstreetmap.org/browser/applications/editors/josm/plugins/licensechange/src/org/openstreetmap/josm/plugins/licensechange/LicenseProblem.java
 
 
 and you have an idea how it could be improved?

You can use QuadBuckets for the 'highlighted' collection. This helps a
lot if the user zooms in and has only few primitives in the current
viewport.

(In this case, you probably need to replace QuadBucketsT extends
OsmPrimitive by QuadBucketsT extends HasBbox and add a new
interface HasBbox.)

 The sliding window of four consecutive nodes in the visit function is
 there to determine whether linecaps need to be drawn or not.
 
 Is it the trigonometry in drawSegment? (This is more or less copied from
 similar code in the validation layer.) 

You can draw a parallel line of fixed distance without trigonometry (see
the code in MapPainter [1]), but I'm not sure this will make a big
difference. Usually, most time is not spend in JOSM code, but in the
Java libs that actually do the painting.

 Would it perhaps make sense to
 cache the buffered outline instead of computing it each time?

Shouldn't be necessary, as far as I can tell.

[1]
http://josm.openstreetmap.de/browser/josm/trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/MapPainter.java#L271

Paul

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


Re: [josm-dev] Bug or Intentional

2012-01-24 Thread Paul Hartmann
On 01/24/2012 11:49 AM, Kate Chapman wrote:
 Yeah, I don't think I changed it.  I was leading a workshop teaching 8
 other people (this is our 4th trip working with them) and all of us
 lost the setting when we upgraded.

This is a known problem and was fixed in version 4658.

Paul


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


Re: [josm-dev] Does presets automatically update?

2012-02-04 Thread Paul Hartmann
On 02/04/2012 10:41 AM, Morten Olsen lysgaard wrote:
 I've got a preset.
 Yesterday I updated it and uploaded it to my server.
 I took it from version 0.0.1 to 0.0.2
 On the JOSM projects preset page the new version number was shown
 minutes later, indicating that the JOSM page had read my changes.
 
 Still, to get JOSM to download the new preset, I had to delete the
 ~/.josm folder because it had old copies of my preset.
 
 Should JOSM automatically see new versions of a preset and download
 them? If not, how does one best update a preset that many people use.
 Does each user have to manually do something?

Presets and styles are cached for 7 days. After this time, everyone
should be using your new version.

Currently there is no way to push an update earlier, do you think this
is necessary?

Btw., we have a cache folder now (~/.josm/cache). To get rid of old or
potentially broken cache, it suffices to delete this folder.

@team: We cannot update imagery entries at the moment. For example, the
new menu icons aren't loaded for existing installations. Probably there
will be more serious issues in the future.
The most obvious fix would be, to add a permanent id for each entry.

On a related note, the shape entries make the Maps page hard to read
and edit. Should we move this data to an extra file? An additional
advantage would be, that one shape could be referenced by multiple entries.

Paul

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


Re: [josm-dev] Creating a user-friendly changelog for tested release

2012-02-09 Thread Paul Hartmann
On 02/07/2012 02:23 PM, Simon Legner wrote:
 Hi,
 
 On 30/01/12 15:07, Josh Doe wrote:
 I would suggest that we create a single set of changes between each
 tested release, separating the changes by major/minor enhancements,
 and major bugs (leaving minor bugs to be found via tickets). I believe
 this would be more helpful for users rather than seeing a long list of
 major changes (but missing some minor ones), without any visual
 demarcation telling them what has changed from the version they're
 using to the last tested.
 
 I like this idea as it provides more insight to JOSM development for
 casual users.  Furthermore, I always like to read a list of new features
 of any product.
 
 For this reason, I've created a wiki page:
 http://josm.openstreetmap.de/wiki/Changelog  For the most recent stable
 release, I went through the commit messages and put together a list of
 (in my opinion) interesting changes.  Note that the classification is
 subjective, and feel free to add/remove/move any item.

For the startup notes, I try to mention only those changes, that could
be interesting for the normal user and provide at least a little
documentation.

Your new changelog seems to be more from the developer's point of view,
which is also interesting. It's a good idea to make a paragraph for each
tested version, I could imagine this for the the startup notes as well.

Do you think we can merge both lists, at least internally? We'd have one
wiki page ChangelogSource and each entry is marked either for changelog
or for startup note or for both. This would remove redundancy and make
live easier for the translators.

Paul

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


Re: [josm-dev] Shortcuts

2012-02-16 Thread Paul Hartmann
On 02/15/2012 10:38 PM, Pieren wrote:
 On Wed, Feb 15, 2012 at 6:12 PM, Dirk Stöcker
 openstreet...@dstoecker.de wrote:
 
 If the default would be to keep everything as is, we copy all these troubles
 a long time into the future. So we have one break now and later on wikis and
 forums on docs refer to one setup and not to a user specific setup.
 
 Fixing current conflicts is one point.
 Saying at any time in the future, the josm core can take over
 existing plugins shortcuts because we find it so cute and plugins will
 have to accept it (1) is another one. This is a kind of arrongance
 and disrespect of JOSM plugins users and devs.

There are 277 shortcuts registered in 84 plugins and core. You can
consider it arrogant, but it is simply necessary in order to keep the
key mappings in JOSM core somewhat sane and consistent.

Core shortcuts aren't save either: B for Distibute nodes got changed
to Shift B, see #7184 for details. Sometimes the decision can be
controversial, but I think it is right in this case.

As plugin developer, you can basically do what you like, also claim a
shortcut like I for Utilsplugin2/IntersectedWaysAction. But you
shouldn't be surprised if we need I for JOSM core someday.

Paul

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


Re: [josm-dev] Shortcuts

2012-02-17 Thread Paul Hartmann
On 02/16/2012 07:58 PM, Pieren wrote:
 On Thu, Feb 16, 2012 at 6:41 PM, Paul Hartmann phaau...@googlemail.com 
 wrote:

 As plugin developer, you can basically do what you like, also claim a
 shortcut like I for Utilsplugin2/IntersectedWaysAction. But you
 shouldn't be surprised if we need I for JOSM core someday.

 
 If you read my OP, I'm not asking very much and could satisfy everybody:
 - keep one Function key and two or three main keys for plugins.

Not sure I understand your suggestion correctly. If you can claim 3
shortcuts for each plugin, we pretty soon end up with 100 shortcuts
fixed for eternity in plugin space. This isn't acceptable.

If we reserve a small pool, this won't be enough, so who decides which
plugin is more important?

 - let plugins ask the user if he wants to keep the current shortcuts
 or use the old ones in case of conflicts.

Depends on the implementation, but this could work. It should only ask
when shortcuts are affected that actually have been used at least once.
Still, someone has to code it.

Paul

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


Re: [josm-dev] Shortcuts

2012-02-17 Thread Paul Hartmann
On 02/17/2012 02:49 PM, Martin Koppenhoefer wrote:
 2012/2/15 Dirk Stöcker openstreet...@dstoecker.de:
 On Wed, 15 Feb 2012, Martin Koppenhoefer wrote:
 this rant, then from someone beeing not even a code contributor, but I
 really suffered hard from the recent change of shortcut w (before
 buildings plugin, I use this VERY often, now refine way, which I
 never use).


 You can change that as you know.
 
 
 yes, I know this, but it never worked well for me. As soon as you
 start to make your own shortcuts (or by the time a core function or
 plugin (different to the function you assigned the shortcut to)
 decides to use this shortcut as well) you will get chain reactions of
 silent-shortcut conflicts, and even the main shortcuts like a and
 s were then redefined for this reason (because I had used a
 userdefined shortcut that otherwise a plugin or core function would
 have used, so that function used a or s then, and selection went
 to ctrl+shift+s (or similar, its only an example, and I don't recall
 right the circumstances, but I am sure it really was a and s
 remapped)). The only way for me to live in peace was to go back to
 default shortcuts.
 
 I think it would be a nice idea to have some shortcuts flagged as
 most important and not be in the pool of easily changeable shortcuts
 (they would be changeable only on user confirmation). This would be at
 least (list is probably not complete): ctrl+z, a, s, d, c, p, m, j, x,
 w, o, g

I agree, this is a bug. There can a long chain of remappings in case of
a single conflict. One solution is to avoid conflicts altogether, but
this is impossible: The user can change a shortcut and install a plugin
afterwards that uses the supposedly free key.

One problem is, that Ctrl+Shift+s becomes s in conflict resolution,
because the s shortcut is registered after the Plugin and Main menu
shortcuts so it seems to be still free.

Possible solutions:
* Always replace shortcut by a combination with more or the same
modifiers (Ctrl+Alt+Shift+s or Ctrl+Shift+? with any letter ?).
* Keep a list of shortcuts from the last sessions in a file. For
conflict resolution, avoid combinations that seem to be already in use.

Paul

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


Re: [josm-dev] WikiStart

2012-04-03 Thread Paul Hartmann
The new design for the main page is good, I would simplify the list of
download options even more:

 
 * OS independent
 * Windows installer
 * Mac OS Package
(and maybe the webstart option, but I'm not sure it needs to be
recommended that much)
- other [[Download]] options
 

Then move all other options to the separate Download page. There is no
need to link to the latest development version from the main page. On
the separate page, there is more room for explanation.

Here is HTML/table layout I did earlier, but never finished, maybe you
find it useful:

{{{
#!table style=border:none;
 {{{#!tr 
  {{{#!td align=left  valign=top style=background:#eee; font-size:
120%; padding: 0px 15px 15px 13px; border: 2px ridge #aaa
[[Image(source:trunk/images/download.png, valign=middle, link=)]]
Download [/josm-tested.jar josm-tested.jar] (version
[[Version(tested)]])[[br]]
{{{#!span style=font-size: 83%
recommended version, all platforms ([wiki:InstallNotes#Running how to run])
}}}
  }}}
 }}}
 {{{#!tr 
  {{{#!td style=border: none;height:10px
  }}}
 }}}
 {{{#!tr 
  {{{#!td align=left  valign=top style=background:#eee; font-size:
120%; padding: 0px 15px 0px 13px; border: 2px ridge #aaa
[/download/windows/josm-setup.exe Windows installer] (version
[[Version(tested)]])
  }}}
 }}}
 {{{#!tr 
  {{{#!td style=border: none;height:10px
  }}}
 }}}
 {{{#!tr 
  {{{#!td align=left  valign=top style=background:#eee; font-size:
120%; padding: 0px 15px 0px 13px; border: 2px ridge #aaa
[/download/macosx/josm-macosx.zip Mac OS X package] (version
[[Version(tested)]])
  }}}
 }}}
}}}

Paul

2012/4/3, Dirk Stöcker openstreet...@dstoecker.de:
 On Tue, 3 Apr 2012, Simon Legner wrote:

 I tried to simplify and re-organize the Wiki main page.

 Due to the spam filter, I cannot create a new temporary Wiki page (e.g.,
 WikiStartNew) to view, improve, discuss the new page. For this reason, I
 attached the WikiText. Perhaps someone with a higher level of confidence
 of not introducing spam, can create a Wiki page.

 Any improvements, suggestions, comments are welcome :-)

 Cut down larger changes into some smaller ones and the spam filter wont
 stop you.

 I increased the positive points a bit, so it may now also work without
 splits. That a wiki admin is filtered by spam filter is a bug in spam
 filter I think. I will have to look at it.

 Ciao
 --
 http://www.dstoecker.eu/ (PGP key available)


 ___
 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


Re: [josm-dev] WikiStart

2012-04-04 Thread Paul Hartmann
On 04/03/2012 04:34 PM, Simon Legner wrote:
 Hi!
 
 On 03/04/12 16:25, Paul Hartmann wrote:
 (and maybe the webstart option, but I'm not sure it needs to be
 recommended that much)
 
 I think it should. On the FOSSGIS I met a few people using a very
 outdated version of JOSM (half to one year old) because they didn't care
 about updating. This comes for free when using Web Start. Are there
 disadvantages?

The problems I remembered with Java Web Start seem to be outdated. In
fact the cache/update mechanism is quite nice. The only disadvantage I
can see at the moment is missing console output and worse desktop
integration.

When we have Autoupdate options for the Windows installer, this should
significantly reduce the outdated versions in use.

 There is no
 need to link to the latest development version from the main page.
 
 Are there any usage statistics tested vs. latest? When sticking to the
 table, I'd keep the row for the latest version as it shows the current
 revision number and may be useful for some people.

I'm not insisting on this. But if someone isn't interested in all the
options and just wants to use the software, the layout should be clear
and simple.

* - Webstart
Win - Win installer
Mac - Mac installer
(Ubuntu - Ubuntu package)
Other - jar file

In the current draft (v. 5) I'm missing the link to the advanced
Download options. This line could contain the latest version. E.g.

Current development version (5161), Ubuntu package repository and other
Download download options.

Paul

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


Re: [josm-dev] WikiStart

2012-04-06 Thread Paul Hartmann
On 04/05/2012 12:48 PM, Simon Legner wrote:
 Hi all,
 
 I think the current version of the new(?) WikiStart page [1] offers a
 concise introduction to the JOSM website. Thanks to all contributors. :-)
 
 Do you think it's ready to replace the current WikiStart page?

Yes, it's much better than the current page...

Paul

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


Re: [josm-dev] WikiStart

2012-04-07 Thread Paul Hartmann
On 04/07/2012 12:07 AM, Simon Legner wrote:
 On 07/04/12 00:02, Paul Hartmann wrote:
 Do you think it's ready to replace the current WikiStart page?
 Yes, it's much better than the current page...
 
 Is there a Trac Wiki copy mechanism (to keep the history), or has one to
 use copypaste?

I'd prefer to keep the history of the old WikiStart over the new (short)
history. I doubt there is a way to merge both histories, so copypaste
it is.

Paul

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


Re: [josm-dev] WikiStart

2012-04-08 Thread Paul Hartmann
2012/4/8, Simon Legner simon.leg...@gmail.com:
 On 05/04/12 13:27, Holger Jeromin wrote:
 I would like to have a webstart for the latest josm. I build it for my
 own (edited the jnlp), but a link in the table of
 http://josm.openstreetmap.de/wiki/Download
 would be very nice.

 I would like to have a JOSM latest web start, too. This would allow
 people to get rid of some JOSM update scripts.

 Dirk, Paul, what do you think?

OK, why not.

Paul

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


Re: [josm-dev] Why 5174 ?

2012-04-12 Thread Paul Hartmann
2012/4/12, Vincent Privat vincent.pri...@gmail.com:
 Hi,

 I'm a bit surprised in the choice of publishing 5174 as the tested version.
 Is there something wrong with 5177 ? As far as I see it does only contain
 bugfixes.

OK, updated to 5177.

 Shouldn't we update translations by the way ? They haven't be updated since
 5047.

Yes, we should. But Dirk seems to be busy and I've lost track of how
i18n update works, but will look into it. Also, before we can upload
translation templates to launchpad again, this file [1] needs to be
adapted to Simon's preset enhancements.

You are welcome to help, and do i18n updates as you see fit or take
over i18n maintenance completely. :)

[1] 
https://trac.openstreetmap.org/browser/applications/editors/josm/i18n/convpreset.pl?rev=28248

Paul

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


Re: [josm-dev] Style: Icon depending on way tag?

2012-04-18 Thread Paul Hartmann
On 04/18/2012 03:14 PM, Frederik Ramm wrote:
 Hi,
 
there was a little edit war recently where one mapper put maxheight
 on a river node under a bridge, and another mapper removed that again on
 the grounds that JOSM used a road traffic sign icon to display it (which
 made no sense on water).
 
 Is it possible to say use this icon for maxheight, but only when the
 way on which the node sits is tagged highway=*?

You can do this with the MapCSS child selector [1], e.g.

way[highway]  node[maxheight] { ... }

The JOSM default style is still in the xml-Format, however, so there is
no easy way to add this rule at the moment.

[1]
http://josm.openstreetmap.de/wiki/Help/Styles/MapCSSImplementation#Childselector

Paul

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


[josm-dev] next tested version - skip stabilization?

2012-04-30 Thread Paul Hartmann
Hi,

most of the commits in the last weeks have been bug fixing, so I'd
suggest we skip the stabilization period and release tomorrow's version
as next tested.

The only recent change that could break something is [5206], but I hope
it's Ok. :)

Paul

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


Re: [josm-dev] Selecting a line nearest a point

2012-05-28 Thread Paul Hartmann
2012/5/28 Josh Doe j...@joshdoe.com:
 I have a plugin (conflation) with a custom layer which draws arrows
 between matched pairs of objects, and I'd like to enable these to be
 clicked to select the match so it can be merged or deleted. I'm not
 familiar with JOSM's map display code, so I'm not sure where to look.
 I need to find the line closest to a point, or more simply the first
 line which is within N-pixels of the clicked point. It would be nice
 if it could be performant as well, by only checking lines which are
 shown on the screen (spatial index?).

NavigatableComponent.getNearestWaySegment does the job for normal
mouse selection.

Paul

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


[josm-dev] New tested version after API change fix?

2012-07-12 Thread Paul Hartmann
Hi,

In the process of the license switch, there has been a small change of
the OSM API [1]. This causes JOSM to crash in certain situations
[2][3]. A fix has been committed (v. 5326), so as a user you might
want to update JOSM or at least save often, especially before upload
and data update.

@team: Do you think we should release an emergency tested version?
The fix [5326] might cause a couple of bugs at other places, so in any
case no need to rush things.

[1] http://lists.openstreetmap.org/pipermail/dev/2012-July/025209.html
[2] http://lists.openstreetmap.org/pipermail/rebuild/2012-July/000317.html
[3] http://josm.openstreetmap.de/ticket/7847

Paul

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



Re: [josm-dev] Validator

2012-07-12 Thread Paul Hartmann
2012/7/11 Frederik Ramm frede...@remote.org:
 Do you think it would be possible to run the validator after data has been
 downloaded and record the list of problems, and then when someone uploads,
 only check for *newly added* problems instead of everything?

 Of course the validator would still, on request, be able to check
 everything, but the automatic hey, are you sure you want to upload this
 check could be reduced to those problems this mapper is really responsible
 for, rather than listing everything that was wrong even before this mapper
 touched it.

If the user can highlight the validation errors that are directly
caused by the local modifications, this is certainly an improvement.

But I'm not so sure about the technical implementation. It doesn't
seem natural to me to validate the entire dataset on download and keep
the errors till some of theses objects are (maybe) uploaded. What if
the edits are saved to a .osm file and reloaded later?

I'd suggest an alternative: Remember the original version of each
primitive; on upload run 2 passes for the validator: one for the
(reconstructed) original dataset and one for the modified one.

This solution isn't necessarily easier to implement, but it solves
other problems as well: Currently, if you add a tag to a large number
of objects, and later remove that tag, JOSM still keeps the modified
flag for these objects, so they get uploaded and get a version bump,
although the properties remain unchanged. In addition it would be
useful to display the changes made to an object before upload (e.g.
for a large relation; much like svn status). The history GUI could
be reused for this.

This still requires an extension of the data file format used in JOSM,
but I think it's inevitable. There are a couple of other things that
need to be saved to file, e.g. object histories and edit conflicts.
The plain .osm format can be offered as export option instead.

Paul

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


Re: [josm-dev] New tested version after API change fix?

2012-07-13 Thread Paul Hartmann
2012/7/13 Dirk Stöcker openstreet...@dstoecker.de:
 On Fri, 13 Jul 2012, Vincent Privat wrote:

 I think we should enter in stabilization phase ASAP.
 I should have some time this week-end to run extensive tests, so a stable
 version released next week sounds a good idea to me.


 Volunteers are always accepted. Feel free to modify the wiki schedule pages
 and do the release. If you have questions, ask Paul or me by mail :-)

 As we had only few changes I would suggest a short stabilization phase when
 no problems appear in tests.

+1, if you do extensive testing, you can as well take over the release
completely. After all, the main work is to ensure that the software is
stable enough for general use.

Paul

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


Re: [josm-dev] OsmChange

2012-07-14 Thread Paul Hartmann
2012/7/14 Martin Guttesen mgutte...@hotmail.com:
 JOSM should auto internaly mark all nodes inside a modify as dirty

Yes, it should. This is most likely a bug; you can report it at
http://josm.openstreetmap.de/newticket

 the excamples on http://wiki.openstreetmap.org/wiki/OsmChange  have 
 version=”0.3” josm only accepts 0.6
 is there a newer version of the specifications someware ?

I'd say osmChange version 0.6 is pretty much what the API 0.6 accepts
as input for an upload. Apparently this hasn't changed much since
2007.

Paul

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


Re: [josm-dev] JMapViewerTiles location?

2012-08-24 Thread Paul Hartmann

On 08/24/2012 01:48 PM, hbogner wrote:

Is there a way to change the place where tiles are cached from
/tmp/JMapViewerTiles_user/ to folder of own choosing?


Yes, edit the property imagery.tms.tilecache_path in the advanced 
preferences. (F12, make sure expert mode is enabled at bottom left, then 
select last tab)


Paul

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


Re: [josm-dev] JMapViewerTiles location?

2012-08-24 Thread Paul Hartmann

On 08/24/2012 02:15 PM, hbogner wrote:

Yes, edit the property imagery.tms.tilecache_path in the advanced
preferences. (F12, make sure expert mode is enabled at bottom left, then
select last tab)


Couldnt fint that string.


A property is only displayed, if JOSM has retrieved it in the current 
session (or it has been changed before). So basically you have to open a 
TMS layer first, then open the preferences.


You can also add the property manually, of course.


Should also work changing the path under:
Preferences - Imagery preferences - Settings (2nd Tab) - last line
(TMS-Settings)


Ok, this is much easier.

Paul


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


Re: [josm-dev] JMapViewerTiles folder in my Temp folder

2012-08-28 Thread Paul Hartmann

On 08/27/2012 03:04 PM, Bob Hawkins wrote:

I use Microsoft Windows on my PC. I discovered a folder this morning
in my Local SettingsTemp folder titled JMapViewerTiles_Bob in which
there were a further six folders: Bing Aerial Maps, ITO OSL, Mapnik,
OOC OS 1_25K, OpenStreetMap and OS OpenData StreetView. They
contained 25,000 files in total, over half of which were in Bing
Aerial Maps. Some files date from late 2010, the others from late
2011. I joined OSM in May 2008 and have contributed edits to its
mapping since August 2008 using JOSM. I suspect the files relate to
WMS and Imagery Preferences in JOSM but do not understand if it is I
or an introduction into JOSM itself that has caused them to be
created since those dates. Is there no alternative now but to
regularly remove the files from the Temp folder?


The situation is not ideal, especially on Windows.

We need to
 * move TMS cache to %APPDATA%/JOSM/cache/tms
 * distribute over multiple folders
 * introduce maximum age, when cached images are deleted (user 
configurable)


WMS cache has some of these features, so we should try to adapt that code.

Paul

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


Re: [josm-dev] JMapViewerTiles folder in my Temp folder

2012-08-28 Thread Paul Hartmann

On 08/28/2012 11:37 AM, Vincent Privat wrote:

Should we also introduce a maximum cache size ? Or consider the maximum age
is enough ?


Sure, as long as it is configurable in the preferences. The default 
value shouldn't be too low in my opinion.


Paul

PS: Good luck with i18n update. If you could extend/clarify the readme 
after the ordeal, I would be thankful.



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


Re: [josm-dev] MapMode - MouseWheelListener and KeyListener?

2012-09-19 Thread Paul Hartmann

On 09/19/2012 03:55 PM, Russell Edwards wrote:

Hello,

Apologies for asking a beginner's question.

I am writing a plugin which has its own MapMode. I need to catch mouse
wheel and key press events. How can I do this?

I have tried

... extends MapMode implements MouseWheelListener, KeyListener

... enterMode() {
...
 Main.map.mapView.addMouseWheelListener(this);
 Main.map.mapView.addKeyListener(this);
  ...
}

but the listeners never seem to get called. Moreover the map still zooms
in and out when the wheel is moved.

Thanks in advance for your help and patience,


I put your code in SelectAction and MouseWheelListener worked directly.
Not sure if you can easily suppress zoom, though. What is your mapmode 
about?


Other plugins have a similar similar setup, e.g. alignways has a mapmode 
with MouseListener. In order to catch keystrokes, you should try 
AWTEventListener.


Paul




Index: src/org/openstreetmap/josm/actions/mapmode/SelectAction.java
===
--- src/org/openstreetmap/josm/actions/mapmode/SelectAction.java	(revision 5513)
+++ src/org/openstreetmap/josm/actions/mapmode/SelectAction.java	(working copy)
@@ -14,6 +14,8 @@
 import java.awt.event.InputEvent;
 import java.awt.event.KeyEvent;
 import java.awt.event.MouseEvent;
+import java.awt.event.MouseWheelEvent;
+import java.awt.event.MouseWheelListener;
 import java.awt.geom.Point2D;
 import java.util.Collection;
 import java.util.Collections;
@@ -63,7 +65,12 @@
  *
  * @author imi
  */
-public class SelectAction extends MapMode implements AWTEventListener, SelectionEnded {
+public class SelectAction extends MapMode implements AWTEventListener, SelectionEnded, MouseWheelListener {
+
+@Override
+public void mouseWheelMoved(MouseWheelEvent e) {
+System.err.println(mouse wheel!);
+}
 // select means the selection rectangle and move means either dragging
 // or select if no mouse movement occurs (i.e. just clicking)
 enum Mode { move, rotate, scale, select }
@@ -178,11 +185,14 @@
 super.enterMode();
 mv.addMouseListener(this);
 mv.addMouseMotionListener(this);
+mv.addMouseWheelListener(this);
 mv.setVirtualNodesEnabled(Main.pref.getInteger(mappaint.node.virtual-size, 8) != 0);
 drawTargetHighlight = Main.pref.getBoolean(draw.target-highlight, true);
 cycleManager.init();
 virtualManager.init();
 // This is required to update the cursors when ctrl/shift/alt is pressed
+
+// Keyevents:
 try {
 Toolkit.getDefaultToolkit().addAWTEventListener(this, AWTEvent.KEY_EVENT_MASK);
 } catch (SecurityException ex) {}
@@ -207,6 +217,7 @@
  * This is called whenever the keyboard modifier status changes
  */
 public void eventDispatched(AWTEvent e) {
+System.err.println(AWT: +e);
 if(oldEvent == null)
 return;
 // We don't have a mouse event, so we pass the old mouse event but the
___
josm-dev mailing list
josm-dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/josm-dev


Re: [josm-dev] MapMode - MouseWheelListener and KeyListener?

2012-09-20 Thread Paul Hartmann

On 09/20/2012 08:25 AM, Russell Edwards wrote:

On 20/09/12 04:41, Paul Hartmann wrote:


I put your code in SelectAction and MouseWheelListener worked directly.
Not sure if you can easily suppress zoom, though. What is your mapmode
about?

Other plugins have a similar similar setup, e.g. alignways has a
mapmode with MouseListener. In order to catch keystrokes, you should
try AWTEventListener.


Thanks very much -- all working now.

I have also successfully temporarily disabled map zooming  using
Main.map.mapView.getMouseWheelListeners() and looping
Main.map.mapView.removeMouseWheelListener(). I do this when my mode gets
a mousePressed, and then reinstate them all with
Main.map.mapView.addMouseWheelListener() when I get mouseReleased.

Is this allowed? It's a bit sneaky as the listeners are added by
mapView's private member MapMover. Maybe mapView should have public
lockMap() and unlockMap() methods?


Take care that the listeners are added back, when the user switches to a 
default mapmode, otherwise do what you like, it's your project! ;)

You are welcome to send core patches if needed for a plugin.

Paul


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


Re: [josm-dev] JOSM Plugin no_more_mapping

2012-10-20 Thread Paul Hartmann

On 10/19/2012 10:36 PM, Frederik Ramm wrote:

Hi,

Someone noticed that there is a plugin called no more mapping which
claims to stop JOSM from working forever.

The plugin has been added to SVN by user zverik and it seems to be a
relatively harmless prank. I don't know the motivation but if the
motivation was to demonstrate that even bad plugins can easily be
offered by JOSM to the unsuspecting user then it succeeded ;)

I will remove it from SVN now. Zverik, are you reading this? Can you
explain why you did that?


I think there is no harmful intent, but the target audience is power 
mappers that are suffering from OSM addiction. In this case the plugin 
is supposed to help you concentrate on things other than mapping.


Sometimes users install a bunch of plugins (all of them in extreme 
cases) without reading the plugin description. If you unintentionally 
install this plugin, it will be very irritating, so I agree we shouldn't 
keep it in the main plugin repository.


Paul

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


Re: [josm-dev] JOSM Plugin no_more_mapping

2012-10-20 Thread Paul Hartmann

On 10/20/2012 03:35 PM, Ilya Zverev wrote:

Hi. Paul got it right, I've made this plugin just because there has to
be an option. It even counted days without mapping. My record is a week.

As for installing without reading, I've made all the precautions
possible. There was a big warning in plugin list, standing-out red icon
and extensive instructions on how to disable it after it's been
installed. I'd put more warnings if there was a way.


If all these warnings are necessary, this is a good indication, the 
plugin isn't suitable for the main repository. I'm afraid, many users 
won't get the humorous part and will just be irritated.



I guess the user that was offended didn't even try to install it. And
based on his words it got removed along with the source code.


The source code is still available in the svn history:
https://trac.openstreetmap.org/browser/subversion/applications/editors/josm/plugins/no_more_mapping?rev=28821


Oh well.
Have fun knowing that any of your plugins could be deleted because
someone didn't like the description.


I don't see that happening to the other plugins you wrote - they are 
actually useful. ;)


Paul


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


Re: [josm-dev] Ubuntu package Depends

2012-10-20 Thread Paul Hartmann

On 10/20/2012 10:07 PM, Stefan wrote:

Hello,

as far I see has the josm Package from the Ubuntu repository at
http://josm.openstreetmap.de/apt has a Depends on java 6, but it uses a
java 7 if installed. As far this is the only program I had installed
that depends on java 6, I could not uninstall java 6.

The Depends line:
Depends: openjdk-6-jre | sun-java6-jre

$ josm
Using /usr/lib/jvm/java-7-openjdk-amd64/bin/java to execute josm.

Is java 7 Missing in the Depends line? The Depends line of the Debian
Maintained contains openjdk-7-jre.

http://anonscm.debian.org/gitweb/?p=pkg-osm/josm.git;a=blob;f=debian/control


Thanks, should be fixed now.

Paul


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


Re: [josm-dev] Find bus stops along a way

2012-11-08 Thread Paul Hartmann

On 11/08/2012 08:51 AM, Maarten Deen wrote:

On 2012-11-08 08:14, Jo wrote:

Hi,

I want to find all bus stops along a side of the road. So I'm looking for
functions in JOSM to:

Define a rectangle a few meters to one side of the (section of a) road.
Get all nodes within this rectangle as a list.

or:

Define a polygon with the way as one of its sides and a parallel way x
meters away as another side.
Get all nodes within this polygon as a list.

I've been browsing through the source code, but I can't seem to find
suitable functions to accomplish this.


There is a plugin: download_along. It is rather crude, but effective.
You can download objects within 5000, 500 and 50 meters of one or more
selected objects, with a maximum area of 20, 10, 5 or 1 km^2 per request.
JOSM (the api) can only download rectangular areas (bbox) so it will
divide the area you request into these smaller areas to download.
Obviously you would want the lowest settings for your use. It will
download in multiple sets, but because it's all automated you can get
coffee while it's working.

There are suggestions for API v0.7 to extend downloading to arbitrary
areas, but these seem to be centered on downloading objects that are
within an already existing structure, not arbitrary polygons. Not sure
it that would be difficult to program, but I'm adding it to the list at
http://wiki.openstreetmap.org/wiki/API_v0.7


With Roland's Overpass API you can download Polygon areas [1], so it 
would be interesting, to combine those features:

  * Add API for polygon download to mirrored_download plugin.
  * In download_along plugin, check if mirrored_download is present and 
offer mirror option.

I would expect considerable speed-up for the download.

[1] http://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_QL#By_Polygon

Paul

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


Re: [josm-dev] Missing keys/tags on JOSM

2012-11-08 Thread Paul Hartmann

On 11/08/2012 05:03 AM, Nelson A. de Oliveira wrote:

Hi!

While validating some places I usually see JOSM saying that presets
do not contain property value when I am sure that the values are
valid.

For example:

key 'abandoned' not in presets
(http://wiki.openstreetmap.org/wiki/Key:abandoned)
key 'nat_ref' not in presets (http://wiki.openstreetmap.org/wiki/Key:ref)
key 'playground' not in presets (http://wiki.openstreetmap.org/wiki/Playground)
key 'reg_name' not in presets (http://wiki.openstreetmap.org/wiki/Key:name)
value 'assemblies_of_god' for key 'denomination'
(http://wiki.openstreetmap.org/wiki/Denomination)
value 'clinic' for key 'amenity'
(http://wiki.openstreetmap.org/wiki/Tag:amenity%3Dclinic)
value 'evergreen' for key 'wood' (http://wiki.openstreetmap.org/wiki/Key:wood)
value 'gas' for key 'shop' (http://wiki.openstreetmap.org/wiki/Tag:shop%3Dgas)
value 'git' for key 'shop' (http://wiki.openstreetmap.org/wiki/Shop)
value 'ice_cream' for key 'amenity'
(http://wiki.openstreetmap.org/wiki/Tag:amenity%3Dice_cream)
value 'love_hotel' for key 'amenity'
(http://wiki.openstreetmap.org/wiki/Tag:amenity%3Dlove_hotel)
value 'mtb' for key 'route' (it's there in
http://wiki.openstreetmap.org/wiki/Key:route)
value 'raceway' for key 'highway'
(http://wiki.openstreetmap.org/wiki/Tag:highway%3Draceway)
value 'retirement_home' for key 'amenity'
(http://wiki.openstreetmap.org/wiki/Tag:amenity%3Dretirement_home)
value 'social_facility' for key 'amenity'
(http://wiki.openstreetmap.org/wiki/Tag:amenity%3Dsocial_facility)
values 'pasta' and 'mediterranean' for key 'cuisine'
(http://wiki.openstreetmap.org/wiki/Cuisine)

Well, you can get an idea I think :-)

Is there a better way to find these keys/tags/values that are being
used and valid but that are not included in JOSM?


Good question, maybe we can use Taginfo stats...


Is it known that some of these values are indeed missing?
Are there plans to update JOSM with them?


There are no long-term plans that I'm aware of. Tagging and Mapstyle 
related tasks sometimes get neglected, if no one from the team is 
interested in this topic. So we rely on input from users like you. :)


It is quite easy to add exceptions for this validation test, they are 
listed in this file:


http://josm.openstreetmap.de/browser/josm/trunk/data/ignoretags.cfg

You can add your entries and send us the extended version (or a patch if 
you like).


(Note that tags that are used somewhere in the presets will be found 
automatically and need not be added to the whitelist.)


Paul

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


Re: [josm-dev] Missing keys/tags on JOSM

2012-11-08 Thread Paul Hartmann

On 11/08/2012 08:36 PM, Nelson A. de Oliveira wrote:

Hi!

On Thu, Nov 8, 2012 at 5:10 PM, Paul Hartmann phaau...@googlemail.com wrote:

There are no long-term plans that I'm aware of. Tagging and Mapstyle related
tasks sometimes get neglected, if no one from the team is interested in this
topic. So we rely on input from users like you. :)

It is quite easy to add exceptions for this validation test, they are
listed in this file:

http://josm.openstreetmap.de/browser/josm/trunk/data/ignoretags.cfg


Or should they be included in some presets?
For example, in the restaurant preset it seems to be missing some cuisine types.

If I update some of the presets, will it be accepted? (or do you
prefer to have more exceptions in ignoretags.cfg?)


Yes, it is better to include the tags in the presets, if possible. The 
ignoretags.cfg file is more a list of all the remaining tags that don't 
fit into the presets.


I cannot promise anything in advance, basically if we like the changes, 
it will be accepted. :)
Including a tag in the JOSM presets will boost its usage counts, so we 
have to be a little careful. The tag should be either widely used or at 
least straightforward and undisputed. For special interest topics, it is 
better to create a separate preset that can be included by the user as 
an extension (http://josm.openstreetmap.de/wiki/Presets).



And another doubt: still using the restaurant example, we have in
defaultpresets.xml:

multiselect key=cuisine text=Cuisine
values=italian;chinese;pizza;burger;greek;german;indian;regional;kebab;turkish;asian;thai;mexican;japanese;french;sandwich;sushi/

See that the values aren't sorted (and also aren't displayed as a sorted list).
While some values are clearly sorted by importance, usage, value, etc,
some other (like cuisine) could be alphabetically sorted I think. Is
it OK to play with this too?


Good idea!

Paul

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


Re: [josm-dev] Building plugins

2012-11-08 Thread Paul Hartmann

On 11/09/2012 07:32 AM, Paul Norman wrote:

I've been trying to compile the mirrored_download plugin so I can fix bugs
http://josm.openstreetmap.de/ticket/7660 and
http://josm.openstreetmap.de/ticket/7661 as well as add
jxapi.openstreetmap.org to the list.

I checked out the plugin environment as described at
http://josm.openstreetmap.de/wiki/DevelopersGuide/DevelopingPlugins and
installed ant and attempted to do ant dist but I am getting the compile
errors below. Is there a step I'm missing?


Compile JOSM first. (Maybe should be mentioned in the docs.)

Paul


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


Re: [josm-dev] Disabling parts of internal style

2012-11-18 Thread Paul Hartmann

On 11/17/2012 02:22 PM, Jiri Klement wrote:

Hi,

is there a way to do small custom modifications to internal element style?
I know I can copy elemstyles.xml and do my modifications but I would prefer
to have my own little style file that contains only changes I don't like in
elemstyles.xml.

To be specific, I don't like piste:difficulty rendering. It's wide solid
line that hides path/track bellow. I would like to have it completely
disabled.


Not only do pistes spoil the landscape in the summer, but now you cannot 
even get rid of them when editing the map. :)


[5591] should solve the problem. You can hide pistes with the following 
style:


way[piste:difficulty][!is_prop_set(width, under_1)] {
width: 0;
}
way[piste:difficulty]::under_1 { width: 0; }

Paul


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


Re: [josm-dev] Example for pattern-image?

2013-02-06 Thread Paul Hartmann

On 02/06/2013 03:09 PM, Martin Vonwald wrote:

Hi!

I wanted to try pattern-image which is mentioned in [1]. The link
there seems to be dead and I couldnt find any examples for it. Can
someone please provide a simple example on how to use pattern-image?

Thanks,
Martin

[1] 
http://josm.openstreetmap.de/wiki/Help/Styles/MapCSSImplementation#Linestyles


I've fixed the broken link. Here you can find an example:
https://github.com/bastik/mapcss-tools/blob/osm/mapnik2mapcss/osm-results/mapnik.mapcss#L1724

Paul


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


Re: [josm-dev] JOSM Remote Control API and external tools

2013-02-15 Thread Paul Hartmann

On 02/15/2013 05:21 PM, the Old Topo Depot wrote:

At present, tools such as MapRoulette (maproulette.org) rely on users to
add a string to changeset comment to assist tracking editing activities
associated with said tool.

It would be useful and convenient to allow external tools to specify a
changeset string fragment (suffix, for example) as part of the remote
control command sent to JOSM when the editing activity is triggered.  I am
soliciting feedback from the JOSM dev community on this matter, and will
implement agreed upon changes when we arrive at a consensus.

While I am aware that JOSM caches changeset strings, it is also possible
for a use to employ several tools during an extended editing session, say
MapRoulette and OSMI, and users are currently burdened with properly
selecting a comment.

Best and Thanks in Advance for your comments,


Can you give an example, how such an auto-generated changeset comment 
would look like? The users will probable make multiple edits and upload 
them all in one go. As Dirk pointed out, in addition to comment=*, 
created_by=* and source=*, you can add custom tags to the changeset. If 
it's just for bookkeeping, you can include an additional tag like 
maproulette:id=*, this is no problem.


In general I'm not opposed to assisting the user with choosing a good 
comment. If a changest comment has already been selected in a previous 
upload and the changeset is still open, we should probably not overwrite it.


Paul


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


Re: [josm-dev] Fwd: My First Preset - Translation issue

2013-02-16 Thread Paul Hartmann

On 02/16/2013 10:40 AM, Marc Gemis wrote:

Hallo,

I'm working on my first preset targetted to beginning mappers in Belgium.
With the help of a more experienced OSM'er it was put on
https://josm.openstreetmap.de/wiki/Presets/BENELUX yesterday.
So it was available for download this morning.

However when I install the downloaded plugin, it complains that
nl.display_value is not allowed in a list_entry.

I did not had this problem when I installed the preset from file.

When you ignore the error message (twice) and restart JOSM afterwards, it
does not complain and the Dutch translations are available as expected.

What am I doing wrong ?

Marc

BTW, I'm using JOSM 5697 on OSX.


Hi Marc,

this is not your fault, it is a JOSM bug in the preset validation. 
Apparently no one has ever used localized text in a list_entry. I've 
fixed it a moment ago in r5722.


For earlier versions of JOSM, it is save to ignore this message, as you did.

Regarding your preset in the wiki: An .xml and a .zip file has been 
attached, this is normally not required. Can we remove it?


Here is another tip when you want to test your wiki preset: JOSM caches 
the downloaded preset file for one week. In order to force an update, 
you can go to the JOSM settings directory [1] and delete the 
corresponding file in the cache directory. (You can remove the entire 
cache folder if you like.)


[1] 
http://josm.openstreetmap.de/wiki/Help/ResetPreferences#Locatethesettingsfolder


Paul

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


[josm-dev] new server

2013-03-18 Thread Paul Hartmann

Hi all,

you may be wondering why there is a new sponsor logo on the front page 
of the JOSM website and why there has been some downtime lately. Let me 
give you some updates.


In the last few days, we moved to a new server which is kindly sponsored 
by the web hoster Hetzner [1]. The offer stands for one year, but may be 
continued after that time. We've placed an inconspicuous reference at 
the bottom of each wiki page and a more visible logo on the the front 
page. I think it's fair, the regular costs would be 19,90 EUR / month.


While he was at it, Dirk switched the database backend for trac, our 
bug-tracking- and wiki-software (from sqlite to postgresql). So 
hopefully, we will no longer see the notorious database locked 
messages. Please report if you still get this or a similar error.


Big thanks to the FOSSGIS society for the continuous server hosting so 
far. We will still need your support, but hopefully, some resources are 
freed for other projects.


Btw., all the credit goes to Dirk, he found the sponsor and migrated the 
sever and database.


[1] http://www.hetzner.de/en/hosting/produkte_vserver/vq19

Paul

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


Re: [josm-dev] JOSM Server and Database

2013-03-18 Thread Paul Hartmann

On 03/18/2013 12:38 AM, Vincent Privat wrote:

Is this big and ugly new sponsor logo really needed as it ? I find very
disturbing to display such a large commercial logo without any discussion
first ?


I've slightly adapted the size and position:

from  http://josm.openstreetmap.de/wiki/WikiStart?version=191

tohttp://josm.openstreetmap.de/wiki/WikiStart?version=192

I'm sorry, we haven't involved you earlier, see my other mail for some 
background info.


Paul

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


Re: [josm-dev] MapCSS: Substitute characters in a text

2013-04-06 Thread Paul Hartmann

Hi,

this should work:

*[name=~/-/]{
_match: regexp_match((.*?)-(.*), tag(name));
text: concat(get(prop(_match), 1), -#x3E;, get(prop(_match), 2));
}

Paul


On 04/06/2013 12:21 PM, Martin Vonwald wrote:

Hi!

I already tried that before asking on this list. But maybe I didn't use it
correct, so I hoped that someone here could give me a hint.

Martin


2013/4/6 Jo winfi...@gmail.com


Recently support for regular expressions was added to the JOSM
implementation of MapCSS.


http://josm.openstreetmap.de/wiki/Help/Styles/MapCSSImplementation#Evalexpressions

Maybe you can accomplish what you need with

regexp_match(regexp, string, flags)

It will return a list of matching groups, but I'm not sure how you can get
back from a list to a string.

It would be more convenient if the good soul who added the regex support
would also add a regex replace function.

Polyglot


2013/4/6 Martin Vonwald imagic@gmail.com


Hi!

Within a MapCSS style I have to replace some characters in an arbitrary
text by others. Example: Roma - Napoli should be changed to Roma
-#x3E; Napoli.

The text comes from a tag so I don't have any knowledge of its content in
advance, but I have to get rid of some characters. Any ideas how to do
that?

best regards,
Martin
___
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




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


Re: [josm-dev] How to override default styling of name=* within josm

2013-07-28 Thread Paul Hartmann

On 07/27/2013 10:41 PM, william skora wrote:

I'm wondering where are the default style settings stored for josm. Using
all of the map paint styles filter on the right-hand side of the screen,
I've turned off all of my map styling, including josm's internal style.

I ask because I'm trying to style so that name=* tag on a node does not
display below zoom level 15.
I don't have anything in my mapcss file to specify that I want the name to
render at this zoom level.  -
https://github.com/skorasaurus/HDM-JOSM-style/blob/8b635ecdc95d58ff193aa0ece23299bcc18dc38a/HDM.mapcss

Following, the syntax described at
https://josm.openstreetmap.de/wiki/Help/Styles/MapCSSImplementation#ZoomselectorI
thought about styling it as
https://github.com/skorasaurus/HDM-JOSM-style/blob/8b635ecdc95d58ff193aa0ece23299bcc18dc38a/HDM.mapcss#L631

but received the following error in the console:
org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.ParseException:
Encountered  - -  at line 631, column 11.
Was expecting one of:
 S ...
  ...
  ...
 , ...
 /* ...


It is not |z-15- but |z15- or |z-15.


Is there a preferred way to style what I'm intending to do ?


To suppress the label, you could also write something like:

text: eval();

Paul

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


Re: [josm-dev] MapMode, GeoImageLayer, mouseAdapter, Flags, Undo

2013-09-16 Thread Paul Hartmann

On 09/16/2013 10:31 PM, Holger Mappt wrote:

Hi,

I have a proof of concept for my ticket 7712.  Until now I changed the
GeoImageLayer directly to keeps things simple.  Now I want to move the
additional code into a plug-in.  That raises a few questions.

The GeoImageLayer uses a MouseAdapter that is added and removed by a
MapModeChangeListener.  But what exactly is a MapMode?


Select, Draw, Zoom, ... (The buttons on the upper left)


 I can click on a
photo whenever it is displayed.  How is that related to the MapMode?


In certain MapModes (e.g. Draw) the mouse click is deactivated.


I want to be able to move photos of the active GeoImageLayer.  Can I use
a LayerChangeListener to register my MouseMotionAdapter or do I need a
MapModeChangeListener too?


You probably also want to turn this off in Draw mode, so yes.


Right now I do the same what the
GeoImageLayer does, i.e. use the MapModeChangeListener.

What is the best way to add a MouseMotionAdapter to the active
GeoImageLayer from a plug-in?  Do I just implement the right
ChangeListener and use it to add/remove the MouseMotionAdapter?  Or
would I register the MouseMotionAdapter in the GeoImageLayer?  Or
something else?  What plug-in would be a good example?
I want to mark an image as moved to be able to save the new coordinates
afterwards.  What is the recommended way to implement such a flag?  Is
there a type for flags, how do I name the set/get methods?


It seems somewhat cumbersome to implement this as a plugin. Why not 
continue your work as a core enhancement? If it integrates well, we 
could apply the patch directly. I think this would be a nice new feature 
for the JOSM's geotagging support!



The undo/redo seems to work with OSM data only.  Is there a way to have
a separate undo buffer for the GeoImageLayer?  How would it work?


Sorry, no idea.

Paul


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


Re: [josm-dev] josm-latest debian package

2013-10-23 Thread Paul Hartmann

On 10/17/2013 01:12 AM, Paul Johnson wrote:

Needs to allow oracle java 7 as a viable alternative dependency to the
other JDKs.


Please check your update-alternatives configuration and open a ticket on 
the bug tracker if it still does not work.


Paul


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


Re: [josm-dev] JOSM und Ubuntu-Repository

2013-10-23 Thread Paul Hartmann

On 10/19/2013 11:29 AM, Jörg Frings-Fürst wrote:

Hi,

the Ubuntu Repositories for josm have the format URL version.

Isn't it better to make it in the form URL all.

The required Java JRE is specified by the requirements. So should not
cause any problems and is easier to maintain.


It is true that you get the same .deb file for all Ubuntu versions at 
the moment. The separation is just in case we want to distribute a 
binary tool in the future.


Paul

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


Re: [josm-dev] Cardinal Directions Changes

2013-12-19 Thread Paul Hartmann
2013/12/19 Locke, Jonathan jonath...@telenav.com

 Could someone give me a list of classes and/or methods that would need to
 be changed to support this feature?


Could you be more specific? What are the features that you like to
implement? The tag correction when reversing way direction is already
implemented (ReverseWayTagCorrector.java). A starting point for the
relation sorting would be the package org.openstreetmap.josm.gui.dialogs.
relation.sort, however the current sorting algorithm is based on the
topology (how the ways are connected end to end) and relation roles are
ignored (if I recall correctly).

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


Re: [josm-dev] Projection problem with Import Image plugin

2014-01-23 Thread Paul Hartmann

Hi Irene,

please use this website to report and discuss software bugs:
http://josm.openstreetmap.de/newticket

In order to identify the problem, it would help, if you could describe 
the issues in more detail (step by step). Also: do you remember which 
version you used before?


Best, Paul

On 01/23/2014 03:12 PM, irene.pu...@tiscali.it wrote:



Dear all,

I'm using JOSM with a personalized projection and until
now it works properly also with ImportImage plugin.

Now I start to use
the JOSM version 6388 with the latest ImportImage plugin and I found a
lot of problem. Especially, I'm not able to load my georeferenced images
in the right position using my projection.

My projection doesn't have
an authority number (for example Mercator is EPSG:3857) and also a
coordinate reference system, that now is used into ImportImage plugin.


Could you please let me know what can I do to resolve my issue? Any
idea?

Thank you,

Irene

Scopri istella, il nuovo motore per il web
italiano.
  Istella garantisce risultati di qualità e la possibilità di
condividere, in modo semplice e veloce, documenti, immagini, audio e
video.
  Usa istella, vai su http://www.istella.it?wtk=amc138614816829636
[1]



Links:
--
[1] http://www.istella.it?wtk=amc138614816829636


Scopri istella, il nuovo motore per il web italiano.
Istella garantisce risultati di qualità e la possibilità di condividere, in 
modo semplice e veloce, documenti, immagini, audio e video.
Usa istella, vai su http://www.istella.it?wtk=amc138614816829636

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




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


Re: [josm-dev] MapCSS: Replacing of text / Escaping special characters

2014-02-03 Thread Paul Hartmann

On 02/03/2014 01:35 PM, Martin Vonwald wrote:

Hi!

Is there any known way in a MapCSS style to either escape special
characters (regarding SVG) or replace some characters within a text?

I want to build an embedded svg containing text from a tag. I need to
escape special characters from the text, otherwise the text will no display
correctly.


There is a replace function [1]. I'm guessing you want to use SVG as 
data url, so need to URL-encode the SVG source? It shouldn't be too 
difficult to provide a function for that (we can use 
java.net.URLEncoder). Please open a ticket if it is needed.


[1] 
http://josm.openstreetmap.de/doc/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.Functions.html#replace(java.lang.String, 
java.lang.String, java.lang.String)


Paul

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


Re: [josm-dev] Request for review of plugins

2014-02-27 Thread Paul Hartmann

On 02/26/2014 10:08 PM, Simon Legner wrote:

On 26/02/14 21:58, Marián Kyral wrote:

Thanks Simon. It fixes the first case (when there is a local git
repository inside the plugin folder). But it still fails when there is
no .git folder at all.


Right, but what should be the outcome? How to determine the last change
timestamp?

I won't look into this issue since I do not consider building a plugin
from a non-repository very important.


I've added another fall-back ([o30309]). When the plugin is not under 
version control, it should now set the revision to UNKOWN and the date 
to the current date.


This is mainly for testing purpose, until you decide to commit the code 
to some repository.


Paul

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


Re: [josm-dev] Installation of josm plugin via eclipse

2014-03-25 Thread Paul Hartmann

On 03/25/2014 04:48 PM, Jochen Willig wrote:


dist:

BUILD SUCCESSFUL


Congratulations, you just build your first JOSM plugin.

The error is shown, because the program svn is not installed or not in 
execution PATH. Apparently it works anyway.


Paul


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


Re: [josm-dev] Plugin: Access layer pixel data

2014-04-15 Thread Paul Hartmann

On 15.04.2014 18:24, Nick Ma. wrote:

I'm working on a plugin like Tracer2[1] but which should run
entirely embedded into JOSM.

Therefore I'm asking for the best way to access pixel color shown in
an active Layer[2] or ImageryLayer?


Like this (gets the pixels in the current view):

 BufferedImage image = new BufferedImage(20, 30, 
BufferedImage.TYPE_INT_ARGB);

 Graphics2D g2 = image.createGraphics();
 g2.setClip(0, 0, 20, 30);
 Main.map.mapView.paint(g2);
 int col = image.getRGB(5,6);

The Layer class has a paint() method as well, if you just need one layer.


Why/Background/Next steps (that's not the question):
To execute an edge detection[3] algorithm with the image information
and auto detect the edges of an area currently displayed in JOSM.
Helping to faster create buildings.


The library ImageJ might be worth a look. It is pure Java and is 
advertised as being fast.


Also lakewalker is another plugin that does a similar thing, but more 
specialized.


Paul

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


Re: [josm-dev] Progress monitor not being closed

2014-04-15 Thread Paul Hartmann

On 15.04.2014 18:16, Marián Kyral wrote:

There is no close() method on PleaseWaitRunnable class. Did I miss
something?


I was not referring to the PleaseWaitProgressMonitor class in this 
sentence, your problem is unrelated.


There are dozens of PleaseWaitRunnable usages both in JOSM core and in 
the plugin repository, where it works fine. You should try to comment 
out all the code in realRun() and finish(). If it works then, put it 
back step by step.


One problem might be, that you are doint GUI in a worker thread. Have a 
look at [1] on how to hand that code to the Event dispatch thread.


[1] 
http://josm.openstreetmap.de/browser/josm/trunk/src/org/openstreetmap/josm/gui/io/DownloadPrimitivesWithReferrersTask.java?rev=6973#L137


Paul

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


Re: [josm-dev] Relative links in preferences.xml

2014-05-04 Thread Paul Hartmann

On 03.05.2014 14:16, Alex Rollin wrote:

Hello,

I am trying to distribute JOSM with the HDM Presets and Paint Styles for
offline survey.  That means I can't rely on JOSM to be able to pull the
presets down, and links should be relative so that they work no matter
where a user places the JOSM directory.

I really want to make a folder situation like this:

josm-latest.jar
-appdata
--HDM
---HDM-JOSM-style.zip
---HDM.xml (HDM Presets)

I am looking at the preferences.xml file and I cannot figure out how to put
in a relative link.
I see only absolute links like C:Users/blahblah/Desktop/josm/etc/HDM.xml

I see another kind of relative link that appears to point inside the
jar, resource://data/defaultpresets.xml


As a hacky and very preliminary solution, you could distribute your 
style and presets inside josm-latest.jar. A jar file is just a regular 
zip file with a different file extension, so what you can do:

* rename josm-latest.jar to josm-latest.zip
* unzip
* place your styles and presets in the directory structure
* zip all the files to josm-latest2.zip
* rename josm-latest2.zip to josm-latest2.jar

Then you can use the resource:// URLs in the preferences.xml.

Yes, it is a good idea to support paths relative to the JOSM preferences 
directory and relative to the JOSM cache directory, but I don't think 
this is possible at the moment.


Paul

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


Re: [josm-dev] deactivate finishing way drawing by double click

2014-05-04 Thread Paul Hartmann

On 02.05.2014 15:20, Martin Koppenhoefer wrote:

I am not sure when exactly this was introduced and if it was on purpose,
but for some months I strongly suffer from interruptions because JOSM stops
drawing the current way and starts a new one (with a gap). This because it
perceives a double click where in reality two shortly intervalled single
clicks are intended.

Is there a button I can push to stop this? (or a Einstein property)? I had
thought this was potlatch-compatibility modus / behaviour, but I have not
activated this in my prefs.

This is really slowing down the work because you have to click slowly and
have to recombine small pieces of ways every now and then.

Also there is already alt+click to start a new way.


Hi Martin, please open a ticket at the JOSM bugtracker [1], including a 
status report [2].


[1] http://josm.openstreetmap.de/newticket
[2] http://josm.openstreetmap.de/wiki/Help/Action/ShowStatusReport

Paul

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


[josm-dev] JOSM main map style converted to MapCSS format

2014-05-19 Thread Paul Hartmann

Hi everyone,

I have completed the conversion of the main map style in JOSM to the 
MapCSS format [1]. The new style (which should ideally look about the 
same as the old one) is activated by default since version 7139. For 
comparison, the original XML style is still available in the map paint 
dialog [2].


Please don't hesitate to report anything strange or erroneous. You can 
add a comment in the meta ticket #9691 [3], or just open a new ticket. 
There are some minor intentional changes, e.g. the priorities for 
objects with multiple main tags may have changed. For example a node 
tagged as amenity=restaurant  tourism=hotel used to show a restaurant 
icon and now shows a hotel icon. This can also be reported if you think 
the new priorities are wrong and should be fixed.


Why did we switch? Well, almost all of our newer user contributed styles 
[4] are written in MapCSS. Compared to the XML format, MapCSS was more 
powerful when it was introduced and has been constantly extended and 
improved. Even the performance is now on par, after a number of 
optimizations in this month.
So there is simply no reason to stick to the solid, but somewhat dusty 
XML format. Instead we should use the options of the new format to 
enhance the default style.


Anyone is invited to contribute ideas, styles, patches, etc.! They can 
be submitted in ticket #10043 [5].


[1] http://wiki.openstreetmap.org/wiki/Mapcss
[2] https://josm.openstreetmap.de/wiki/Help/Dialog/MapPaint
[3] https://josm.openstreetmap.de/ticket/9691
[4] https://josm.openstreetmap.de/wiki/Styles
[5] https://josm.openstreetmap.de/ticket/10043

Paul

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


Re: [josm-dev] JOSM 7182 released (first Java 7 version)

2014-05-28 Thread Paul Hartmann

On 28.05.2014 20:53, Maarten Deen wrote:

And now there is this strange N next to a node, it seems to be related
to a node having a note. How can I remove this N?


You can revert this new feature by adding a style that overrides the 
corresponding map paint rule.


Paul


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


Re: [josm-dev] JOSM plugin development - How to avoid duplicate additional library

2014-06-21 Thread Paul Hartmann

On 21.06.2014 15:24, Beata Jancso wrote:

Hi,

Perhaps to create another new plugin that gives access for both
plugins to the additional library?


Exactly. See [1], field 'Plugin-Requires'. E.g. ImportImagePlugin and 
opendata plugin both depend on the geotools plugin.


If you need more guidance, it would help to know what library / plugin 
you are referring to.


[1] 
http://josm.openstreetmap.de/wiki/DevelopersGuide/DevelopingPlugins#ThemanifestfileforaJOSMplugin


Best, Paul

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


Re: [josm-dev] How to get selected relations in JOSM?

2014-07-07 Thread Paul Hartmann

On 05.07.2014 16:45, Jochen Willig wrote:

Dear JOSM-Developers,



I am developing a Plugin to set automatically a relation with other selected
relations. Therefore I thought I can use the method getSelectedRelations().
Unfortunatley it returns nothing. The method getRelations() returns all
relations in the data set.

Does anyone has an idea why this is not working or a hint how to do it
differently?


getSelectedRelations() should work. You can get the entire selection and 
check for each entry in the collection if the object is an instance of 
type Relation.


Paul

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


Re: [josm-dev] Custom K/V Tags in MAPCSS?

2014-07-16 Thread Paul Hartmann

On 16.07.2014 11:45, Alex Rollin wrote:

I am just trying to get some nodes to
show with an icon.


I don't quite understand the rest of your mail, but here is how you 
create a custom map style:


http://josm.openstreetmap.de/wiki/Styles

Best, Paul


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


Re: [josm-dev] prop()/is_prop_set() on left side of sign

2014-07-17 Thread Paul Hartmann

On 17.07.2014 09:16, Martin Vonwald wrote:

Hi!

On [1] it says in the section Child selector in one of the notes: The
functions prop() and is_prop_set() are only supported on the right side of
the  sign. 

Right now I'm under the impression that this is not true and in fact at
least is_prop_set with a given layer also works on the left side of the 
sign.

Can someone confirm or deny this? And if it works: is it intended or just a
bug that might be fixed?


Let's say, you get undefined behavior when using prop() and 
is_prop_set() on the left hand side of the  sign.


What I would intuitively expect, is to get the properties of the parent 
object, e.g.


way[highway=residential], way[highway=primary] {
  is_highway: true;
}
way[is_prop_set(is_highway)]  node {
...
}

This is not going to work! Instead it will probably check the properties 
of the current object or something like that, so it is not really useful 
to write anything in that form ...


Paul

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


Re: [josm-dev] JOSM wants to add a certificate?

2014-07-18 Thread Paul Hartmann

On 18.07.2014 21:35, Paul Johnson wrote:

Could it be a ca-cert.org so there's some kind of authority that people
might have a root cert already installed for?


The browser connects to localhost aka. 127.0.0.1. I doubt you can get a 
certificate for that _and_ distribute the private key in plain text as 
would be needed for the software to create an HTTPS connection.


Paul


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


  1   2   >