I'm inserting map data from a GML file with srid EPSG:27700 into a PostGIS database table with srid EPSG:4326. I'm using the ST_Transform function as in this snippet:
ST_Transform(ST_GeomFromGML('<gml:Point srsName="EPSG:27700"> <gml:coordinates>527347.0,181346.0</gml:coordinates></gml:Point>'), 4326);
After the data was inserted in the database I tried to find if its geometry intersects with an existing table's geometry using the ST_Intersects function. The function returned FALSE in all cases, but I knew that the two geometry layers should intersect.
So, I loaded the layers in QuantumGIS to see what's happening. The PostGIS layers indeed don't intersect, but when I loaded the GML data directly from the GML file using the original srid (EPSG:27700) the map data correctly appeared on top of the pre-existing layer with srid 4326, with which I knew it should intersect. The problem is that the ST_Intersects function (as well as all the others of the same kind) works only for geometries with the same srid, so I need to solve the transformation issue.
Apparently there's either a problem with the ST_Transform function, or I'm missing something that I should know. I use PostGIS 1.5.3. Any help will be greatly appreciated.