I've written a nearRoads function and it works quite well. It compares all object names returned by nearestObjects with a list of road object names. The road object names where extracted from the README that came with BIS' environment sample models. Maybe the function can serve you as a basis for a nearTrees function:
#define ROAD_NAMES ["SILNICE_MESTO_6.P3D","SILNICE_MESTO_LP_6.P3D","SILNICE_MESTO_T_12.P3D","SILNICE_MESTO_X_12.P3D","SILNICE_MESTO_PREDX_6.P3D","SILNICE_MESTO_ZJZ.P3D","SILNICE_MESTO_ZVS.P3D","SILNICE_MESTO_ZZJ.P3D","SILNICE_MESTO_ZZS.P3D","ASF10 100.P3D","ASF10 25.P3D","ASF10 50.P3D","ASF10 75.P3D","ASF12.P3D","ASF25.P3D","ASF6.P3D","ASF6_PRECHOD.P3D","ASF6KONEC.P3D","CES10 100.P3D","CES10 25.P3D","CES10 50.P3D","CES10 75.P3D","CES12.P3D","CES25.P3D","CES6.P3D","CES6KONEC.P3D","CES_D10 100.P3D","CES_D10 25.P3D","CES_D10 50.P3D","CES_D10 75.P3D","CES_D12.P3D","CES_D25.P3D","CES_D6.P3D","CES_D6KONEC.P3D","KOS10 100.P3D","KOS10 25.P3D","KOS10 50.P3D","KOS10 75.P3D","KOS12.P3D","KOS25.P3D","KOS6.P3D","KOS6KONEC.P3D","KR_ASFALTKA_ASFALTKA_T.P3D","KR_ASFALTKA_CESTA_T.P3D","KR_ASFALTKA_SIL_T.P3D","KR_NEW_ASF_ASF_T.P3D","KR_NEW_ASF_CES_T.P3D","KR_NEW_ASF_SIL_T.P3D","KR_NEW_KOS.P3D","KR_NEW_KOS_KOS_T.P3D","KR_NEW_KOS_SIL_T.P3D","KR_NEW_SIL_ASF_T.P3D","KR_NEW_SIL_CES_T.P3D","KR_NEW_SIL_KOS_T.P3D","KR_NEW_SIL_SIL_T.P3D","KR_NEW_SIL_SIL_T_TEST.P3D","KR_NEW_SILXSIL.P3D","KR_SILNICE_ASFALTKA_T.P3D","KR_SILNICE_CESTA_T.P3D","KR_SILNICE_SILNICE_T.P3D","KR_SILNICEXSILNICE.P3D","SIL10 100.P3D","SIL10 25.P3D","SIL10 50.P3D","SIL10 75.P3D","SIL12.P3D","SIL25.P3D","SIL6.P3D","SIL6_PRECHOD.P3D","SIL6KONEC.P3D"]
#define ASCII_COLON 58
fn_nearRoads = {
// This function returns an array of road objects
private ["_position", "_radius", "_roads", "_objects", "_objInfo", "_lenInfo", "_objName", "_i"];
_position = _this select 0; // can also be an object
_radius = _this select 1;
assert (_radius <= 100); // 100m should be enough
if (typeName _position == "OBJECT") then { _position = getPos _position };
_roads = [];
_objects = [];
// find all near objects but keep only those of unknown type
{
if ("" == typeOf _x) then { _objects = _objects + [_x] };
} forEach nearestObjects [_position, [], _radius];
{
// _x is something like "5150: ces_d10 100.p3d"
_objInfo = toArray(str(_x));
_lenInfo = count _objInfo - 1;
_objName = [];
_i = 0;
// determine where the object name starts
{
if (ASCII_COLON == _objInfo select _i) exitWith {};
_i = _i + 1;
} forEach _objInfo;
_i = _i + 2; // skip the ": " part
for "_k" from _i to _lenInfo do {
_objName = _objName + [_objInfo select _k];
};
// To stick with the example above: _objName now contains "ces_d10 100.p3d"
_objName = toUpper(toString(_objName));
if (_objName in ROAD_NAMES) then { _roads = _roads + [_x] };
} forEach _objects;
_roads; // return value
}; // fn_nearRoads
Beware: I've replaced some variables names to make it more readable and did not test if afterwards.