You are not logged in.

#1 2021-07-27 15:37:19

Ayooob
New Member
Registered: 2021-07-27
Posts: 2

JOSM: how to save my edits as an ordinary osm file, not as an OSM serv

I am trying to make edits somewhere(the edit includes deletion, modifying, and creation of features).
I need to convert the OSM file to XODR, when I trying this, it failed because of missing some attributes as changeset and timestamp...

So, I need to know how to save my edits as an ordinary osm file, not as an OSM server file...

I use this to conversion https://github.com/JHMeusener/osm2xodr

and this is the error i get

File "d:\osm2xodr\osm2xodr - mo7yasser\main.py", line 11, in <module>
    parseAll(osmPfad, bildpfad=topographieKartenPfad, minimumHeight = 163.0, maximumHeight= 192.0, curveRadius=12)
  File "d:\osm2xodr\osm2xodr - mo7yasser\OSMParser\osmParsing.py", line 525, in parseAll
    topoParameter = convertTopoMap(bildpfad, pfad)
  File "d:\osm2xodr\osm2xodr - mo7yasser\OSMParser\utils.py", line 122, in convertTopoMap
    topoParameter = giveMaxMinLongLat(osmpath)
  File "d:\osm2xodr\osm2xodr - mo7yasser\OSMParser\utils.py", line 164, in giveMaxMinLongLat
    for entity in parse_file(osmpath):
  File "C:\Users\mo7ya\AppData\Local\Programs\Python\Python39\lib\site-packages\osmread\__init__.py", line 25, in parse_file
    for e in parser.parse_file(filename):
  File "C:\Users\mo7ya\AppData\Local\Programs\Python\Python39\lib\site-packages\osmread\parser\__init__.py", line 18, in parse_file
    for e in self.parse(fp):
  File "C:\Users\mo7ya\AppData\Local\Programs\Python\Python39\lib\site-packages\osmread\parser\xml.py", line 47, in parse
    _changeset = int(attrs['changeset'])
  File "src\lxml\etree.pyx", line 2479, in lxml.etree._Attrib.__getitem__
KeyError: 'changeset'

Offline

#2 2021-07-27 16:25:14

GerdP
Member
Registered: 2015-12-18
Posts: 1,525

Re: JOSM: how to save my edits as an ordinary osm file, not as an OSM serv

It might not be obvious but new objects don't have a changeset. You may try osmconvert with the --fake-author option.
Save your file as changes.osm and use

osmconvert --fake-author changes.osm -o=changes2.osm

Check if your tool accepts the file changes2.osm

Offline

#3 2021-07-27 17:36:28

Ayooob
New Member
Registered: 2021-07-27
Posts: 2

Re: JOSM: how to save my edits as an ordinary osm file, not as an OSM serv

the file is converted after your command but with this warning...

d:\osm2xodr\osm2xodr - mo7yasser\OSMParser\utils.py:241: RuntimeWarning: invalid value encountered in double_scalars
  r2 = ( y1*np.cos(hdg1) + np.sin(hdg1) * (x2-x2)-y2*np.cos(hdg1)) /((np.sin(hdg2)*np.cos(hdg1) - np.sin(hdg1) *np.cos(hdg2) ))
d:\osm2xodr\osm2xodr - mo7yasser\OSMParser\utils.py:241: RuntimeWarning: divide by zero encountered in double_scalars
  r2 = ( y1*np.cos(hdg1) + np.sin(hdg1) * (x2-x2)-y2*np.cos(hdg1)) /((np.sin(hdg2)*np.cos(hdg1) - np.sin(hdg1) *np.cos(hdg2) ))
d:\osm2xodr\osm2xodr - mo7yasser\OSMParser\utils.py:247: RuntimeWarning: invalid value encountered in double_scalars
  r1 = (-y1*np.cos(hdg2)+ y2*np.cos(hdg2) + np.sin(hdg2) *x1-np.sin(hdg2) *x2 )/(np.sin(hdg1) * np.cos(hdg2) - np.sin(hdg2) *np.cos(hdg1))
d:\osm2xodr\osm2xodr - mo7yasser\OSMParser\arcCurves.py:95: RuntimeWarning: divide by zero encountered in double_scalars
  curvature = -deltaHdg / length
d:\osm2xodr\osm2xodr - mo7yasser\OSMParser\osmParsing.py:798: RuntimeWarning: invalid value encountered in double_scalars
  "steigung":(giveHeight(xendline,yendline,minRemoved=True)-giveHeight(xarc,yarc,minRemoved=True))/length,"length":length})
d:\osm2xodr\osm2xodr - mo7yasser\OSMParser\osmParsing.py:775: RuntimeWarning: invalid value encountered in double_scalars
  self.laneOffsetB = -(self.laneOffsetA-laneOffsetEnd)/length

So, the file can not be load in Roadrunner(XODR viewer) or any other viewer...

Offline

#4 2021-07-28 07:56:58

GerdP
Member
Registered: 2015-12-18
Posts: 1,525

Re: JOSM: how to save my edits as an ordinary osm file, not as an OSM serv

I suggest to contact the authors of osm2xodr. Maybe they cannot handle negative ids, maybe it's just a special case in your file.

Offline

Board footer

Powered by FluxBB