Re: warnings after importing PT_Assistant plugin project

2020-03-03 Thread Jiri Vlasak
Hi,

On Tue, Mar 03, 2020 at 08:16:20AM +0530, Vaibhav Bisht wrote:
> Hello,
> I have recently moved on from eclipse to IntelliJ ide now the problem is
> that when I imported the project in the IDE I got three following warnings
> WARNING: Could not detect the project version, you are probably not
> building inside a git repository!
> WARNING: The project version is currently the default value `unspecified`.
> WARNING: To change the version number, either build in a git-repository or
> set the version manually by adding the line `project.version = "1.2.3"` to
> the Gradle build script.
> 
> I think that there could be some build issues here. Please let me know what
> it is

so it looks like you don't use git for development. Maybe you use svn and need
to configure IntelliJ to use Subversion?

jiri



josm on flash -- asking for review

2020-02-26 Thread Jiri Vlasak
Dear JOSM devs,

I would like to ask for review of *josm-on-flash* miniproject [1] with source
code available at [2].

Based on JOSM on USB stick [3] I set up auto build for .zip archive and publish
it as GitLab page. The .zip archive contains OpenJDK with josm-tested.jar and
.bat script to run JOSM from flash. Also, there are install files of OpenJDK.

The use case is on mapathons -- run JOSM directly from flash or share OpenJDK
install files to save bandwidth.

I will send the link to talk mailing list but I will be happy for a feedback
before doing so.

Thanks,
jiri

[1]: https://mapathon-cz.gitlab.io/josm-on-flash/
[2]: https://gitlab.com/mapathon-cz/josm-on-flash
[3]: https://josm.openstreetmap.de/wiki/USB_Stick



Re: Getting tiles for plugin usage

2019-11-01 Thread Jiri Vlasak
On Sun, Oct 20, 2019 at 12:54:40PM +0200, Dirk Stöcker wrote:
> On Thu, 17 Oct 2019, Jiri Vlasak wrote:
> 
> > there was Missing Maps hackathon this weekend in Pilsen, Czech Republic. 
> > One of
> > the tasks we were working on was click building feature [1] -- building plot
> > based on mouse click to the middle of the building.
> > 
> > I am interested in getting background imagery in effective way. Currently, 
> > the
> > following steps are used:
> > 1. Mouse listener knows the coordinates.
> > 2. Coordinates are recomputed to TileXY.
> > 3. New tiles around the mouse click are created in array (9 of them).
> > 4. Based on Tile URL, Images are downloaded and used for algorithm.
> > 
> > I feel like downloading Tiles multiple times is not effective.
> 
> I'd recommend the meachnism already included in JOSM, e.g. the Tile loader
> classes which also do caching.

That's good point. I would like to use that, but I am lost in how does it work.
Can you point me to the right direction, please?

I feel like I miss something basic. I am able to get the current ImageryLayer
but not the image. And the methods I think could work for me (like
`getVisibleTileSet()`) are usually private.

Thanks,
jiri



Getting tiles for plugin usage

2019-10-16 Thread Jiri Vlasak
Dear JOSM devs,

there was Missing Maps hackathon this weekend in Pilsen, Czech Republic. One of
the tasks we were working on was click building feature [1] -- building plot
based on mouse click to the middle of the building.

I am interested in getting background imagery in effective way. Currently, the
following steps are used:
1. Mouse listener knows the coordinates.
2. Coordinates are recomputed to TileXY.
3. New tiles around the mouse click are created in array (9 of them).
4. Based on Tile URL, Images are downloaded and used for algorithm.

I feel like downloading Tiles multiple times is not effective.

Also, I think that we found a bug in Tile.getUrl() -- for Esri imagery, it
returns:

https://{switch:services,server}.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer/tile/{zoom}/{y}/{x}/17/79468/63554.png

Instead of proper URL. And I have the same issues with Maxar.

[1]: https://gitlab.com/qeef/mapathoner/commits/feature/click-building

Thanks,
jiri



Re: GSoC PT-Assistant project

2019-07-23 Thread Jiri Vlasak
On Mon, Jul 22, 2019 at 02:20:28PM +0530, ashish singh wrote:
> Hi,
> 
> Is there any way to get all route relations from the currently downloaded
> map?

Maybe you may use MapCSS for that:

https://josm.openstreetmap.de/wiki/Help/Styles/MapCSSImplementation#Linkselector

jiri



Re: GSoC 2019 PT-assistant Plugin

2019-07-15 Thread Jiri Vlasak
On Sat, Jul 13, 2019 at 05:00:40PM +0530, ashish singh wrote:
> I need to make rectangle given a segment as a base and check whether
> something (stop, another home)is inside this rectangle or not. Is there
> some code already written regarding this? If it is already there where I
> can find it in the core?

I think that you are asking about `⊆` and `⊇` operators of MapCSS.

Please, check out this wiki page:

https://josm.openstreetmap.de/wiki/Help/Styles/MapCSSImplementation

jiri



Re: Develop for JOSM core or plugin?

2019-04-27 Thread Jiri Vlasak
On Fri, Apr 26, 2019 at 02:53:49PM -0700, Tom H. wrote:
> Hi All,
> 
> I'm using JOSM constantly in my day to day job, and I'm having a few ideas
> for using hotkeys to toggle some of the layer settings that can now only be
> activated by point and click. I'm new to contributing in JOSM but am
> currently looking through the dev docs, and I was just wondering if it's
> better to realize my hotkey ideas via a plugin, or trying to incorporating
> them into the JOSM core?

tl;dr (generic) ? upstream : plugin ;

There was already discussion when I started developing the plugin. Feel free to
see the "JOSM enhancements vs. separate plugin" thread [1].

Have a nice day,
jiri

[1]: https://lists.openstreetmap.org/pipermail/josm-dev/2018-May/thread.html



Re: Plugin installation without restart

2019-02-27 Thread Jiri Vlasak
Hi,

thanks. It make sense now. I think I was confused because the JOSM didn't ask
for restart after update once. But maybe I just overlooked it.

Thanks again,
jiri

On Wed, Feb 27, 2019 at 06:56:47PM +0100, Michael Zangl wrote:
> Hi,
> 
> A plugin update always requires a restart - you cannot get around this.
> 
> The technical reason is that JOSM cannot unload the old plugin classes. This 
> is why an activation of a plugin is possible without restart, but 
> deactivating it is not.
> 
> Am 27. Februar 2019 13:33:49 MEZ schrieb Jiri Vlasak :
> >Hi Gerd,
> >
> >thanks for your time. I am pretty sure I miss something trivial.
> >
> >On Sat, Feb 23, 2019 at 08:10:12AM +, Gerd Petermann wrote:
> >> Hi Jiri,
> >> 
> >> my understanding is that your plugin either requires a restart (set
> >plugin.canloadatruntime to false in build.xml)
> >
> >The `canLoadAtRuntime = true` should be set properly [1].
> >
> >> or it should work so that it reacts on a event to rebuild everything
> >(maybe costly)
> >
> >I am confused a little bit with "reacts on a event" part. The plugin
> >constructor add entries to menu:
> >
> >public class MapathonerPlugin extends Plugin
> >{
> >/**
> > * Constructs a new {@code MapathonerPlugin}.
> > */
> >public MapathonerPlugin(PluginInformation info)
> >{
> >super(info);
> >MainMenu mm = MainApplication.getMenu();
> >JMenu hm = mm.addMenu("Mapathoner",
> >tr("Mapathoner"),
> >KeyEvent.VK_M,
> >mm.getDefaultMenuPos(),
> >ht("/Plugin/Mapathoner"));
> >
> >hm.setMnemonic(KeyEvent.VK_M);
> >
> >mm.add(hm, new BatchCircleBuildingAction());
> >mm.add(hm, new BatchOrthogonalBuildingAction());
> >mm.add(hm, new BatchLBuildingAction());
> >hm.addSeparator();
> >mm.add(hm, new PickResidentialAreaAction());
> >}
> >}
> >
> >Which should be ok ("Adding a menu entry to the main menu in the plugin
> >Constructor" [3]). Also, shortcuts are bound to actions.
> >
> >Thanks for any pointer,
> >jiri
> >
> >[1]: https://gitlab.com/qeef/mapathoner/blob/master/build.gradle
> >[2]:
> >https://gitlab.com/qeef/mapathoner/blob/master/src/main/java/org/openstreetmap/josm/plugins/mapathoner/MapathonerPlugin.java
> >[3]:
> >https://josm.openstreetmap.de/wiki/DevelopersGuide/PluginInstallationWithoutRestart
> >
> >> Gerd
> >> 
> >> 
> >> Von: Jiri Vlasak 
> >> Gesendet: Dienstag, 19. Februar 2019 07:47
> >> An: josm-dev@openstreetmap.org
> >> Betreff: Plugin installation without restart
> >> 
> >> Dear JOSM devs,
> >> 
> >> I would like to ask about the difference between installing and
> >upgrading JOSM
> >> plugin. In my case, the installation does not the restart of JOSM
> >[1]. However,
> >> when the plugin is upgraded, the new functionality does not work
> >until restart.
> >> 
> >> The plugin adds JMenu with multiple options.
> >> 
> >> Thanks,
> >> jiri
> >> 
> >> [1]:
> >https://josm.openstreetmap.de/wiki/DevelopersGuide/PluginInstallationWithoutRestart
> >> 



Re: Plugin installation without restart

2019-02-27 Thread Jiri Vlasak
Hi Gerd,

thanks for your time. I am pretty sure I miss something trivial.

On Sat, Feb 23, 2019 at 08:10:12AM +, Gerd Petermann wrote:
> Hi Jiri,
> 
> my understanding is that your plugin either requires a restart (set 
> plugin.canloadatruntime to false in build.xml)

The `canLoadAtRuntime = true` should be set properly [1].

> or it should work so that it reacts on a event to rebuild everything (maybe 
> costly)

I am confused a little bit with "reacts on a event" part. The plugin 
constructor add entries to menu:

public class MapathonerPlugin extends Plugin
{
/**
 * Constructs a new {@code MapathonerPlugin}.
 */
public MapathonerPlugin(PluginInformation info)
{
super(info);
MainMenu mm = MainApplication.getMenu();
JMenu hm = mm.addMenu("Mapathoner",
tr("Mapathoner"),
KeyEvent.VK_M,
mm.getDefaultMenuPos(),
ht("/Plugin/Mapathoner"));

hm.setMnemonic(KeyEvent.VK_M);

mm.add(hm, new BatchCircleBuildingAction());
mm.add(hm, new BatchOrthogonalBuildingAction());
mm.add(hm, new BatchLBuildingAction());
hm.addSeparator();
mm.add(hm, new PickResidentialAreaAction());
}
}

Which should be ok ("Adding a menu entry to the main menu in the plugin
Constructor" [3]). Also, shortcuts are bound to actions.

Thanks for any pointer,
jiri

[1]: https://gitlab.com/qeef/mapathoner/blob/master/build.gradle
[2]: 
https://gitlab.com/qeef/mapathoner/blob/master/src/main/java/org/openstreetmap/josm/plugins/mapathoner/MapathonerPlugin.java
[3]: 
https://josm.openstreetmap.de/wiki/DevelopersGuide/PluginInstallationWithoutRestart

> Gerd
> 
> 
> Von: Jiri Vlasak 
> Gesendet: Dienstag, 19. Februar 2019 07:47
> An: josm-dev@openstreetmap.org
> Betreff: Plugin installation without restart
> 
> Dear JOSM devs,
> 
> I would like to ask about the difference between installing and upgrading JOSM
> plugin. In my case, the installation does not the restart of JOSM [1]. 
> However,
> when the plugin is upgraded, the new functionality does not work until 
> restart.
> 
> The plugin adds JMenu with multiple options.
> 
> Thanks,
> jiri
> 
> [1]: 
> https://josm.openstreetmap.de/wiki/DevelopersGuide/PluginInstallationWithoutRestart
> 



Plugin installation without restart

2019-02-18 Thread Jiri Vlasak
Dear JOSM devs,

I would like to ask about the difference between installing and upgrading JOSM
plugin. In my case, the installation does not the restart of JOSM [1]. However,
when the plugin is upgraded, the new functionality does not work until restart.

The plugin adds JMenu with multiple options.

Thanks,
jiri

[1]: 
https://josm.openstreetmap.de/wiki/DevelopersGuide/PluginInstallationWithoutRestart



Re: github or subversion?

2019-02-11 Thread Jiri Vlasak
If you are creating new JOSM plugin, I strongly suggest using
josm-gradle-plugin [1], git, and gitlab pages for providing the `.jar` file.

[1]: https://gitlab.com/floscher/gradle-josm-plugin

On Mon, Feb 11, 2019 at 09:01:07PM +, Malcolm Herring via josm-dev wrote:
> The plugins developer guide says use SVN, but that repo says that SVN is
> deprecated & to use GIT instead. Which is the correct?
> 
> 



Re: LiveJOSM project

2018-12-04 Thread Jiri Vlasak

On 12/4/18 10:48 PM, Sebastiaan Couwenberg wrote:

On 12/4/18 10:39 PM, Jiri Vlasak wrote:

I would like to announce the LiveJOSM [1] project. It's not much, just
Debian Live [2] with JOSM preinstalled (+ some plugins).


Why not install the josm package from the backports repository?

No need for the icon hack then.


There is no deep meaning in that. I am just used to download .jar from 
website.


jiri



LiveJOSM project

2018-12-04 Thread Jiri Vlasak

Dear JOSM devs,

I would like to announce the LiveJOSM [1] project. It's not much, just 
Debian Live [2] with JOSM preinstalled (+ some plugins). The purpose of 
this project is to enable JOSM on Missing Maps [3] mapathons for users 
without JOSM installed or mapping on company computers.


The project is in testing stage.

Some already build images ready to be burned to DVD or copied to USB 
disk are (maybe) available on unreliable server [4].


Have a nice day,
jiri

[1]: https://gitlab.com/qeef/livejosm
[2]: https://wiki.debian.org/DebianLive/
[3]: https://www.missingmaps.org/
[4]: http://giran.info/