Ticket #812 (closed defect: fixed)

Opened 8 years ago

Last modified 8 years ago

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

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

Changed 8 years ago by brian@…

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

Changed 8 years ago by brian@…

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

Changed 8 years ago by brian@…

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

Changed 8 years ago by warmerdam

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.

Changed 8 years ago by warmerdam

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.

Note: See TracTickets for help on using tickets.