A system comprising an apparatus and a vehicle location and motion database; the vehicle location and motion database comprising a vehicular database and a grid location database; the apparatus comprising: means for receiving sensor data from at least one motion sensor (201, 202) associated with a selected vehicle from a plurality of vehicles, said sensor data indicating movements of the vehicle in a geographical area; means for obtaining from the sensor data location of the vehicle in the geographical area; means for obtaining time data related to the moment of capturing the motion data and the location data; means for maintaining the vehicle location and motion database; wherein the vehicle location and motion database comprises at least three grid layers of grid cells representing at least a part of the geographical area, said grid cells of the at least three grid layers being partly overlapping so that borders of the grid cells of different grid layers have an offset between each other; wherein the apparatus further comprises: means for mapping the location of the vehicle to a grid cell of each grid layer into which the location of the vehicle belongs; means for inserting or maintaining an identifier of the vehicle in a list of vehicle identifiers for the mapped grid cell of each grid layer; and means for determining on the basis of the identifiers of the vehicles in the lists and the time data which other vehicles are in a proximity of said selected vehicle. the vehicle location and motion database comprising a vehicular database and a grid location database; the apparatus comprising: means for receiving sensor data from at least one motion sensor (201, 202) associated with a selected vehicle from a plurality of vehicles, said sensor data indicating movements of the vehicle in a geographical area; means for obtaining from the sensor data location of the vehicle in the geographical area; means for obtaining time data related to the moment of capturing the motion data and the location data; means for maintaining the vehicle location and motion database; wherein the vehicle location and motion database comprises at least three grid layers of grid cells representing at least a part of the geographical area, said grid cells of the at least three grid layers being partly overlapping so that borders of the grid cells of different grid layers have an offset between each other; means for receiving sensor data from at least one motion sensor (201, 202) associated with a selected vehicle from a plurality of vehicles, said sensor data indicating movements of the vehicle in a geographical area; means for obtaining from the sensor data location of the vehicle in the geographical area; means for obtaining time data related to the moment of capturing the motion data and the location data; means for maintaining the vehicle location and motion database; wherein the vehicle location and motion database comprises at least three grid layers of grid cells representing at least a part of the geographical area, said grid cells of the at least three grid layers being partly overlapping so that borders of the grid cells of different grid layers have an offset between each other; wherein the apparatus further comprises: means for mapping the location of the vehicle to a grid cell of each grid layer into which the location of the vehicle belongs; means for inserting or maintaining an identifier of the vehicle in a list of vehicle identifiers for the mapped grid cell of each grid layer; and means for determining on the basis of the identifiers of the vehicles in the lists and the time data which other vehicles are in a proximity of said selected vehicle. means for mapping the location of the vehicle to a grid cell of each grid layer into which the location of the vehicle belongs; means for inserting or maintaining an identifier of the vehicle in a list of vehicle identifiers for the mapped grid cell of each grid layer; and means for determining on the basis of the identifiers of the vehicles in the lists and the time data which other vehicles are in a proximity of said selected vehicle.