Database Reference
In-Depth Information
CREATE TABLE chp07.point_cloud (
x double precision,
y double precision,
z double precision,
nx double precision,
ny double precision,
nz double precision,
red integer,
green integer,
blue integer
);
In order to load the data into PostGIS, we need to remove the header information.
The simplest way to do that for our example is to trim the first 14 lines of the file.
Oncethisisdone,wecancopythedataintoourtabledirectly,specifyingspacesas
our delimiter. From psql :
\copy chp07.point_cloud from '/path/to/data/
headerless_giraffe.ply' DELIMITER ' ';
Now, we make the data spatial.
ALTER TABLE chp07.point_cloud ADD COLUMN
the_geom GEOMETRY(PointZ, 0);
UPDATE chp07.point_cloud SET the_geom =
ST_SetSRID(ST_MakePoint(x,y,z),0);
Search WWH ::




Custom Search