Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] Routes from counting data

Hi Fereshte,

 

as you may have noticed already, this error is closely related to the projection. It originates from an external library (PROJ) we use in SUMO for this purpose. I don't know what is going on here. Does projection inside SUMO work in other conditions on your device (e.g. reproject a network with netconvert)? Could you maybe try yourself some other projections to see whether it is related to the chosen projection definition?

 

Best regards

Mirko

 

 

 

-----Original-Nachricht-----

Betreff: Re: [sumo-user] Routes from counting data

Datum: 2023-11-06T16:21:29+0100

Von: "fereshte jafari" <j.fereshte1993@xxxxxxxxx>

An: "Mirko Barthauer" <m.barthauer@xxxxxxxxxxx>, "Sumo project User discussions" <sumo-user@xxxxxxxxxxx>

 

 

 

Dear Mirko,
 
Thanks for the guidance and support.
 
 Unfortunately, I still could not reach the detectors additional file because of the below error.
Your guidance will be highly appreciated.
 
 
Traceback (most recent call last):
  File "C:\Program Files (x86)\Eclipse\Sumo\tools\sumolib\net\__init__.py", line 451, in getGeoProj
    self._proj = pyproj.Proj(projparams=self._location["projParameter"])
  File "C:\Program Files\Python39\lib\site-packages\pyproj\proj.py", line 134, in __init__
    super().__init__(TransformerFromPipeline(cstrencode(self.srs)))
  File "C:\Program Files\Python39\lib\site-packages\pyproj\transformer.py", line 337, in __init__
    self._local.transformer = transformer_maker()
  File "C:\Program Files\Python39\lib\site-packages\pyproj\transformer.py", line 134, in __call__
    return _Transformer.from_pipeline(self.proj_pipeline)
  File "pyproj\\_transformer.pyx", line 632, in pyproj._transformer._Transformer.from_pipeline
pyproj.exceptions.ProjError: Invalid projection +proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy +nadgrids=OSTN15_NTv2_OSGBtoETRS.gsb +units=m +no_defs.: (Internal Proj Error: proj_create: Error 1029 (File not found or invalid): hgridshift: could not find required grid(s).)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Program Files (x86)\Eclipse\sumo-git\tools\detector\mapDetectors.py", line 110, in <module>
    main()
  File "C:\Program Files (x86)\Eclipse\sumo-git\tools\detector\mapDetectors.py", line 88, in main
    x, y = net.convertLonLat2XY(lon, lat)
  File "C:\Program Files (x86)\Eclipse\Sumo\tools\sumolib\net\__init__.py", line 468, in convertLonLat2XY
    x, y = self.getGeoProj()(lon, lat)
  File "C:\Program Files (x86)\Eclipse\Sumo\tools\sumolib\net\__init__.py", line 455, in getGeoProj
    self._proj = pyproj.Proj(projparams=self._location["projParameter"])
  File "C:\Program Files\Python39\lib\site-packages\pyproj\proj.py", line 134, in __init__
    super().__init__(TransformerFromPipeline(cstrencode(self.srs)))
  File "C:\Program Files\Python39\lib\site-packages\pyproj\transformer.py", line 337, in __init__
    self._local.transformer = transformer_maker()
  File "C:\Program Files\Python39\lib\site-packages\pyproj\transformer.py", line 134, in __call__
    return _Transformer.from_pipeline(self.proj_pipeline)
  File "pyproj\\_transformer.pyx", line 632, in pyproj._transformer._Transformer.from_pipeline
pyproj.exceptions.ProjError: Invalid projection +proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy +nadgrids=OSTN15_NTv2_OSGBtoETRS.gsb +units=m +no_defs.: (Internal Proj Error: proj_create: Error 1029 (File not found or invalid): hgridshift: could not find required grid(s).)
 
Regards,
Fereshteh

On Thu, Nov 2, 2023 at 4:39 PM Mirko Barthauer <m.barthauer@xxxxxxxxxxx> wrote:

Dear Fereshte,

 

I updated the example in the documentation. The numbers you mentioned are not used and thus have been removed. I can imagine it was meant as a search radius which finally was not implemented. Do you have your system configured to invoke python automatically when typing a python file name in the console? Otherwise prepend "python" to the command.

 

Best regards

Mirko

 

 

 

-----Original-Nachricht-----

Betreff: Re: [sumo-user] Routes from counting data

Datum: 2023-11-02T15:23:02+0100

Von: "fereshte jafari" <j.fereshte1993@xxxxxxxxx>

An: "Mirko Barthauer" <m.barthauer@xxxxxxxxxxx>

 

 

 

Kind reminder




On Thu, Oct 26, 2023 at 5:09 PM fereshte jafari <j.fereshte1993@xxxxxxxxx> wrote:
Dear Mirko,
 
I installed the required module following your instructions but my problem is not solved yet!
When I run the command it does not give me neither error nor output. Just the "mapDetectors" python file opens up!
 
The command is:
mapDetectors.py -n "D:\Users\Fereshteh.V6\UK\Traffic Network\road.network.of.the.NorthEast\mySUMOnetwork.net.xml" -d "D:\Users\Fereshteh.V6\UK\Traffic counts\Detectors.csv" -o "D:\Users\Fereshteh.V6\UK\Traffic counts\Detectors.add.xml"
 
Any ideas?
 
Another question is about the example of this matter located at SUMO_HOME/tools/detector/mapDetectors.py. What are the last numbers (1000, 500)? Are they the number of  vehicles that drove over the detector? What if I want to give the number of passenger and transport vehicles separately? How should I name them?
 
Regards,
Fereshteh

On Thu, Oct 19, 2023 at 4:50 PM Mirko Barthauer <m.barthauer@xxxxxxxxxxx> wrote:

Hi Fereshte,

 

this is a separate python module you have to install. You can make use of our $SUMO_HOME/tools/requirements.txt file together with pip utility to get the right version (and other modules needed in python tools shipped with SUMO). Usage / installation is explained here on the official Python web site.

 

Best regards

Mirko

 

 

 

 

-----Original-Nachricht-----

Betreff: Re: [sumo-user] Routes from counting data

Datum: 2023-10-19T16:50:15+0200

Von: "fereshte jafari" <j.fereshte1993@xxxxxxxxx>

An: "Mirko Barthauer" <m.barthauer@xxxxxxxxxxx>

 

 

 

Dear Mikro,
 
I changed the projParameter. Now the error is like this:
 
Traceback (most recent call last):
  File "C:\Program Files (x86)\Eclipse\2023.10\tools\detector\mapDetectors.py", line 109, in <module>
    main()
  File "C:\Program Files (x86)\Eclipse\2023.10\tools\detector\mapDetectors.py", line 87, in main
    x, y = net.convertLonLat2XY(lon, lat)
  File "C:\Program Files (x86)\Eclipse\Sumo\tools\sumolib\net\__init__.py", line 468, in convertLonLat2XY
    x, y = self.getGeoProj()(lon, lat)
  File "C:\Program Files (x86)\Eclipse\Sumo\tools\sumolib\net\__init__.py", line 449, in getGeoProj
    import pyproj
ModuleNotFoundError: No module named 'pyproj'
 
regards,
Fereshteh
 
 

On Wed, Oct 18, 2023 at 8:51 AM Mirko Barthauer <m.barthauer@xxxxxxxxxxx> wrote:

Dear Fereshte,

 

Sorry for the bit short-sighted answer last time. A projParameter value of "!" actually means there is no projection defined. In order to map detectors with a geographic coordinate one has to know the target projection, too. Our MATSim importer doesn't read their projection info yet.

What happens if you change the projParameter to "+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy +nadgrids=OSTN15_NTv2_OSGBtoETRS.gsb +units=m +no_defs +type=crs" (which corresponds to the EPSG:27700 value from your MATSim file)?

 

Best regards

Mirko

 

 

 

-----Original-Nachricht-----

Betreff: Re: [sumo-user] Routes from counting data

Datum: 2023-10-17T16:19:10+0200

Von: "fereshte jafari" <j.fereshte1993@xxxxxxxxx>

An: "Mirko Barthauer" <m.barthauer@xxxxxxxxxxx>, "Sumo project User discussions" <sumo-user@xxxxxxxxxxx>

 

 

 

Dear Mirko,
 
Now my network file contains a location tag and a projParameter attribute, exactly like what you shared with me. But still the script loacted at SUMO_HOME/tools/detector/mapDetectors.py for reading the "latitude" and "longitude" of detectors and locating the detectors on the network does not work and I faced the below error message:
 
Traceback (most recent call last):
  File "C:\Program Files (x86)\Eclipse\2023.10\tools\detector\mapDetectors.py", line 109, in <module>
    main()
  File "C:\Program Files (x86)\Eclipse\2023.10\tools\detector\mapDetectors.py", line 87, in main
    x, y = net.convertLonLat2XY(lon, lat)
  File "C:\Program Files (x86)\Eclipse\Sumo\tools\sumolib\net\__init__.py", line 468, in convertLonLat2XY
    x, y = self.getGeoProj()(lon, lat)
  File "C:\Program Files (x86)\Eclipse\Sumo\tools\sumolib\net\__init__.py", line 447, in getGeoProj
    raise RuntimeError("Network does not provide geo-projection")
RuntimeError: Network does not provide geo-projection
 
 
Any ideas?
 
Regards,
Fereshteh

On Thu, Sep 21, 2023 at 7:53 AM Mirko Barthauer <m.barthauer@xxxxxxxxxxx> wrote:

Dear Fereshte,

 

the file is very large and as such not easy to share. Probably it is enough to place the right location tag in it. Mine looks like this:

 

<location netOffset="-358612.77,-508349.09" convBoundary="0.00,0.00,123689.54,148017.81" origBoundary="358612.77,508349.09,482302.31,656366.81" projParameter="!"/>

 

Best regards

Mirko

 

 

 

 

-----Original-Nachricht-----

Betreff: Re: [sumo-user] Routes from counting data

Datum: 2023-09-20T18:32:36+0200

Von: "fereshte jafari" <j.fereshte1993@xxxxxxxxx>

An: "Mirko Barthauer" <m.barthauer@xxxxxxxxxxx>

 

 

 

Dear Mirko,
 
Thanks for your response. 
I would be thankful if you could share the converted network including the location tag with projParameter attribute with me. Then I will see if the script located at SUMO_HOME/tools/detector/mapDetectors.py works with this network or not.
 
Regards,
Fereshteh

On Fri, Sep 15, 2023 at 1:22 PM Mirko Barthauer <m.barthauer@xxxxxxxxxxx> wrote:

Dear Fereshte,

 

I get a location tag with projParameter attribute when converting to a SUMO network in v.1.18.0. Not sure what caused the problem on your side?

 

Best regards

Mirko

 

On Tue, Sep 12, 2023 at 4:12 PM fereshte jafari <j.fereshte1993@xxxxxxxxx> wrote:
Dear Mirko,
 
I am using the latest version of sumo: 
 
#define VERSION_STRING "v1_18_0+0000-03ecfdea036"

Please find enclosed the MATsim file. And the command that I used to convert the network is below:
 
netconvert --matsim Matsim.network.xml -o mySUMOnetwork.net.xml  --xml-validation never
 
Thanks for your time and guidance.
 
Regards,
Fereshteh

On Tue, Sep 12, 2023 at 2:45 PM Mirko Barthauer <m.barthauer@xxxxxxxxxxx> wrote:

Dear Feresteh,

 

did you use the latest SUMO version 1.18.0 or an older one? If you used an older one, could you please check if the projParameter attribute is still missing when converting the MATSim network to SUMO in v. 1.18.0? And if you already use the latest version, could you provide the MATsim file together with the netconvert command to let us check?

 

Best regards

Mirko

 

 

 

-----Original-Nachricht-----

Betreff: Re: [sumo-user] Routes from counting data

Datum: 2023-09-12T10:39:38+0200

Von: "fereshte jafari" <j.fereshte1993@xxxxxxxxx>

An: "Mirko Barthauer" <m.barthauer@xxxxxxxxxxx>

 

 

 

Dear Mirko,
 
Thanks for your reply.
Actually, my network was edited by Matsim first but then I converted it to a SUMO network using the "netconvert" command.
Yes, there is a "location" tag in my network file. Please see the image below. But it does not contain  the "projParameter" attribute.
 
Screenshot 2023-09-12 at 09.36.57.png
 
Regards,
Fereshteh

On Mon, Sep 11, 2023 at 3:00 PM Mirko Barthauer <m.barthauer@xxxxxxxxxxx> wrote:

This looks like your network file does not contain a location tag (which is obligatory by nowadays standards and should be written when generated with netedit/netconvert).

  • Is there a location tag?
  • Does it contain a projParameter attribute?
  • If not, how did you create the network? Did you edit it outside of netedit/netconvert?

Best regards

Mirko

 

 

 

-----Original-Nachricht-----

Betreff: Re: [sumo-user] Routes from counting data

Datum: 2023-09-04T12:11:24+0200

Von: "fereshte jafari via sumo-user" <sumo-user@xxxxxxxxxxx>

 

 

 

Thanks for your guidance.
I followed Jan's suggestion but faced the below error message. Any ideas?
 
 

Traceback (most recent call last):

  File "C:\Program Files (x86)\Eclipse\Sumo\tools\detector\mapDetectors.py", line 110, in <module>

    main()

  File "C:\Program Files (x86)\Eclipse\Sumo\tools\detector\mapDetectors.py", line 88, in main

    x, y = net.convertLonLat2XY(lon, lat)

  File "C:\Program Files (x86)\Eclipse\Sumo\tools\sumolib\net\__init__.py", line 468, in convertLonLat2XY

    x, y = self.getGeoProj()(lon, lat)

  File "C:\Program Files (x86)\Eclipse\Sumo\tools\sumolib\net\__init__.py", line 446, in getGeoProj

    if not self.hasGeoProj():

  File "C:\Program Files (x86)\Eclipse\Sumo\tools\sumolib\net\__init__.py", line 442, in hasGeoProj

    projString = self._location["projParameter"]

KeyError: 'projParameter'

 
Thanks in advance.
 
Regards,
Fereshteh


On Mon, Jul 17, 2023 at 8:08 AM Mirko Barthauer <m.barthauer@xxxxxxxxxxx> wrote:

Please just follow the suggestion of Jan to use the script loacted at SUMO_HOME/tools/detector/mapDetectors.py . It uses the general process I have outlined before.

 

Best regards

Mirko

 

 

-----Original-Nachricht-----

Betreff: Re: [sumo-user] Routes from counting data

Datum: 2023-07-14T16:04:28+0200

Von: "fereshte jafari via sumo-user" <sumo-user@xxxxxxxxxxx>

An: "Sumo project User discussions" <sumo-user@xxxxxxxxxxx>

 

 

 

Dear Mirko,
 
Thanks for your response.
My network is a very large network with a high number of detectors. Is it possible to obtain the lane and position of all detectors at once instead of one by one?

Regards,
Fereshteh


On Thu, Jul 13, 2023 at 3:32 PM fereshte jafari <j.fereshte1993@xxxxxxxxx> wrote:
Hello!
 
I have a question regarding the detector file.
As it is mentioned in https://sumo.dlr.de/docs/Demand/Routes_from_Observation_Points.html, SUMO requires the position of the detector on the lane to be expressed in meters. Specifically, the position should fall within the range of -1*lane's length to the lane's length. What I have in my database of detectors is the "latitude" and "longitude" of detectors. I wanted to know whether SUMO can read the "latitude" and "longitude" of detectors and locate the detectors on the network or not. If yes, could you please guide me on how to insert this information in the detector file?
 
Thanks in advance.
 
--
Sincerely,
Fereshteh Jafari Shahdani
PhD candidate, Dep. of Civil Engineering
ISISE - University of Minho

 
--
Sincerely,
Fereshteh Jafari Shahdani
PhD candidate, Dep. of Civil Engineering
ISISE - University of Minho

 
--
Sincerely,
Fereshteh Jafari Shahdani
PhD candidate, Dep. of Civil Engineering
ISISE - University of Minho


--
Sincerely,
Fereshteh Jafari Shahdani
PhD candidate, Dep. of Civil Engineering
ISISE - University of Minho

 
--
Sincerely,
Fereshteh Jafari Shahdani
PhD candidate, Dep. of Civil Engineering
ISISE - University of Minho

 
--
Sincerely,
Fereshteh Jafari Shahdani
PhD candidate, Dep. of Civil Engineering
ISISE - University of Minho

 
--
Sincerely,
Fereshteh Jafari Shahdani
PhD candidate, Dep. of Civil Engineering
ISISE - University of Minho

 



--
Sincerely,
Fereshteh Jafari Shahdani
PhD candidate, Dep. of Civil Engineering
ISISE - University of Minho


--
Sincerely,
Fereshteh Jafari Shahdani
PhD candidate, Dep. of Civil Engineering
ISISE - University of Minho

 



--
Sincerely,
Fereshteh Jafari Shahdani
PhD candidate, Dep. of Civil Engineering
ISISE - University of Minho

 
--
Sincerely,
Fereshteh Jafari Shahdani
PhD candidate, Dep. of Civil Engineering
ISISE - University of Minho


--
Sincerely,
Fereshteh Jafari Shahdani
PhD candidate, Dep. of Civil Engineering
ISISE - University of Minho


Back to the top