Closed crebollobr closed 2 years ago
Isso acontece porque nsvia_none
não consta como um feature_type
em https://github.com/AddressForAll/WS/blob/master/src/ingest-step1-ini.sql#L210.
nsvia_none
deve ser um feature_type
?
Adicionei o tipo. Com isso, a ingestão funciona.
a4a@ubuntu:/opt/gits/_dg/preserv-BR/data/RS/Gravatai/_pk014$ make nsvia
------------------------------------------
------ Layer tipo nsvia_none ------
-- Incluindo dados do arquivo-2 do package-14_001 na base ingest1 --
Nome-hash do arquivo-2: 1ad669693352407105ccdeb37a4398d62b0accb25888122c84afe2788c121c7b.rar
Tabela do layer geoaddress sem nome de rua, só com numero predial: pk14_001_p2_nsvia
Sub-arquivos do arquivo-2 com o conteúdo alvo: PS_LOTEAMENTOS_SIRGAS 2000.*
Tema dos sub-arquivos: Loteamentos
Run with tmux and sudo! (DANGER: seems not idempotent on psql)
a4a
Above user is root? If not, you have permissions for all paths?
[press ENTER for yes else ^C]
psql postgres://postgres@localhost/ingest1 -c "DROP TABLE IF EXISTS pk14_001_p2_nsvia CASCADE"
NOTICE: table "pk14_001_p2_nsvia" does not exist, skipping
DROP TABLE
Extracting ....
cd /tmp/sandbox/_pk14_001; 7z x -y /var/www/preserv.addressforall.org/download/1ad669693352407105ccdeb37a4398d62b0accb25888122c84afe2788c121c7b.rar "*PS_LOTEAMENTOS_SIRGAS 2000*" ; chmod -R a+rx . > /dev/null
7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21
p7zip Version 16.02 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,64 bits,4 CPUs Intel Xeon E312xx (Sandy Bridge) (206A1),ASM)
Scanning the drive for archives:
1 file, 1172335 bytes (1145 KiB)
Extracting archive: /var/www/preserv.addressforall.org/download/1ad669693352407105ccdeb37a4398d62b0accb25888122c84afe2788c121c7b.rar
--
Path = /var/www/preserv.addressforall.org/download/1ad669693352407105ccdeb37a4398d62b0accb25888122c84afe2788c121c7b.rar
Type = Rar
Physical Size = 1172335
Solid = -
Blocks = 12
Multivolume = -
Volumes = 1
Everything is Ok
Files: 7
Size: 738170
Compressed: 1172335
Conferindo se SRID 31982 esta configurado:
srid | proj4text
-------+----------------------------------------------------------------------------------
31982 | +proj=utm +zone=22 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs
(1 row)
Tudo bem até aqui? [ENTER para continuar ou ^C para rodar WS/ingest-step1]
Executando shp2pgsql ...
cd /tmp/sandbox/_pk14_001; shp2pgsql -s 31982 "PS_LOTEAMENTOS_SIRGAS 2000.shp" pk14_001_p2_nsvia | psql -q postgres://postgres@localhost/ingest1 2> /dev/null
Field area is an FTDouble with width 11 and precision 2
Shapefile type: PolygonZ
Postgis type: MULTIPOLYGON[4]
addgeometrycolumn
--------------------------------------------------------------------
public.pk14_001_p2_nsvia.geom SRID:31982 TYPE:MULTIPOLYGON DIMS:4
(1 row)
psql postgres://postgres@localhost/ingest1 -c "SELECT ingest.any_load('shp2sql','/tmp/sandbox/_pk14_001/PS_LOTEAMENTOS_SIRGAS 2000','nsvia_none','pk14_001_p2_nsvia','14_001','1ad669693352407105ccdeb37a4398d62b0accb25888122c84afe2788c121c7b.rar',array['gid', 'geom'])"
NOTICE: Ring Self-intersection at or near point -51.05654757382986 -29.937641680759029 0
NOTICE: Ring Self-intersection at or near point -50.86399251906974 -29.913548594075738 0
any_load
-----------------------------------------
From file_id=1 inserted type=nsvia_none+
in feature_asis 363 items.
(1 row)
Confira os resultados nas tabelas ingest.layer_file e ingest.feature_asis.
FIM.
make nsvia_none psql postgres://postgres@localhost/ingest2 -c "SELECT ingest.any_load('shp2sql','/tmp/sandbox/_pk14_001/PS_LOTEAMENTOS_SIRGAS 2000','nsvia_none','pk14_001_p2_nsvia','14_001','1ad669693352407105ccdeb37a4398d62b0accb25888122c84afe2788c121c7b.rar',array['gid', 'geom'])" ERROR: null value in column "ftid" violates not-null constraint DETAIL: Failing row contains (49, 14.001, 1ad669693352407105ccdeb37a4398d62b0accb25888122c84afe2788c121c7b..., null, shp, 1, d186a1c53a1f6bc6105593edb7a32a48, {"file": "/tmp/sandbox/_pk14_001/PS_LOTEAMENTOS_SIRGAS 2000.shp"..., null). CONTEXT: SQL function "getmeta_to_file" statement 1 SQL function "getmeta_to_file" statement 1 PL/pgSQL function ingest.any_load(text,text,text,text,real,text,text[],text,boolean) line 16 at assignment make: *** [makefile:81: nsvia] Error 1