[mapserver-users] postgis attributes not retrieved - msPostGISLayerGetShape called for record = 0

Enrico Gallo enrico.gallo at gmail.com
Sat Sep 18 15:36:08 PDT 2010


Hi list,

I am struggling against a strange error with a postgis layer

I am using:

Ubuntu server 10.04.1
Apache: 2.2.14-5ubuntu8
Mapserver: 5.6.5-2~lucid1
PHP: 5.3.2-1ubuntu4.2
Mapscript: 5.6.1-1ubuntu1.1
Postgresql: 8.3
Postgis: 1.5.1-3~lucid1
Pmapper: 4.0.0.0.0.0.0

I setup map file; I can display Postgis geometries without any problem

But when trying to query a geometry (eg: a point) I cannot retrieve attributes

Debugging postgres and mapserver I notice something not so clear

(see also complete log attached)

data query from db works, except for index

8<-------------
[Sun Sep 19 00:01:38 2010].776314 msPostGISLayerWhichShapes query:
select "id_nodo_d","id_nodo_n","id_bacino_n","id_dtm","quota","quota_datum",encode(AsBinary(force_collection(force_2d("nodo_d_32632_the_geom")),'NDR'),'hex')
as geom,"id_nodo_d" from nodi_d where nodo_d_32632_the_geom &&
GeomFromText('POLYGON((848337.993323167
5109401.91696871,848337.993323167 5130534.34765662,869470.424011073
5130534.34765662,869470.424011073 5109401.91696871,848337.993323167
5109401.91696871))',32632)
[Sun Sep 19 00:01:38 2010].782886 msPostGISLayerWhichShapes query
status: PGRES_TUPLES_OK (2)
[Sun Sep 19 00:01:38 2010].782910 msPostGISLayerWhichShapes got 1
records in result.
[Sun Sep 19 00:01:38 2010].782925 msPostGISLayerNextShape called.
[Sun Sep 19 00:01:38 2010].782938 msPostGISReadShape called.
[Sun Sep 19 00:01:38 2010].782974 msPostGISReadShape: PQgetlength = 3
[Sun Sep 19 00:01:38 2010].782988 msPostGISReadShape: [id_nodo_d] "971"
[Sun Sep 19 00:01:38 2010].783001 msPostGISReadShape: PQgetlength = 2
[Sun Sep 19 00:01:38 2010].783013 msPostGISReadShape: [id_nodo_n] "48"
[Sun Sep 19 00:01:38 2010].783026 msPostGISReadShape: PQgetlength = 2
[Sun Sep 19 00:01:38 2010].783038 msPostGISReadShape: [id_bacino_n] "48"
[Sun Sep 19 00:01:38 2010].783051 msPostGISReadShape: PQgetlength = 1
[Sun Sep 19 00:01:38 2010].783063 msPostGISReadShape: [id_dtm] "2"
[Sun Sep 19 00:01:38 2010].783075 msPostGISReadShape: PQgetlength = 0
[Sun Sep 19 00:01:38 2010].783087 msPostGISReadShape: [quota] ""
[Sun Sep 19 00:01:38 2010].783100 msPostGISReadShape: PQgetlength = 0
[Sun Sep 19 00:01:38 2010].783112 msPostGISReadShape: [quota_datum] ""
[Sun Sep 19 00:01:38 2010].783174 msPostGISReadShape: Setting shape->index = 0
[Sun Sep 19 00:01:38 2010].783186 msPostGISReadShape: [index] 0
[Sun Sep 19 00:01:38 2010].783659 msPostGISReadShape: [shape] POINT
(859566.8320000000530854 5116043.2699999995529652)
[...]
[Sun Sep 19 00:01:38 2010].799121 msPostGISParseData:
unique_column=id_nodo_d, srid=32632,
geom_column_name=nodo_d_32632_the_geom, table_name=nodi_d
[...]
[Sun Sep 19 00:01:38 2010].799086 msPostGISLayerGetShape called for record = 0
8<-------------

NB: unique_column=id_nodo_d is a true unique value integer field

8<-------------
"id_nodo_d","id_nodo_n","id_bacino_n","id_dtm","quota","quota_datum",encode(AsBinary(force_collection(force_2d("nodo_d_32632_the_geom")),'NDR'),'hex')
as geom,"id_nodo_d" from nodi_d where "id_nodo_d" = 0
[Sun Sep 19 00:01:38 2010].800010 msPostGISLayerGetShape number of records: 0
8<-------------

as you can see, as uid id_nodo_d is set 0 instead of 971, where clause
is wrong and no result is given!

any suggestion?

many thanks

enrico
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mapserver_level5.log
Type: text/x-log
Size: 5129 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20100919/c6ec4c21/attachment.bin>


More information about the MapServer-users mailing list