Hi,
I am trying the method you proposed in the previous post to calculate the exposure of the population DROP table IF EXISTS receivers_building ; CREATE TABLE receivers_building as SELECT ST_UPDATEZ(ST_LOCATEALONG(the_geom, 0.5, 2),4) as the_geom, ID from BUILDINGS_DEF; DROP TABLE if EXISTS receivers_facades; CREATE TABLE receivers_facades(PK SERIAL, THE_GEOM GEOMETRY,ID INT) as SELECT DEFAULT, E.the_geom, E.ID FROM ST_EXPLODE('receivers_building') E, GIP_CALC F WHERE ST_Intersects(E.the_geom, F.the_geom) ; drop table if exists pt_level; create table pt_level as select * from BR_PTGRID3D('BUILDINGS_DEF', 'H_FINAL','ROADS_SRC','RECEIVERS_FACADES','DB_M','G_DEF','',750,50,2,1,0.23); But I am obtaining this strange error: ERROR [Thread5477] (ExecuteScriptProcess.java:160)  Column "DEFAULT" not found; SQL statement: CREATE TABLE receivers_facades(PK SERIAL, THE_GEOM GEOMETRY,ID INT) as SELECT DEFAULT, E.the_geom, E.ID FROM ST_EXPLODE('receivers_building') E, GIP_CALC F WHERE ST_Intersects(E.the_geom, F.the_geom) [42122182] I have tried to run the programm without the PK SERIAL, it works perfectly well but, without surprise, I am not able to assignate the facades on the buildings since I have no identifiers for it. I have also try to add a serial after creating receivers facades using: DROP TABLE if EXISTS receivers_facades; CREATE TABLE receivers_facades( THE_GEOM GEOMETRY,ID INT) as SELECT E.the_geom, E.ID FROM ST_EXPLODE('receivers_building') E, GIP_CALC F WHERE ST_Intersects(E.the_geom, F.the_geom) ; alter table receivers_facades add column numero serial; update receivers_facades set numero =default; The result is very strange because in the column numero I have a number serie but it starts at the value "total number of column +1" and not at 0... I haven't found anything helping me on the web. It is probably some syntax error, but I really don't get it. Regards, Rodolphe. 
Administrator

Hi, Sorry, DEFAULT is for insert statements. In this case this is NULL. You can alternatively alter table and add the serial column. Regards,  Nicolas Fortin IRSTV FR CNRS 2488 GIS http://orbisgis.org Spatial DB http://h2gis.org Noise http://noisemap.orbisgis.org Le 20150312 10:50, Rodolphe [via OrbisGIS] a écrit :

Free forum by Nabble  Edit this page 