I've created a PostGIS database of bus stops and train stations (from the gtfs file of two transit authority -- CITLA is the bus and AMT_Trains is... well, the train).
I've created a 200 meters buffer around each train station and tried to select each bus stop that intersects those buffers :
CREATE TABLE citla.stop_stations AS SELECT citla.stops.stop_id AS cit_stop_id, amt_trains.stops.stop_id AS amt_stop_id, citla.stops.the_geom AS the_geom FROM amt_trains.stops, citla.stops WHERE ST_Intersects(amt_trains.stops.the_geom, citla.stops.the_geom);
In this screenshot,
we see that the buffers (the grey circles) are correct (I'm telling you, they are at the right place... I've just removed the train stations symbol for clarity).
The red dots are bus stops. The bigger blue dots are intersecting point (results from a spatial selection in QGIS). The single yellow dot is the PostGIS query result. It's just a sample, but only 6 of the supposed bus stops are selected.
I tried with
WHERE ST_Contains(amt_trains.stops.the_geom, citla.stops.the_geom);
but I have the exact same results.
I'm new to PostGIS and I'm stuck. Any ideas?