Resource Handling in josm-ng

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Resource Handling in josm-ng

Raphael Studer
Hi,

I tried to use the josm-ng and get a null pointer at
org.openstreetmap.josmng.view.osm.Style.parseRules (Line 69) while
opening the /styles/standard/elemstyles.xml file.

To fix this, I had to add the styles folder somewhere in the eclipse
project preferences.
Is there a possibility to add the resource without changing project
settings for an IDE?

Regards
Raphael

_______________________________________________
josm-dev mailing list
[hidden email]
http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/josm-dev
Reply | Threaded
Open this post in threaded view
|

Re: Resource Handling in josm-ng

Petr Nejedly
Raphael Studer napsal(a):
> Hi,
>
> I tried to use the josm-ng and get a null pointer at
> org.openstreetmap.josmng.view.osm.Style.parseRules (Line 69) while
> opening the /styles/standard/elemstyles.xml file.
>
> To fix this, I had to add the styles folder somewhere in the eclipse
> project preferences.

There are two "source roots" defined for the project - /src and /styles.
Both are configured properly in the NetBeans project definiton and I haven't
tried opening the project under eclipse.
Styles are under separate source root to allow simple redirect to other
styles source - the bundled style is in fact empty and so rendering falls
back to wireframe rendering.

I'm mostly using the mappaint styleset by putting:
src.styles.dir=../josm-trunk
into nbproject/private/private.properties
And if you just invoke ant inside the root folder of the project
it should build everything the same way as in NetBeans IDE, including
such a private style redirect.
(hmm, it seems that you may need to have NetBeans installed anyway
to build it this way, it uses some NB-specific ant extensions...)

> Is there a possibility to add the resource without changing project
> settings for an IDE?

Well, you can still create the style file "styles/standard/elemstyles.xml"
directly under src folder, classpath is classpath.

I will need to implement richer style semantics for the HiFi rendering anyway,
then I'll bundle my own style file (with different syntax).
But I'll have to copy the icons then. This setup allowed me to avoid
source-level copying.

--
Petr "Nenik" Nejedly, NetBeans/Sun Microsystems, http://www.netbeans.org
355/113 -- Not the famous irrational number PI, but an incredible simulation!

_______________________________________________
josm-dev mailing list
[hidden email]
http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/josm-dev
Reply | Threaded
Open this post in threaded view
|

Re: Resource Handling in josm-ng

Raphael Studer
I don't know if Eclipse uses ant to build projects. Or if this can be
defined somewhere..

> I will need to implement richer style semantics for the HiFi rendering
> anyway,
> then I'll bundle my own style file (with different syntax).
> But I'll have to copy the icons then. This setup allowed me to avoid
> source-level copying.

Whats about just include the icons in the svn? Like the tilesAtHome
includes the osmarender and the orp?

Raphael

_______________________________________________
josm-dev mailing list
[hidden email]
http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/josm-dev
Reply | Threaded
Open this post in threaded view
|

Re: Resource Handling in josm-ng

Petr Nejedly
Raphael Studer napsal(a):
> I don't know if Eclipse uses ant to build projects. Or if this can be
> defined somewhere..
I don't know either, but I'm sure eclipse can easily handle multiple
source roots. See the josm's .classpath file.

>
>> I will need to implement richer style semantics for the HiFi rendering
>> anyway,
>> then I'll bundle my own style file (with different syntax).
>> But I'll have to copy the icons then. This setup allowed me to avoid
>> source-level copying.
>
> Whats about just include the icons in the svn? Like the tilesAtHome
> includes the osmarender and the orp?

Well, thanks for the tip, but I never used _that_* feature of SVN before.
I did some learning, tried to link styles/standard/icons
to the shared icons folder but somehow screwed it up ;-/
So I'll try to clean it up, link it better, directly into the src folder
and get rid of the other source root altogether. Wish me luck....

*) I can't even _name_ the feature now.
--
Petr "Nenik" Nejedly, NetBeans/Sun Microsystems, http://www.netbeans.org
355/113 -- Not the famous irrational number PI, but an incredible simulation!

_______________________________________________
josm-dev mailing list
[hidden email]
http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/josm-dev
Reply | Threaded
Open this post in threaded view
|

Re: Resource Handling in josm-ng

Petr Nejedly
Petr Nejedly napsal(a):

> Raphael Studer napsal(a):
>> I don't know if Eclipse uses ant to build projects. Or if this can be
>> defined somewhere..
> I don't know either, but I'm sure eclipse can easily handle multiple
> source roots. See the josm's .classpath file.
>
>>> I will need to implement richer style semantics for the HiFi rendering
>>> anyway,
>>> then I'll bundle my own style file (with different syntax).
>>> But I'll have to copy the icons then. This setup allowed me to avoid
>>> source-level copying.
>> Whats about just include the icons in the svn? Like the tilesAtHome
>> includes the osmarender and the orp?
[...]
> So I'll try to clean it up, link it better, directly into the src folder
> and get rid of the other source root altogether. Wish me luck....

OK, I did the cleanup, try it now with a single source root. You'll see what
I see out of the box with my (slightly modified) copy of elemstyles finally
in SVN.
Keep in mind that if you open an .osm file, view will still be centered around
my village, so you'll need to do a bit of zooming and panning to actually
see your data....

BTW: Feel free to commit an eclipse project definition if you happen to create one.

--
Petr "Nenik" Nejedly, NetBeans/Sun Microsystems, http://www.netbeans.org
355/113 -- Not the famous irrational number PI, but an incredible simulation!

_______________________________________________
josm-dev mailing list
[hidden email]
http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/josm-dev
Reply | Threaded
Open this post in threaded view
|

Re: Resource Handling in josm-ng

Raphael Studer
In reply to this post by Petr Nejedly
>> I don't know if Eclipse uses ant to build projects. Or if this can be
>> defined somewhere..
>
> I don't know either, but I'm sure eclipse can easily handle multiple
> source roots. See the josm's .classpath file.

Yes, Eclipse can handle them. As I wrote on the first Mail you can add
them somewhere in the project preferences.

>>> I will need to implement richer style semantics for the HiFi rendering
>>> anyway,
>>> then I'll bundle my own style file (with different syntax).
>>> But I'll have to copy the icons then. This setup allowed me to avoid
>>> source-level copying.
>>
>> Whats about just include the icons in the svn? Like the tilesAtHome
>> includes the osmarender and the orp?
>
> Well, thanks for the tip, but I never used _that_* feature of SVN before.
> I did some learning, tried to link styles/standard/icons
> to the shared icons folder but somehow screwed it up ;-/
> So I'll try to clean it up, link it better, directly into the src folder
> and get rid of the other source root altogether. Wish me luck....
>
> *) I can't even _name_ the feature now.

I'dont know how to use this feature, but maybe Bart from the
merkaartor editor can help you.

Regards

_______________________________________________
josm-dev mailing list
[hidden email]
http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/josm-dev
Reply | Threaded
Open this post in threaded view
|

Re: Resource Handling in josm-ng

Raphael Studer
In reply to this post by Petr Nejedly
>> So I'll try to clean it up, link it better, directly into the src folder
>> and get rid of the other source root altogether. Wish me luck....
>
> OK, I did the cleanup, try it now with a single source root. You'll see what
> I see out of the box with my (slightly modified) copy of elemstyles finally
> in SVN.
> Keep in mind that if you open an .osm file, view will still be centered
> around
> my village, so you'll need to do a bit of zooming and panning to actually
> see your data....

I've seen that, because of the coordinates at the left bottom corner :)

> BTW: Feel free to commit an eclipse project definition if you happen to
> create one.

I try to, but at the moment I'm a little bit unhappy with my eclipse
installations. Because I had to switch between win and linux at least
twice a day :(
So the only thing I'm working on is the stylesheet, but not verry succsesfull..

Regards
Raphael

_______________________________________________
josm-dev mailing list
[hidden email]
http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/josm-dev
Reply | Threaded
Open this post in threaded view
|

Re: Resource Handling in josm-ng

Raphael Studer
> So the only thing I'm working on is the stylesheet, but not verry succsesfull..

Don't know what i did wrong, but now it works.
I copied the josm elemstyles.xml and it's verry fast :)

Regrads
Raphael

_______________________________________________
josm-dev mailing list
[hidden email]
http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/josm-dev
Reply | Threaded
Open this post in threaded view
|

Re: Resource Handling in josm-ng

Petr Nejedly
Raphael Studer napsal(a):
>> So the only thing I'm working on is the stylesheet, but not verry succsesfull..
>
> Don't know what i did wrong, but now it works.
> I copied the josm elemstyles.xml and it's verry fast :)

Yes, it is*. Now let's make it really usable too....

*) Last week I tried whether I can make it swallow a dataset
of the germany.osm size, and with few mods**, I can indeed load
germany.osm (~8.5M entities) with a java heap slightly over a GB
and it is still usable (though slow) for whole-germany view
and pretty fast for closeup panning/editing. So while I had more
ideas on making josm-ng even less memory hungry, they would unnecessarily
complicate the code and I'm abandoning them for now.

**) One is direct timestamp parsing, so no expensive timestamp strings are held
on the heap. This is already in the SVN. The other is replacement of the giant
TreeMap index in the ViewData with a sorted array, but that needs more work
to be a valid solution.

--
Petr "Nenik" Nejedly, NetBeans/Sun Microsystems, http://www.netbeans.org
355/113 -- Not the famous irrational number PI, but an incredible simulation!

_______________________________________________
josm-dev mailing list
[hidden email]
http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/josm-dev