Re: [OSRM-talk] Docker pre-processing from a python script

2019-07-11 Thread Daniel Patterson via OSRM-talk
I would recommend reading up on how the `subprocess.run()` function works
in Python.  Based on the error, it looks like you need to do:

subprocess.run(["docker","run","-t","-v", "%s:/data" % os.getcwd(),
"osrm/osrm-backend", "osrm-extract", "-p", "/opt/car.lua",
"/data/berlin-latest.osm.pbf"])

Note how I split the `osrm-extract` parameter into parts in this second
version - that's what the error message is complaining about.  I don't use
python all that often, so YMMV here.

daniel

On Thu, Jul 11, 2019 at 1:31 AM Silvia Oviedo  wrote:

> Thank you for the suggestion. however I get :
>
> /usr/local/bin/docker: Error response from daemon: OCI runtime create
> failed: container_linux.go:344: starting container process caused "exec:
> \"osrm-extract -p /opt/car.lua /data/berlin-latest.osm.pbf\": stat
> osrm-extract -p /opt/car.lua /data/berlin-latest.osm.pbf: no such file or
> directory": unknown.
>
> I do have data/berlin-latest.osm.pbf in the working directory. Also, could
> you explain what "%s:/data" does exactly?
>
> Thank you
>
> El mié., 10 jul. 2019 a las 18:58, Daniel Patterson via OSRM-talk (<
> osrm-talk@openstreetmap.org>) escribió:
>
>> It'd be something like this (untested):
>>
>> subprocess.run(["docker","run","-t","-v", "%s:/data" % os.getcwd(),
>> "osrm/osrm-backend", "osrm-extract -p /opt/car.lua
>> /data/berlin-latest.osm.pbf"])
>>
>> daniel
>>
>> On Wed, Jul 10, 2019 at 7:22 AM Silvia Oviedo 
>> wrote:
>>
>>>
>>> Hi all,
>>>
>>> I would like to run the pre-process of the car profile from a python
>>> script. I have checked the documentation of subprocess library and  docker
>>> SDK for python but I don´t know how to properly make the request. For
>>> example, how could I transform the sh request:
>>>
>>> docker run -t -v "${PWD}:/data" osrm/osrm-backend osrm-extract -p 
>>> /opt/car.lua /data/berlin-latest.osm.pbf
>>>
>>> So it can be done from python. Is that possible?
>>>
>>>
>>> Thank you in advance
>>>
>>> ___
>>> OSRM-talk mailing list
>>> OSRM-talk@openstreetmap.org
>>> https://lists.openstreetmap.org/listinfo/osrm-talk
>>>
>> ___
>> OSRM-talk mailing list
>> OSRM-talk@openstreetmap.org
>> https://lists.openstreetmap.org/listinfo/osrm-talk
>>
>
>
> --
> Silvia Oviedo Castillo
> ___
> OSRM-talk mailing list
> OSRM-talk@openstreetmap.org
> https://lists.openstreetmap.org/listinfo/osrm-talk
>
___
OSRM-talk mailing list
OSRM-talk@openstreetmap.org
https://lists.openstreetmap.org/listinfo/osrm-talk


Re: [OSRM-talk] Agnostic Map Matching profile

2019-07-11 Thread André Siefken
Ah man, I have been reviewing the bike profile, didn't see the
'weight_name' parameter examples in the car.lua...

Thx for the input, and your effort! I go explore some of your suggestions...



On 7/11/19 2:09 PM, Frédéric Rodrigo wrote:
> Le 11/07/2019 à 10:42, André Siefken a écrit :
>> Thx Frédéric for the immediate reply, and sorry for me to take my time
>> to respond.
>>
>> I will rewrite the profiles to test general soft restrictions, however
>> my idea here is to have a profile that e.g. strictly uses distance
>> between possible matched waypoints to get the overall match.
>
> Yes, you can active the distance as objective in the profile
>
> https://github.com/Project-OSRM/osrm-backend/blob/master/profiles/car.lua#L19
>
>
>
>> How would the matching behave if I'd remove all road type based
>> restrictions (e.g. vehicle type allowed or not, speed limit, oneways)?
>
> To have soft restriction you must keep it with high weight.
>
>
> You can set this restricted road type into classes on profile, to
> select them dynamically on request
>
> See
>
> exclude     {class}[,{class}]     Additive list of classes to avoid,
> order does not matter.
>
> in
> https://github.com/Project-OSRM/osrm-backend/blob/master/docs/http.md#general-options
>
>
>> I do see where the algorithm needs certain base variables from the
>> network to estimate a likely route, though, and do have problems seeing
>> if this is feasonable at all, and I do ask instead of trying because it
>> will take me some time to get familiar with profile changes...
>>
>> André
>>
>> On 7/9/19 10:14 PM, Frédéric Rodrigo wrote:
>>> Le 09/07/2019 à 22:03, André Siefken a écrit :
 Hi @all,

 I'm exploring ways to have the matching algorithm work agnostic to
 (most) road restrictions and rather 'trust' the trace I pass in.

 I receive continuous GPS locations, with moderate to high
 resolution in
 time, from bikes as well as cabs or buses. It just so happens that
 some
 idiots ride their bikes on roads that OSM (and most laws) thinks they
 shouldn't, as well as some cars ignoring bus lane restrictions or
 buses
 leave their lanes. In those cases, matching fails one way or another
 ([No match], or only partial matches).

 I have a hard time wrapping my head around if a profile can actually
 fullfill restriction and/or even vehicle type (I can easily work with
 multiple graphs, though) agnostic matching, which likely implies a
 similar agnostic weighting. I imagine a shortest connection/path
 matching should do just that, but then I'm at a loss if that is
 actually
 the case and if so, how to generate such a profile.

 Your insights would be much appreciated...

 André
>>>
>>> I think the weighting is the right think to do. Use high weight on way
>>> there is no legal access. It's some kind of soft access restriction.
>>> You can even weight the opposite of a one way restriction.
>>>
>>> But you will have to rework all the samples profiles provided in OSRM.
>>>
>>>
>>> Frédéric.
>>>
>>>
>
-- 

pgp-key attached



0x0024705C4FC20AF6.asc
Description: application/pgp-keys
___
OSRM-talk mailing list
OSRM-talk@openstreetmap.org
https://lists.openstreetmap.org/listinfo/osrm-talk


Re: [OSRM-talk] Agnostic Map Matching profile

2019-07-11 Thread Frédéric Rodrigo

Le 11/07/2019 à 10:42, André Siefken a écrit :

Thx Frédéric for the immediate reply, and sorry for me to take my time
to respond.

I will rewrite the profiles to test general soft restrictions, however
my idea here is to have a profile that e.g. strictly uses distance
between possible matched waypoints to get the overall match.


Yes, you can active the distance as objective in the profile

https://github.com/Project-OSRM/osrm-backend/blob/master/profiles/car.lua#L19



How would the matching behave if I'd remove all road type based
restrictions (e.g. vehicle type allowed or not, speed limit, oneways)?


To have soft restriction you must keep it with high weight.


You can set this restricted road type into classes on profile, to select 
them dynamically on request


See

exclude     {class}[,{class}]     Additive list of classes to avoid, 
order does not matter.


in 
https://github.com/Project-OSRM/osrm-backend/blob/master/docs/http.md#general-options




I do see where the algorithm needs certain base variables from the
network to estimate a likely route, though, and do have problems seeing
if this is feasonable at all, and I do ask instead of trying because it
will take me some time to get familiar with profile changes...

André

On 7/9/19 10:14 PM, Frédéric Rodrigo wrote:

Le 09/07/2019 à 22:03, André Siefken a écrit :

Hi @all,

I'm exploring ways to have the matching algorithm work agnostic to
(most) road restrictions and rather 'trust' the trace I pass in.

I receive continuous GPS locations, with moderate to high resolution in
time, from bikes as well as cabs or buses. It just so happens that some
idiots ride their bikes on roads that OSM (and most laws) thinks they
shouldn't, as well as some cars ignoring bus lane restrictions or buses
leave their lanes. In those cases, matching fails one way or another
([No match], or only partial matches).

I have a hard time wrapping my head around if a profile can actually
fullfill restriction and/or even vehicle type (I can easily work with
multiple graphs, though) agnostic matching, which likely implies a
similar agnostic weighting. I imagine a shortest connection/path
matching should do just that, but then I'm at a loss if that is actually
the case and if so, how to generate such a profile.

Your insights would be much appreciated...

André


I think the weighting is the right think to do. Use high weight on way
there is no legal access. It's some kind of soft access restriction.
You can even weight the opposite of a one way restriction.

But you will have to rework all the samples profiles provided in OSRM.


Frédéric.





___
OSRM-talk mailing list
OSRM-talk@openstreetmap.org
https://lists.openstreetmap.org/listinfo/osrm-talk


Re: [OSRM-talk] Agnostic Map Matching profile

2019-07-11 Thread Mohamad Jarwan
I have many problems on installing nominatim
can anyone help me to install nominatim on Linux server

i can give him server IP and username,password

thanks

On Thu, Jul 11, 2019 at 11:44 AM André Siefken  wrote:

> Thx Frédéric for the immediate reply, and sorry for me to take my time
> to respond.
>
> I will rewrite the profiles to test general soft restrictions, however
> my idea here is to have a profile that e.g. strictly uses distance
> between possible matched waypoints to get the overall match.
>
> How would the matching behave if I'd remove all road type based
> restrictions (e.g. vehicle type allowed or not, speed limit, oneways)?
>
> I do see where the algorithm needs certain base variables from the
> network to estimate a likely route, though, and do have problems seeing
> if this is feasonable at all, and I do ask instead of trying because it
> will take me some time to get familiar with profile changes...
>
> André
>
> On 7/9/19 10:14 PM, Frédéric Rodrigo wrote:
> > Le 09/07/2019 à 22:03, André Siefken a écrit :
> >> Hi @all,
> >>
> >> I'm exploring ways to have the matching algorithm work agnostic to
> >> (most) road restrictions and rather 'trust' the trace I pass in.
> >>
> >> I receive continuous GPS locations, with moderate to high resolution in
> >> time, from bikes as well as cabs or buses. It just so happens that some
> >> idiots ride their bikes on roads that OSM (and most laws) thinks they
> >> shouldn't, as well as some cars ignoring bus lane restrictions or buses
> >> leave their lanes. In those cases, matching fails one way or another
> >> ([No match], or only partial matches).
> >>
> >> I have a hard time wrapping my head around if a profile can actually
> >> fullfill restriction and/or even vehicle type (I can easily work with
> >> multiple graphs, though) agnostic matching, which likely implies a
> >> similar agnostic weighting. I imagine a shortest connection/path
> >> matching should do just that, but then I'm at a loss if that is actually
> >> the case and if so, how to generate such a profile.
> >>
> >> Your insights would be much appreciated...
> >>
> >> André
> >
> >
> > I think the weighting is the right think to do. Use high weight on way
> > there is no legal access. It's some kind of soft access restriction.
> > You can even weight the opposite of a one way restriction.
> >
> > But you will have to rework all the samples profiles provided in OSRM.
> >
> >
> > Frédéric.
> >
> >
> --
>
> pgp-key attached
>
> ___
> OSRM-talk mailing list
> OSRM-talk@openstreetmap.org
> https://lists.openstreetmap.org/listinfo/osrm-talk
>
___
OSRM-talk mailing list
OSRM-talk@openstreetmap.org
https://lists.openstreetmap.org/listinfo/osrm-talk


Re: [OSRM-talk] Agnostic Map Matching profile

2019-07-11 Thread André Siefken
Thx Frédéric for the immediate reply, and sorry for me to take my time
to respond.

I will rewrite the profiles to test general soft restrictions, however
my idea here is to have a profile that e.g. strictly uses distance
between possible matched waypoints to get the overall match.

How would the matching behave if I'd remove all road type based
restrictions (e.g. vehicle type allowed or not, speed limit, oneways)?

I do see where the algorithm needs certain base variables from the
network to estimate a likely route, though, and do have problems seeing
if this is feasonable at all, and I do ask instead of trying because it
will take me some time to get familiar with profile changes...

André

On 7/9/19 10:14 PM, Frédéric Rodrigo wrote:
> Le 09/07/2019 à 22:03, André Siefken a écrit :
>> Hi @all,
>>
>> I'm exploring ways to have the matching algorithm work agnostic to
>> (most) road restrictions and rather 'trust' the trace I pass in.
>>
>> I receive continuous GPS locations, with moderate to high resolution in
>> time, from bikes as well as cabs or buses. It just so happens that some
>> idiots ride their bikes on roads that OSM (and most laws) thinks they
>> shouldn't, as well as some cars ignoring bus lane restrictions or buses
>> leave their lanes. In those cases, matching fails one way or another
>> ([No match], or only partial matches).
>>
>> I have a hard time wrapping my head around if a profile can actually
>> fullfill restriction and/or even vehicle type (I can easily work with
>> multiple graphs, though) agnostic matching, which likely implies a
>> similar agnostic weighting. I imagine a shortest connection/path
>> matching should do just that, but then I'm at a loss if that is actually
>> the case and if so, how to generate such a profile.
>>
>> Your insights would be much appreciated...
>>
>> André
>
>
> I think the weighting is the right think to do. Use high weight on way
> there is no legal access. It's some kind of soft access restriction.
> You can even weight the opposite of a one way restriction.
>
> But you will have to rework all the samples profiles provided in OSRM.
>
>
> Frédéric.
>
>
-- 

pgp-key attached



0x0024705C4FC20AF6.asc
Description: application/pgp-keys
___
OSRM-talk mailing list
OSRM-talk@openstreetmap.org
https://lists.openstreetmap.org/listinfo/osrm-talk


Re: [OSRM-talk] Docker pre-processing from a python script

2019-07-11 Thread Silvia Oviedo
Thank you for the suggestion. however I get :

/usr/local/bin/docker: Error response from daemon: OCI runtime create
failed: container_linux.go:344: starting container process caused "exec:
\"osrm-extract -p /opt/car.lua /data/berlin-latest.osm.pbf\": stat
osrm-extract -p /opt/car.lua /data/berlin-latest.osm.pbf: no such file or
directory": unknown.

I do have data/berlin-latest.osm.pbf in the working directory. Also, could
you explain what "%s:/data" does exactly?

Thank you

El mié., 10 jul. 2019 a las 18:58, Daniel Patterson via OSRM-talk (<
osrm-talk@openstreetmap.org>) escribió:

> It'd be something like this (untested):
>
> subprocess.run(["docker","run","-t","-v", "%s:/data" % os.getcwd(),
> "osrm/osrm-backend", "osrm-extract -p /opt/car.lua
> /data/berlin-latest.osm.pbf"])
>
> daniel
>
> On Wed, Jul 10, 2019 at 7:22 AM Silvia Oviedo 
> wrote:
>
>>
>> Hi all,
>>
>> I would like to run the pre-process of the car profile from a python
>> script. I have checked the documentation of subprocess library and  docker
>> SDK for python but I don´t know how to properly make the request. For
>> example, how could I transform the sh request:
>>
>> docker run -t -v "${PWD}:/data" osrm/osrm-backend osrm-extract -p 
>> /opt/car.lua /data/berlin-latest.osm.pbf
>>
>> So it can be done from python. Is that possible?
>>
>>
>> Thank you in advance
>>
>> ___
>> OSRM-talk mailing list
>> OSRM-talk@openstreetmap.org
>> https://lists.openstreetmap.org/listinfo/osrm-talk
>>
> ___
> OSRM-talk mailing list
> OSRM-talk@openstreetmap.org
> https://lists.openstreetmap.org/listinfo/osrm-talk
>


-- 
Silvia Oviedo Castillo
___
OSRM-talk mailing list
OSRM-talk@openstreetmap.org
https://lists.openstreetmap.org/listinfo/osrm-talk