Opened 19 years ago

Last modified 5 years ago

#812 closed defect (fixed)

OGC WKT EWKT warnings for every insert

Reported by: brian@… Owned by: warmerdam
Priority: normal Milestone:
Component: default Version: unspecified
Severity: normal Keywords:
Cc:

Description (last modified by davidperez)

I'm importing the Tiger dataset into PostgreSQL.  After applying two patches 
(dimension enforcement and array termination), i rebuilt the debian packages 
and installed them. 
 
The import seems to go smoothly but i get a warning for each insert: 
 
WARNING:  OGC WKT expected, EWKT provided - use GeomFromEWKT() for this   
 
I moved this line from ogrpgtablelayer.cpp, line 850: 
  CPLDebug( "OGR_PG", "PQexec(%s)\n", pszCommand ); 
to before the PGexec().  Here are a couple inserts statements 
 
OGR_PG: PQexec(INSERT INTO "completechain" (wkb_geometry , "module", "tlid", 
"source", "fename", "fetype", "fedirs", "cfcc", "fraddl", "toaddl", "fraddr", 
"toaddr", "friaddl", "toiaddl", "friaddr", "toiaddr", "zipl", "zipr", 
"statel", "stater", "countyl", "countyr", "cousubl", "cousubr", "placel", 
"placer","tractl", "tractr", "blockl", "blockr") VALUES 
(GeometryFromText('LINESTRING (-77.10766200 38.929550000.000,-77.10775400 
38.92954800 0.000,-77.10790500 38.92968600 0.000,-77.10812200 38.92990800 
0.000,-77.10861700 38.93039500 0.000,-77.10905100 38.93082500 
0.000,-77.10908200 38.93085900 0.000)'::TEXT,1) , 'TGR11001', 76219112, 'A', 
'Sherrier', 'Pl', 'NW', 'A41', '       5500', '       5598', '       5501', '       
5599', '0', '0', '0', '0', 20016, 20016, 11, 11, 1, 1, 50000, 50000, 50000, 
50000, 902, 902, 4013, 4012)) 
 
OGR_PG_NOTICE: WARNING:  OGC WKT expected, EWKT provided - use GeomFromEWKT() 
for this 
 
OGR_PG: PQexec(INSERT INTO "completechain" (wkb_geometry , "module", "tlid", 
"source", "fename", "fetype", "fedirs", "cfcc", "fraddl", "toaddl", "fraddr", 
"toaddr", "friaddl", "toiaddl", "friaddr", "toiaddr", "zipl", "zipr", 
"statel", "stater", "countyl", "countyr", "cousubl", "cousubr", "placel", 
"placer","tractl", "tractr", "blockl", "blockr") VALUES 
(GeometryFromText('LINESTRING (-77.10881500 38.926940000.000,-77.10884000 
38.92696400 0.000,-77.10887300 38.92700000 0.000,-77.10890300 38.92703900 
0.000,-77.10904000 38.92723300 0.000,-77.10917100 38.92744100 
0.000,-77.10933900 38.92771500 0.000,-77.10951700 38.92801900 
0.000,-77.10965100 38.92825300 0.000,-77.10968000 38.92830100 
0.000)'::TEXT,1) , 'TGR11001', 76219113, 'A', 'Potomac', 'Ave', 'NW', 'A41', '       
5400', '       5498', '       5401', '       5499', '0', '0', '0', '0', 20016, 
20016, 11, 11, 1, 1, 50000, 50000, 50000, 50000, 902, 902, 4005, 4015)) 
 
OGR_PG_NOTICE: WARNING:  OGC WKT expected, EWKT provided - use GeomFromEWKT() 
for this 
 
I don't know what the error is, but if you point me in the right direction, 
i'll try to fix it.

Change History (6)

comment:1 by brian@…, 19 years ago

Of course the problem with this is, as i import Tiger from AK to OH, 
postgres.log grew to 3 GB. 
 

comment:2 by brian@…, 19 years ago

Here are some comments from PostGIS people on the matter. 
 
http://postgis.refractions.net/pipermail/postgis-devel/2005-January/000885.html 

comment:3 by brian@…, 19 years ago

sprintf( pszCommand + strlen(pszCommand), "GeomFromEWKT( 'SRID=%d;%s'::TEXT ) 
", nSRSId, pszWKT ); 
 
I think you want this on line 686 of ogrpgtablelayer.cpp. 
 

comment:4 by warmerdam, 19 years ago

Brian, 

I am not clear on when the GeomFromEWKT() function was added to PostGIS. 
I am hesitant to change the code to depend on it, for fear it won't work 
with older versions of PostGIS anymore.  

Personally, I think it was somewhat rude of the PostGIS guys to add lots of
constraints and extra warnings in PostGIS 1.0.  

I will leave this bug report open for now, with the intent of adding logic to
determine what version of PostGIS I am using, and accomodating it appropriately.
But I don't know when I will be able to address this.

comment:5 by warmerdam, 19 years ago

This has been addressed now.  The driver checks the PostGIS version to see
if the EWKT functions should be used.  OGR has also been overhauled to preserve
dimensionality through all the geometry classes and to use it in the WKB and WKT
conversion functions.

comment:6 by davidperez, 5 years ago

Description: modified (diff)

I'm also having this warning many times. Now using Postgres 11.4 and Postgis 2.5.2. How can I avoid it? Is it significant?

Note: See TracTickets for help on using tickets.