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
[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].783726 msPostGISLayerNextShape called.
[Sun Sep 19 00:01:38 2010].792812 msPostGISLayerOpen called: nodo_d_32632_the_geom FROM nodi_d USING srid=32632 USING UNIQUE id_nodo_d
[Sun Sep 19 00:01:38 2010].792861 msPostGISLayerOpen: Layer is already open!
[Sun Sep 19 00:01:38 2010].792874 msPostGISLayerFreeItemInfo called.
[Sun Sep 19 00:01:38 2010].792890 msPostGISLayerGetItems called.
[Sun Sep 19 00:01:38 2010].792902 msPostGISParseData called.
[Sun Sep 19 00:01:38 2010].792963 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].792979 msPostGISLayerGetItems executing SQL: select * from nodi_d where false limit 0
[Sun Sep 19 00:01:38 2010].793477 msPostGISLayerInitItemInfo called.
[Sun Sep 19 00:01:38 2010].793517 msPostGISLayerFreeItemInfo called.
[Sun Sep 19 00:01:38 2010].793533 msPostGISLayerClose called: nodo_d_32632_the_geom FROM nodi_d USING srid=32632 USING UNIQUE id_nodo_d
[Sun Sep 19 00:01:38 2010].793550 msConnPoolRelease(sezioni_xxxxxx,dbname=xxxxxx host=xxx.xxx.xxx.xxx port=5432 user=xxxxxx password=xxxxxx sslmode=disable,0x21bc6998)
[Sun Sep 19 00:01:38 2010].793566 msConnPoolClose(dbname=xxxxxx host=xxx.xxx.xxx.xxx port=5432 user=xxxxxx password=xxxxxx sslmode=disable,0x21bc6998)
[Sun Sep 19 00:01:38 2010].793658 msPostGISLayerOpen called: nodo_d_32632_the_geom FROM nodi_d USING srid=32632 USING UNIQUE id_nodo_d
[Sun Sep 19 00:01:38 2010].793674 msPostGISLayerOpen: No connection in pool, creating a fresh one.
[Sun Sep 19 00:01:38 2010].796961 msConnPoolRegister(sezioni_xxxxxx,dbname=xxxxxx host=xxx.xxx.xxx.xxx port=5432 user=xxxxxx password=xxxxxx sslmode=disable,0x21bcf0c8)
[Sun Sep 19 00:01:38 2010].796997 msPostGISLayerFreeItemInfo called.
[Sun Sep 19 00:01:38 2010].797010 msPostGISLayerGetItems called.
[Sun Sep 19 00:01:38 2010].797023 msPostGISParseData called.
[Sun Sep 19 00:01:38 2010].797047 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].797062 msPostGISLayerGetItems executing SQL: select * from nodi_d where false limit 0
[Sun Sep 19 00:01:38 2010].799023 msPostGISLayerInitItemInfo called.
[Sun Sep 19 00:01:38 2010].799086 msPostGISLayerGetShape called for record = 0
[Sun Sep 19 00:01:38 2010].799100 msPostGISParseData called.
[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].799135 msPostGISBuildSQL called.
[Sun Sep 19 00:01:38 2010].799148 msPostGISBuildSQLItems called.
[Sun Sep 19 00:01:38 2010].799163 msPostGISBuildSQLItems: 8 items requested.
[Sun Sep 19 00:01:38 2010].799180 msPostGISBuildSQLFrom called.
[Sun Sep 19 00:01:38 2010].799194 msPostGISBuildSQLWhere called.
[Sun Sep 19 00:01:38 2010].799213 msPostGISLayerGetShape 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 "id_nodo_d" = 0
[Sun Sep 19 00:01:38 2010].800010 msPostGISLayerGetShape number of records: 0
_______________________________________________
mapserver-users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/mapserver-users

Reply via email to