[postgis-users] About Invalid OGC WKT Error

Markus Schaber schabios at logi-track.com
Fri Feb 4 01:43:19 PST 2005


Hi, Tom,

Kralidis,Tom [Burlington] schrieb
>>Can you turn logging on in your PostgreSQL server (especially
>>statement logging and warnings and such), and send us the
>>output produced during your connection attempts?
>
> LOG:  connection received: host=[local] port=
> LOG:  connection authorized: user=postgres database=devgeodb

The connection was established successfully.

> LOG:  statement: BEGIN
> LOG:  statement: DECLARE mycursor BINARY CURSOR FOR SELECT asbinary(force_collection(force_2d(the_geom)),'NDR'),OID::text from service_endpoints WHERE the_g
> eom && setSRID('BOX3D(-141.089 36.392987,-52.089 89.784987)'::BOX3D, find_srid('','service_endpoints','the_geom') )

The query is sent to the server as a BINARY CURSOR.

> LOG:  statement: FETCH ALL in mycursor

The client fetches all the data.

Folliwing are the queries that are internally used by find_srid().
> LOG:  statement: SELECT   $1  IS NULL
> CONTEXT:  PL/pgSQL function "find_srid" line 6 at if
> LOG:  statement: SELECT   $1  IS NULL
> CONTEXT:  PL/pgSQL function "find_srid" line 9 at if
> LOG:  statement: SELECT   $1  IS NULL
> CONTEXT:  PL/pgSQL function "find_srid" line 12 at if

The three arguments are checked to be not NULL.

> LOG:  statement: SELECT   $1
> CONTEXT:  PL/pgSQL function "find_srid" line 15 at assignment
> LOG:  statement: SELECT   $1
> CONTEXT:  PL/pgSQL function "find_srid" line 16 at assignment

Two variables are assigned. (I do not know why in the hell this is
actually implemented using a subquery in plpgsql...)

> LOG:  statement: SELECT  (  $1  = '' and  $2  LIKE '%.%' )
> CONTEXT:  PL/pgSQL function "find_srid" line 20 at if

Check whether we have schema and table encoded as "schema.table"

> LOG:  statement: SELECT   $1  || '%'
> CONTEXT:  PL/pgSQL function "find_srid" line 24 at assignment

Append a % to the schema name.

> LOG:  statement: SELECT  SRID from geometry_columns where f_table_schema like  $1  and f_table_name =  $2  and f_geometry_column =  $3
> CONTEXT:  PL/pgSQL function "find_srid" line 27 at select into variables

Get the SRID from the table.

> LOG:  statement: SELECT  NOT  $1
> CONTEXT:  PL/pgSQL function "find_srid" line 28 at if

This is the check whether a column was found in the table ("IF NOT FOUND
THEN").

> LOG:  statement: SELECT   $1
> CONTEXT:  PL/pgSQL function "find_srid" line 31 at return

This is the return statement that should return the SRID.

> LOG:  statement: COMMIT

The transaction finishes.

This seems all okay, there's no error in here. So I think that MapServer
has some problems parsing the data it gets, but as it us using
asBinary(), there should be no such problem, as this is an OpenGIS
method that has not changed its sematics between PostGIS versions.

Markus

--
markus schaber | dipl. informatiker
logi-track ag | rennweg 14-16 | ch 8001 zürich
phone +41-43-888 62 52 | fax +41-43-888 62 53
mailto:schabios at logi-track.com | www.logi-track.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 256 bytes
Desc: OpenPGP digital signature
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20050204/af41845b/attachment.pgp>


More information about the postgis-users mailing list