(Since I'm not certain that this got through I'm resending. If it did,
please forgive me)

Hi all,

I need help with an unusual query (at least for me :] )

The objective is to find road segments with a type defined to tunnel
within a given distance.
This is needed because of gps signal spikes (speed-wise) at tunnel
exits...

Now given the following scenario of road segments:


=====*-----------------*==========
====V===*========================*
*======

=====*-----------------*==========
                    |
                    |
                    |
                    |
                    |
                    |
                    |
                    |
                    |
                    |
==========-----------------------=======================

= | road
- tunnel
* nodes
V vehicle

Now when I execute a distance-based query (for road segments of tunnel
type) I get the lower tunnel, which is closer.
But I want the upper one which is actually the one on the top.

the actual query is as follows (tunnels (road type=67) within a 150
metres radius) -- the road map is in WGS84:
SELECT name, road_type FROM $road_net WHERE 
transform(geometry,$srid) &&
setsrid(expand(transform(geomfromtext('POINT($lon $lat)',4326),
$srid),150),$srid) 
AND distance(transform(geomfromtext('POINT($lon $lat)',4326),$srid),
transform(geometry,$srid)) <=150 AND road_type=67;

Already thankful for any tips,

-- 
Pedro Doria Meunier <[EMAIL PROTECTED]>
_______________________________________________
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users

Reply via email to