[postgis-users] Regarding calculating locations on a map

Thilani Imalka thilanii at gmail.com
Mon Oct 26 04:58:20 PDT 2009


Hi,
I am currently developing a shortest path application for my MSc
degree project.
Road information are stored in the postgis table and there I can find
geometries for all the roads.

But I am having few issues when selecting from and to location from
GUI (open layers). Where I have to provide a facility for users to
select from and to locations on the map by clicking the mouse. If the
user has done a drag, zoom in, zoom out operations on the map, then
those changes to the map will reflect to those location cordinates as
well.

Please suggest a way to resolve this issue by providing a simple
example. Following is a part of data insertion and create of roads
table sql.
So you can provide more straight forward answer to me  I guess that we
may have to deal with projections here (not sure).

------------------------------------------------
BEGIN;
CREATE TABLE "database"."roadstable" (gid serial PRIMARY KEY,
"fnode_" int8,
"tnode_" int8,
"lpoly_" int8,
"rpoly_" int8,
"length" float8,
"road_" int8,
"road_id" int8,
"code" int2,
"class" varchar(4));
SELECT AddGeometryColumn('database','roadstable','the_geom','-1','MULTILINESTRING',2);
INSERT INTO "database"."roadstable"
("fnode_","tnode_","lpoly_","rpoly_","length","road_","road_id","code","class",the_geom)
VALUES ('256','255','0','0','4828.497000','1','1','3',NULL,'01050000000100000001020000002700000000000060430EF4400000006023391D41000000C08B08F4400000000030391D4100000080AD00F440000000C03E391D4100000000C2F8F3400000008040391D41000000C0E3F0F340000000C039391D41000000A005E9F340000000C044391D410000006042E1F340000000E079391D41000000E099D9F34000000080E0391D4100000080F1D1F34000000060623A1D410000006056CAF340000000C0E73A1D4100000000AEC2F34000000020653B1D410000000013BBF34000000060F33B1D41000000806AB3F34000000000743C1D41000000A0B4ABF34000000080BD3C1D41000000C0FEA3F340000000C0AE3C1D41000000803B9CF340000000605C3C1D41000000C06A94F34000000040F13B1D41000000009A8CF340000000C0973B1D4100000040C984F340000000A05A3B1D4100000080F87CF34000000020213B1D41000000403575F340000000A0D83A1D41000000607F6DF340000000606D3A1D41000000C0F165F34000000080E0391D41000000A0715EF3400000000049391D4100000080D656F340000000C0BF381D41000000202E4FF3400000002041381D41000000A08547F34000000080C8371D41000000C0CF3FF340000000C065371D4100000000FF37F3400000006021371D41000000000630F34000000020E4361D41000000000D28F34000000020C4361D41000000C04920F34000000000E0361D41000000E0F118F340000000C05D371D41000000600512F340000000C048381D41000000C0330BF340000000C05C391D41000000E03904F34000000080513A1D41000000E0FCFCF240000000000F3B1D410000008097F5F240000000A0B83B1D41000000C0D7E9F24000000020BF3C1D41');

Thanks,
Thilani



More information about the postgis-users mailing list