[postgis-users] copying ascii to a postgis

Brent Wood pcreso at pcreso.com
Fri May 20 16:52:48 PDT 2005


HI...

> I created a table in Postgres and executed
> the AddGeometryColumn function, using an SRID of
> 26714. I'm trying to import the ASCII table
> (geom.postis) with the following command: 
> MVB=# \copy municipalities from 'geom.postgis' with
> delimiter as ':'
> And I get: ERROR:  parse error - invalid geometry
> CONTEXT:  COPY municipalities, line 1, column
> muni_geom: "'POLYGON(477627.70516
> 2155699.597396, 477685.323332 2156036.954703,
> 477793.399583 2156365.341184, 47..."

Looks like you just did what I did a while back.... 

the WKT POLYGON coordinate data is in double brackets, not single, as the total
polygon definition comprises an outer ring & also zero or more inner rings. The
inner parentheses separate each ring of the whole polygon, the outer
parentheses contain all the rings. 

It is in the doc's, pretty obvious in hindsight, but I missed it :-)

Cheers,
  
  Brent Wood



More information about the postgis-users mailing list