Re: [OSM-talk-be] Knooppuntennetwerken (Regional walking networks)

2011-08-06 Thread Gerard Vanderveken

Not yet tested, but visuals looking good.
A few problems remarked:

   
   
   
   
These are empty tracksegments, probably from ways that were not loaded 
in JOSM at the time of export.

(Verification or ad-hoc loading possible?)

   
   Zuid-Dijleland 516-517
   OpenStreetMap.org
   foot
   


   
   








   
   

In this last track the tracksegments are in opposite directions, both 
ending with the middle node  

This should be ordered  to get one long way.
Relation manager has no problems in doing that:
http://osmrm.openstreetmap.de/relation.jsp?id=1689797
Click +   'download GPX' (GPX is with route points)


OpenStreetMap.org
foot











Possible extensions for the code
- verifying it is a collection ralation
- file dialog to set map and name of exportfile

Regards,
Gerard

Jo wrote:


Now it also exports the routes of a collection relation as points:
...


___
Talk-be mailing list
Talk-be@openstreetmap.org
http://lists.openstreetmap.org/listinfo/talk-be


Re: [OSM-talk-be] Knooppuntennetwerken (Regional walking networks)

2011-08-06 Thread Jo
Something went wrong, so here is the code:

#!/bin/jython
> '''
> RWN2Garmin.py  - Numbered networks to Garmin GPX file converter
> This code is released under the GNU General
> Public License v2 or later.
>
> The GPL v3 is accessible here:
> http://www.gnu.org/licenses/gpl.html
>
> The GPL v2 is accessible here:
> http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
>
> It comes with no warranty whatsoever.
>
> This code illustrates how to use Jython to:
> * work with selected items or how to process all the primitives of a
> certain kind (node, way, relation)
>
> '''
> from javax.swing import JOptionPane, JDialog
> from java.awt.event import ActionListener, ActionEvent
> 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
> import time
>
> def getMapView():
> if Main.main and Main.main.map:
> return Main.main.map.mapView
> else:
> return None
>
> mv = getMapView()
> f = open('C:/export.gpx', 'w')
> f.write('\n')
> f.write('http://www.topografix.com/GPX/1/1"; creator="OSM Route
> Manager" version="1.1" xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="
> http://www.topografix.com/GPX/1/1
> http://www.topografix.com/GPX/1/1/gpx.xsd";>\n')
> f.write('\n')
> if mv and mv.editLayer and mv.editLayer.data:
> #selectedNodes = mv.editLayer.data.getSelectedNodes()
> #selectedWays = mv.editLayer.data.getSelectedWays()
> selectedRelations = mv.editLayer.data.getSelectedRelations()
>
> if not(selectedRelations):
> JOptionPane.showMessageDialog(Main.parent, "Please select a
> collection relation")
> else:
> # nodetype = Node().getType()
> print
> for collection in selectedRelations:
> print 'COLLECTION:', collection
> for member in collection.getMembers():
> print 'MEMBER:',member
> if member.isNode():
> node = member.getNode()
> coords = node.getCoor()
> lon = coords.getX()
> lat = coords.getY()
> rwn_ref = node.get('rwn_ref')
> f.write('\t\n')
> if rwn_ref:
> f.write('\t\t' + rwn_ref + '\n')
> f.write('\t\n')
> for member in collection.getMembers():
> if member.isRelation():
> routerelation = member.getRelation()
> f.write('\t\n')
> networkname =  routerelation.get('network:name')
> if not(networkname): networkname =  ''
> note = routerelation.get('note')
> if not(note): note =  ''
> f.write('\t\t' + networkname + ' ' + note +
> '\n')
> f.write('\t\tOpenStreetMap.org\n')
> f.write('\t\tfoot\n')
> for routerelmember in routerelation.getMembers():
> if routerelmember.isWay():
> f.write('\t\t\n')
> way=routerelmember.getWay()
> for waynode in way.getNodes():
>  coords = waynode.getCoor()
>  lon = coords.getX()
>  lat = coords.getY()
>  f.write('\t\t\t \n')
>
> f.write('\t\t\n')
> f.write('\t\n')
> f.write('\n')
> f.close()
>
___
Talk-be mailing list
Talk-be@openstreetmap.org
http://lists.openstreetmap.org/listinfo/talk-be


Re: [OSM-talk-be] Knooppuntennetwerken (Regional walking networks)

2011-08-06 Thread Jo
Hi Marc and Gerard,

Just to let you know that I'm still working on this. At the moment the code
only exports the nodes, I'll start working on processing the child relations
now.
To run this, it's necessary to install the scripting plugin and download
Jython. Then select scripting/show scripting console and copy/paste this
code to the editor window and save it. Then select a collection relation and
press the Run button. The result goes to C:/export.gpx. You probably want to
change that when running on Linux.

#!/bin/jython
> '''
> RWN2Garmin.py  - Numbered networks to Garmin GPX file converter
> This code is released under the GNU General
> Public License v2 or later.
>
> The GPL v3 is accessible here:
> http://www.gnu.org/licenses/gpl.html
>
> The GPL v2 is accessible here:
> http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
>
> It comes with no warranty whatsoever.
>
> This code illustrates how to use Jython to:
> * work with selected items or how to process all the primitives of a
> certain kind (node, way, relation)
>
> '''
> from javax.swing import JOptionPane, JDialog
> from java.awt.event import ActionListener, ActionEvent
> 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
> import time
>
> def getMapView():
> if Main.main and Main.main.map:
> return Main.main.map.mapView
> else:
> return None
>
> mv = getMapView()
> f = open('C:/export.gpx', 'w')
> f.write('\n')
> f.write('http://www.topografix.com/GPX/1/1"; creator="OSM Route
> Manager" version="1.1" xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="
> http://www.topografix.com/GPX/1/1
> http://www.topografix.com/GPX/1/1/gpx.xsd";>\n')
> f.write('\n')
> if mv and mv.editLayer and mv.editLayer.data:
> #selectedNodes = mv.editLayer.data.getSelectedNodes()
> #selectedWays = mv.editLayer.data.getSelectedWays()
> selectedRelations = mv.editLayer.data.getSelectedRelations()
>
> if not(selectedRelations):
> JOptionPane.showMessageDialog(Main.parent, "Please select a
> collection relation")
> else:
> # nodetype = Node().getType()
> print
> for collection in selectedRelations:
> print 'COLLECTION:', collection
> for member in collection.getMembers():
> print 'MEMBER:',member
> if member.isNode():
> node = member.getNode()
> coords = node.getCoor()
> lon = coords.getX()
> lat = coords.getY()
> rwn_ref = node.get('rwn_ref')
> f.write('\t\n')
> if rwn_ref:
> f.write('\t\t' + rwn_ref + '\n')
> f.write('\t\n')
> f.write('')
> f.close()
>
___
Talk-be mailing list
Talk-be@openstreetmap.org
http://lists.openstreetmap.org/listinfo/talk-be


Re: [OSM-talk-be] Knooppuntennetwerken (Regional walking networks)

2011-08-03 Thread Gerard Vanderveken

Alternative is in stead of a route to use track

http://www.topografix.com/GPX/1/1"; 
 creator="OSM Route Manager" 
version="1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
 
xsi:schemaLocation="http://www.topografix.com/GPX/1/1 
http://www.topografix.com/GPX/1/1/gpx.xsd"; 
>


   
 301
   
   
 302
   
   
   Dijleland 301-302
   OpenStreetMap.org
   foot
   
  
  
   
   
  
  
   
   
   
   Dijleland 302-303
   OpenStreetMap.org
   foot
   
  
  
  
   
   


Advantage is the track segment trkseg element that matches the ways in 
the sub relations.

(and no need to filter out double nodes from start and end of these ways)

Regards,
Gerard.

Jo wrote:


That doesn't look too complicated, I'll look into it, tomorrow.

Jo

2011/8/2 Gerard Vanderveken mailto:g...@ghia.eu>>

As a minimum you require an output file dijleland.gpx  like this
example


http://www.topografix.com/GPX/1/1";
 creator="OSM Route Manager"
version="1.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";

xsi:schemaLocation="http://www.topografix.com/GPX/1/1
http://www.topografix.com/GPX/1/1/gpx.xsd";

>


  301


  302


Dijleland 301-302
OpenStreetMap.org
foot
 
 
 


Dijleland 302-303
OpenStreetMap.org
foot
 
 
 



For every node there is a waypoint element wpt with the
coordinates and as name its ref number
For every sub relation there is a  route element rte
It contains route points rtept.
These rtept are all the nodes of the ways from the subrelation.
The streets and their nodes  need to be ordered from start to end
node (the ones with the ref tag)
Regards,
Gerard


Jo wrote:


Gerard,

If you provide me with a detailed example of what data in the osm
file, needs to become which information in the gpx, I might try
to program this in Python. It's possible to add python scripts to
JOSM.

Jo (Polyglot)

2011/8/2 Gerard Vanderveken mailto:g...@ghia.eu>>

It is not an obligation to have this 'not yet official'
collection relation.
I got the idea by looking at some Alp paths, where it was
used to link all paths of the network.

Everyone can add to the Wiki (registration and login required).
But if you feel uncomfortable doing edits in a Wiki , I can
do it for you, if you send me the relevant data.
The relation has to be created first, so the reference can be
put in the Wiki

For the creation of this specialised GPX, the exporting
functions of OSM are not suitabe.
There is some programming or script required to put each sub
relation into a route and convert the  nodes to waypoints.

Regards,
Gerard.

network (as far as they exist).

Should such a collection be created for all other
knooppunten networks ?
If so, can someone update the wiki page to reflect this,
so I can properly create and tag that collection for
Rivierenland

I downloaded the gpx file  from Zuid-Dijleland. I was
hoping to get the collection of knooppunten as waypoints.
The result was disappointing (import in Garmin RoadTrip).
Too many routes, even non-existing, waypoints without the
number of the knooppunt.

Is there a better way to retrieve the information as GPX
? I would already be happy with the knooppunten alone,
without the routes between them.
I've tried exporting them from JOSM, but this also looses
the number (which only exists as rwn_ref).


Marc




___
Talk-be mailing list
Talk-be@openstreetmap.org 
http://lists.openstreetmap.org/listinfo/talk-be
 




___
Talk-be mailing list
Talk-be@openstreetmap.org 
http://lists.openstreetmap.org/listinfo/talk-be



___

Re: [OSM-talk-be] Knooppuntennetwerken (Regional walking networks)

2011-08-02 Thread Jo
That doesn't look too complicated, I'll look into it, tomorrow.

Jo

2011/8/2 Gerard Vanderveken 

> **
> As a minimum you require an output file dijleland.gpx  like this example
>
> 
>  xmlns="http://www.topografix.com/GPX/1/1";creator="OSM
>  Route Manager" version="1.1" xmlns:xsi=
> "http://www.w3.org/2001/XMLSchema-instance";xsi:schemaLocation="http://www.topografix.com/GPX/1/1
> http://www.topografix.com/GPX/1/1/gpx.xsd";
> >
> 
> 
>   301
> 
> 
>   302
> 
> 
> Dijleland 301-302
> OpenStreetMap.org
> foot
>  
>  
>  
> 
> 
> Dijleland 302-303
> OpenStreetMap.org
> foot
>  
>  
>  
> 
> 
>
> For every node there is a waypoint element wpt with the coordinates and as
> name its ref number
> For every sub relation there is a  route element rte
> It contains route points rtept.
> These rtept are all the nodes of the ways from the subrelation.
> The streets and their nodes  need to be ordered from start to end node (the
> ones with the ref tag)
> Regards,
> Gerard
>
>
> Jo wrote:
>
> Gerard,
>
> If you provide me with a detailed example of what data in the osm file,
> needs to become which information in the gpx, I might try to program this in
> Python. It's possible to add python scripts to JOSM.
>
> Jo (Polyglot)
>
> 2011/8/2 Gerard Vanderveken 
>
>> It is not an obligation to have this 'not yet official' collection
>> relation.
>> I got the idea by looking at some Alp paths, where it was used to link all
>> paths of the network.
>>
>> Everyone can add to the Wiki (registration and login required).
>> But if you feel uncomfortable doing edits in a Wiki , I can do it for you,
>> if you send me the relevant data.
>> The relation has to be created first, so the reference can be put in the
>> Wiki
>>
>> For the creation of this specialised GPX, the exporting functions of OSM
>> are not suitabe.
>> There is some programming or script required to put each sub relation into
>> a route and convert the  nodes to waypoints.
>>
>> Regards,
>> Gerard.
>>
>>  network (as far as they exist).
>>>
>>> Should such a collection be created for all other knooppunten networks ?
>>> If so, can someone update the wiki page to reflect this, so I can
>>> properly create and tag that collection for Rivierenland
>>>
>>> I downloaded the gpx file  from Zuid-Dijleland. I was hoping to get the
>>> collection of knooppunten as waypoints.
>>> The result was disappointing (import in Garmin RoadTrip). Too many
>>> routes, even non-existing, waypoints without the number of the knooppunt.
>>>
>>> Is there a better way to retrieve the information as GPX ? I would
>>> already be happy with the knooppunten alone, without the routes between
>>> them.
>>> I've tried exporting them from JOSM, but this also looses the number
>>> (which only exists as rwn_ref).
>>>
>>>
>>> Marc
>>>
>>>  
>>>
>>> ___
>>> Talk-be mailing list
>>> Talk-be@openstreetmap.org
>>> http://lists.openstreetmap.org/listinfo/talk-be
>>>
>>>
>>
>>
>> ___
>> Talk-be mailing list
>> Talk-be@openstreetmap.org
>> http://lists.openstreetmap.org/listinfo/talk-be
>>
>
>  --
>
> ___
> Talk-be mailing 
> listTalk-be@openstreetmap.orghttp://lists.openstreetmap.org/listinfo/talk-be
>
>
___
Talk-be mailing list
Talk-be@openstreetmap.org
http://lists.openstreetmap.org/listinfo/talk-be


Re: [OSM-talk-be] Knooppuntennetwerken (Regional walking networks)

2011-08-02 Thread Gerard Vanderveken

As a minimum you require an output file dijleland.gpx  like this example


http://www.topografix.com/GPX/1/1"; creator="OSM Route 
Manager" version="1.1" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://www.topografix.com/GPX/1/1 
http://www.topografix.com/GPX/1/1/gpx.xsd";>


   
 301
   
   
 302
   
   
   Dijleland 301-302
   OpenStreetMap.org
   foot



   
   
   Dijleland 302-303
   OpenStreetMap.org
   foot



   


For every node there is a waypoint element wpt with the coordinates and 
as name its ref number

For every sub relation there is a  route element rte
It contains route points rtept.
These rtept are all the nodes of the ways from the subrelation.
The streets and their nodes  need to be ordered from start to end node 
(the ones with the ref tag)

Regards,
Gerard


Jo wrote:


Gerard,

If you provide me with a detailed example of what data in the osm 
file, needs to become which information in the gpx, I might try to 
program this in Python. It's possible to add python scripts to JOSM.


Jo (Polyglot)

2011/8/2 Gerard Vanderveken mailto:g...@ghia.eu>>

It is not an obligation to have this 'not yet official' collection
relation.
I got the idea by looking at some Alp paths, where it was used to
link all paths of the network.

Everyone can add to the Wiki (registration and login required).
But if you feel uncomfortable doing edits in a Wiki , I can do it
for you, if you send me the relevant data.
The relation has to be created first, so the reference can be put
in the Wiki

For the creation of this specialised GPX, the exporting functions
of OSM are not suitabe.
There is some programming or script required to put each sub
relation into a route and convert the  nodes to waypoints.

Regards,
Gerard.

network (as far as they exist).

Should such a collection be created for all other knooppunten
networks ?
If so, can someone update the wiki page to reflect this, so I
can properly create and tag that collection for Rivierenland

I downloaded the gpx file  from Zuid-Dijleland. I was hoping
to get the collection of knooppunten as waypoints.
The result was disappointing (import in Garmin RoadTrip). Too
many routes, even non-existing, waypoints without the number
of the knooppunt.

Is there a better way to retrieve the information as GPX ? I
would already be happy with the knooppunten alone, without the
routes between them.
I've tried exporting them from JOSM, but this also looses the
number (which only exists as rwn_ref).


Marc



___
Talk-be mailing list
Talk-be@openstreetmap.org 
http://lists.openstreetmap.org/listinfo/talk-be
 




___
Talk-be mailing list
Talk-be@openstreetmap.org 
http://lists.openstreetmap.org/listinfo/talk-be




___
Talk-be mailing list
Talk-be@openstreetmap.org
http://lists.openstreetmap.org/listinfo/talk-be
 

___
Talk-be mailing list
Talk-be@openstreetmap.org
http://lists.openstreetmap.org/listinfo/talk-be


Re: [OSM-talk-be] Knooppuntennetwerken (Regional walking networks)

2011-08-02 Thread Jo
Gerard,

If you provide me with a detailed example of what data in the osm file,
needs to become which information in the gpx, I might try to program this in
Python. It's possible to add python scripts to JOSM.

Jo (Polyglot)

2011/8/2 Gerard Vanderveken 

> It is not an obligation to have this 'not yet official' collection
> relation.
> I got the idea by looking at some Alp paths, where it was used to link all
> paths of the network.
>
> Everyone can add to the Wiki (registration and login required).
> But if you feel uncomfortable doing edits in a Wiki , I can do it for you,
> if you send me the relevant data.
> The relation has to be created first, so the reference can be put in the
> Wiki
>
> For the creation of this specialised GPX, the exporting functions of OSM
> are not suitabe.
> There is some programming or script required to put each sub relation into
> a route and convert the  nodes to waypoints.
>
> Regards,
> Gerard.
>
>  network (as far as they exist).
>>
>> Should such a collection be created for all other knooppunten networks ?
>> If so, can someone update the wiki page to reflect this, so I can properly
>> create and tag that collection for Rivierenland
>>
>> I downloaded the gpx file  from Zuid-Dijleland. I was hoping to get the
>> collection of knooppunten as waypoints.
>> The result was disappointing (import in Garmin RoadTrip). Too many routes,
>> even non-existing, waypoints without the number of the knooppunt.
>>
>> Is there a better way to retrieve the information as GPX ? I would already
>> be happy with the knooppunten alone, without the routes between them.
>> I've tried exporting them from JOSM, but this also looses the number
>> (which only exists as rwn_ref).
>>
>>
>> Marc
>>
>> --**--**
>> 
>>
>> __**_
>> Talk-be mailing list
>> Talk-be@openstreetmap.org
>> http://lists.openstreetmap.**org/listinfo/talk-be
>>
>>
>
>
> __**_
> Talk-be mailing list
> Talk-be@openstreetmap.org
> http://lists.openstreetmap.**org/listinfo/talk-be
>
___
Talk-be mailing list
Talk-be@openstreetmap.org
http://lists.openstreetmap.org/listinfo/talk-be


Re: [OSM-talk-be] Knooppuntennetwerken (Regional walking networks)

2011-08-02 Thread Gerard Vanderveken

It is not an obligation to have this 'not yet official' collection relation.
I got the idea by looking at some Alp paths, where it was used to link 
all paths of the network.


Everyone can add to the Wiki (registration and login required).
But if you feel uncomfortable doing edits in a Wiki , I can do it for 
you, if you send me the relevant data.
The relation has to be created first, so the reference can be put in the 
Wiki


For the creation of this specialised GPX, the exporting functions of OSM 
are not suitabe.
There is some programming or script required to put each sub relation 
into a route and convert the  nodes to waypoints.


Regards,
Gerard.


network (as far as they exist).

Should such a collection be created for all other knooppunten networks ?
If so, can someone update the wiki page to reflect this, so I can 
properly create and tag that collection for Rivierenland


I downloaded the gpx file  from Zuid-Dijleland. I was hoping to get 
the collection of knooppunten as waypoints.
The result was disappointing (import in Garmin RoadTrip). Too many 
routes, even non-existing, waypoints without the number of the knooppunt.


Is there a better way to retrieve the information as GPX ? I would 
already be happy with the knooppunten alone, without the routes 
between them.
I've tried exporting them from JOSM, but this also looses the number 
(which only exists as rwn_ref).



Marc



___
Talk-be mailing list
Talk-be@openstreetmap.org
http://lists.openstreetmap.org/listinfo/talk-be
 




___
Talk-be mailing list
Talk-be@openstreetmap.org
http://lists.openstreetmap.org/listinfo/talk-be


[OSM-talk-be] Knooppuntennetwerken (Regional walking networks)

2011-08-02 Thread Marc Gemis
I have added quite a few 'knooppunten' of the Rivierenland regional walking
network.
This information is not available through the Walking Routes wiki page.

Recently the Zuid-Dijleland network was added to the wiki page. Therefore
people created a
collection containing all nodes and routes of this network (as far as they
exist).

Should such a collection be created for all other knooppunten networks ?
If so, can someone update the wiki page to reflect this, so I can properly
create and tag that collection for Rivierenland

I downloaded the gpx file  from Zuid-Dijleland. I was hoping to get the
collection of knooppunten as waypoints.
The result was disappointing (import in Garmin RoadTrip). Too many routes,
even non-existing, waypoints without the number of the knooppunt.

Is there a better way to retrieve the information as GPX ? I would already
be happy with the knooppunten alone, without the routes between them.
I've tried exporting them from JOSM, but this also looses the number (which
only exists as rwn_ref).


Marc
___
Talk-be mailing list
Talk-be@openstreetmap.org
http://lists.openstreetmap.org/listinfo/talk-be