CREATE INDEX source_idx ON road_network("source");
CREATE INDEX target_idx ON road_network("target");
ALTER TABLE road_network ADD COLUMN length double precision;
UPDATE road_network SET length = length(the_geom);
ALTER TABLE road_network ADD COLUMN reverse_cost double precision;
UPDATE road_network SET reverse_cost = length;
ALTER TABLE road_network ADD COLUMN x1 double precision;
ALTER TABLE road_network ADD COLUMN y1 double precision;
ALTER TABLE road_network ADD COLUMN x2 double precision;
ALTER TABLE road_network ADD COLUMN y2 double precision;
UPDATE road_network SET x1 = x(ST_PointN(the_geom, 1));
UPDATE road_network SET y1 = y(ST_PointN(the_geom, 1));
UPDATE road_network SET x2 = x(ST_PointN(the_geom, ST_NumPoints(the_geom)));
UPDATE road_network SET y2 = y(ST_PointN(the_geom, ST_NumPoints(the_geom)));
alter table road_network add column cost double precision default 0;
update road_network set cost=0.1 where type='NH';
update road_network set cost=0.2 where type='SH';
update road_network set cost=0.3 where type='major';
update road_network set cost=0.4 where type='minor';
update road_network set cost=1.2 where type='colony';
这是我在 pgrouting 中用于路由的查询?
我的查询 是否可以在 MSSQL 中创建路由?
如果是这样,SQL Spatial 中可用的所有功能是什么?