JuPedSim / jpsreport

Analysis tool
https://www.jupedsim.org/jpsreport_introduction.html
Other
3 stars 9 forks source link

path relative to inifile #115

Closed chraibi closed 5 years ago

chraibi commented 5 years ago

In Gitlab by @chraibi on Jan 31, 2016, 09:48 [origin]

Path to geometry and trajectory file should be relative to the inifile path.

Example inifile:

 <geometry file = "router_goal_geo.xml" />
 <trajectories format="xml" unit="m">
 <file name="router_goal_traj.xml" />
 </trajectories>

calling jpsreport:

./bin/jpsreport Issue44/report_fehler/fps2/ini.xml

leads to the error:

ERROR:   could not parse the trajectories file <././router_goal_traj.xml>
chraibi commented 5 years ago

In Gitlab by @chraibi on Dec 17, 2016, 08:20

closed

chraibi commented 5 years ago

In Gitlab by @chraibi on Dec 17, 2016, 08:20

Original comment by zhang on 31 Jan 2016, 13:58


@chraibi the path was already relative to the inifile. But you have to assign the location of the trajectory file.please uncomment the path in the inifile.

<trajectories format="xml" unit="m">
    <file name="router_goal_traj.xml" />
    <path location="./"/>  
</trajectories>
chraibi commented 5 years ago

In Gitlab by @chraibi on Dec 17, 2016, 08:20

Original comment by chraibi on 31 Jan 2016, 15:36


Yes if I specify explicitly the path location it works.

But I was wondering why is this necessary.

The geometry file was parsed without problems, even if the location is not specified.

chraibi commented 5 years ago

In Gitlab by @chraibi on Dec 17, 2016, 08:20

Original comment by zhang on 31 Jan 2016, 15:49


sometimes trajectory files are not put in the same location. So 'trajectories' is given two options and both of them are used for parsing. Do you think the default case is current location would be better?

chraibi commented 5 years ago

In Gitlab by @chraibi on Dec 17, 2016, 08:20

Original comment by chraibi on 01 Feb 2016, 08:15


I see. In my opinion the default location should be the inifile location. That works also like this in jpscore. If you don't specify explicitly the location then it is fine. If not, then it is relative to the inifile.

chraibi commented 5 years ago

In Gitlab by @chraibi on Dec 17, 2016, 08:20

Original comment by zhang on 01 Feb 2016, 11:50


I change the code and now it works.