Last active
August 29, 2015 14:06
-
-
Save bmoregeo/afab6abb332e8d95e779 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- PG_Geometry Line feature class -> PG Routing | |
-- Add Required Fields | |
ALTER TABLE way ADD COLUMN "source" integer; | |
ALTER TABLE way ADD COLUMN "target" integer; | |
-- Build Topology (3D) | |
SELECT sde.pgr_createTopology3d('way', 0.01, 'shape', 'objectid') | |
-- Add Indices | |
CREATE INDEX ways_source_idx ON way("source"); | |
CREATE INDEX ways_target_idx ON way("target"); | |
-- Add route id to waypoint | |
ALTER TABLE waypoint ADD COLUMN "routeid" integer; | |
UPDATE waypoint | |
SET routeid = way.objectid | |
FROM way | |
WHERE ST_3DDWithin(waypoint.shape, way.shape, .5) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment