[postgis-users] Import TIN via SQL COPY from file

Rémi Cura remi.cura at gmail.com
Fri Jun 5 00:05:15 PDT 2015


Hey first copy has a couple of options that you should check.
Secondly find one correct tin as text, and check that you can use
st_geomfromtext on this tin, to be sure it is correct.
Then
create a test file with only the found tin with correct encoding and end of
line.
You should be ok .
Chers
Rémi-c
Le 4 juin 2015 21:53, "Hillier, Michael" <Michael.Hillier at nrcan-rncan.gc.ca>
a écrit :

> Hello,
>
>
>
> I am trying to import a TIN surface into postgresql + postgis database
> from a file via an SQL COPY command.
>
>
>
> First off, here is my table:
>
>
>
> CREATE TABLE tintable(id int4 primary key, geom geometry(TIN,4326));
>
>
>
> Because the TIN data is too large (thousands of entries) I can not use
> the  command
>
> INSERT INTO tintable (id,geom) VALUES (1,ST_GeomFromText('TIN(((1 0,0 1,1
> 1,1 0)))',4326));
>
>
>
> So I use the following:
>
>
>
> COPY tintable FROM 'C::\\users\\...' DELIMITERS '|'
>
>
>
> I have tried the following formats in the file I am trying to copy from:
>
>
>
> 1|(0 0,0 1,1 1,0 0) -> ERROR:  parse error - invalid geometry HINT:  "(0"
> <-- parse error at position 2 within geometry
>
>
>
> 1|0 0,0 1,1 1,0 0 -> ERROR:  Invalid hex string, length (15) has to be a
> multiple of two! CONTEXT:  COPY tintable, line 1, column geom: "0 0,0 1,1
> 1,0 0"
>
>
>
> 1|((0 0,0 1,1 1,0 0)) -> ERROR:  parse error - invalid geometry HINT:
> "((" <-- parse error at position 2 within geometry
>
>
>
> What is the correct file format so I can import TIN data using the command
> "COPY tintable FROM 'C::\\users\\...' DELIMITERS '|' "?
>
>
>
> Thank you
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20150605/dfed71fe/attachment.html>


More information about the postgis-users mailing list