[pgrouting-users] How to join Two points (latitudes and langitudes) in postgis?

SIDDHESH GANDHI siddheshgandhi at gmail.com
Tue Mar 2 14:28:23 EST 2010


Hi all,
I am trying to join 2 points on earth (SRID 4326) by a line but somehow I m
not able to see that in QGIS.

I have taken some latitudes and longitudes and created points. When I create
POINT column and load these points, I can see them on QGIS at exact same
locations. (Boston, MA will be at same position where it is now wrt MA state
shapefile)

Now when i try to join two points (E.g. Boston and Some other place in MA),
it does not appear on QGIS.

I tried following queries for linestring construction -
1) insert into sridline (the_geom) values
(ST_setSRID(ST_MakeLine(ST_MakePoint(42.5667212,
-70.987212),ST_MakePoint(44.5667212, -70.987212)),4326));
Other thing I tried is :
2)  insert into sridline (the_geom) values
(GeomFromText('Linestring(42.342305 -71.04858,42.278325 -70.874176)',4326));

For generating POINT :
UPDATE sridpoint
        SET the_geom = ST_SetSRID(ST_Point( longitude,latitude),4326);

I can draw linestring when SRID = -1 but with SRID, I am facing problems.
Please let me know if someone is aware of how to generate linestring when
SRID is specified.

Thanks
Siddhesh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/pgrouting-users/attachments/20100302/0e829b3c/attachment.html


More information about the Pgrouting-users mailing list