[Mapserver-users] win32 postgis

Richard Greenwood rich at greenwoodmap.com
Sun Feb 9 16:56:50 PST 2003


--=======21122779=======
Content-Type: text/plain; x-avg-checked=avg-ok-5BA87126; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 8bit

I have postgis running under win32 mapserver 3.6.4 with only 2 very minor 
modifications to  mappostgis.c. I am testing against a table with ~11,000 
polygons. Postgis fails with a simple data statement like:
     DATA "the_geom from join_region"
However it works with:
     DATA  "the_geom from (select * from join_region limit 7000) as foo 
using unique gid using SRID=-1"

The key element that makes it work is LIMIT (not AS, UNIQUE, or USING).

The exact value of LIMIT is related to the size of the bounding box i.e. 
the smaller the box, the larger the limit, or the larger the box the lower 
the limit, but no matter how small the box, some limit is required or else 
I get an error.

The postgis table works correctly with mapserver under Linux, these errors 
only occur under windows. In both cases I am pulling the data off of the 
same PostgreSQL 7.2 database. The specific error message is shown below, 
but offers few clues.

// === begin error message ======

msPOSTGISLayerWhichShapes(): Query error. Error executing POSTGIS SQL 
statement (in FETCH ALL): DECLARE mycursor BINARY CURSOR FOR SELECT 
asbinary(force_collection(force_2d(the_geom)),'NDR'),gid::text from (select 
* from join_region limit 9000) as foo WHERE the_geom && 
setSRID('BOX3D(2263772.72727336 1322825.75757207,2695772.72727336 
1646462.12122007)'::BOX3D, -1 ) -pqReadData() -- read() failed: errno=0 No 
error Error with POSTGIS data variable. You specified ''.
Standard ways of specifiying are :
(1) 'geometry_column from geometry_table'
(2) 'geometry_column from (<sub query>) as foo using unique <column name> 
using SRID=<srid#>'

Make sure you put in the 'using unique <column name>' and 'using SRID=#' 
clauses in.

For more help, please see http://postgis.refractions.net/documentation.php

Mappostgis.c - version of Nov 15/2002.

// ==== end error message ======

I would welcome any suggestions to help narrow this problem down as I think 
postgis under windows is an important contribution to the mapserver project.

Rich


Richard W. Greenwood, PLS
(307) 733-0203
Rich at GreenwoodMap.com
www.GreenwoodMap.com 

--=======21122779=======--




More information about the MapServer-users mailing list