[postgis-users] Changed bahaviour of PostGIS confuses MapServer

Peter Hopfgartner peter.hopfgartner at r3-gis.com
Fri Dec 12 07:49:46 PST 2008


Mark Cave-Ayland wrote:
> Peter Hopfgartner wrote:
>
>> Dear MLs,
>>
>> sorry for cross-posting to both, PostGIS and MS, but seems to rtouch 
>> both.
>>
>> I've tried to install PostGIS 1.3.4 on a CentOS 5 server with 
>> MapServer 5.2.1 and PostgreSQL 8.2.11.
>>
>> the command:
>>
>> shp2img -l prova -e 1587541 5116731 1591730 5120008 -m prova.map > 
>> ../../public/technet/test-<pgis-version>.png
>>
>> with 1.3.3 gave the result shown in figure test-postgis-1.3.3-4.png 
>> (a simple line layer)
>>
>> Upgrading to 1.3.4 the picture became as in test-postgis-1.3.4-1.png, 
>> an empty picture.
>>
>> The relevant mapfile fragment is Mapfile.frag.txt, the SQL table 
>> definition is e405.sql, all objects are MULTILINESTRINGs [SELECT 
>> DISTINCT geometrytype(the_geom) FROM public.e405 results in 
>> MULTILINESTRING], the geometry column is registered as 
>> MULTILINESTRING in geometry_columns.
>>
>> Running the MapServer query:
>>
>> SELECT 
>> asbinary(force_collection(force_2d(the_geom)),'NDR'),common_uid::text 
>> from public.e405 WHERE (tiplinapp is not null) and (the_geom && 
>> setSRID( 'BOX3D(1587541 5116702.44897959,1591730 
>> 5120036.55102041)'::BOX3D,find_srid('','public.e405','the_geom') ))
>>
>> changed for better result readability into:
>>
>> SELECT AsEWKT(force_collection(force_2d(the_geom))),common_uid::text 
>> from public.e405 WHERE (tiplinapp is not null) and (the_geom && 
>> setSRID( 'BOX3D(1587541 5116702.44897959,1591730 
>> 5120036.55102041)'::BOX3D,find_srid('','public.e405','the_geom') ))
>>
>> by hand gives slightly different results, as shown in the attached 
>> files.
>>
>> To make a long story short, 1.3.4 seems to better preserve the 
>> MULTILINESTRING, but this seems to confuse MapServer.
>>
>> Regards,
>>
>> Peter
>
>
> Hi Peter,
>
> This is likely the known issue with MULTILINESTRINGs in 1.3.4 causing 
> segfaults :(  The patch you need is very simple and can be found here: 
> http://postgis.refractions.net/pipermail/postgis-commits/2008-December/000866.html 
> if you can't wait for a 1.3.5 release. Please let us know whether this 
> resolves the problem for you.
>
>
> HTH,
>
> Mark.
>
Good catch! Now everything is fine.

Thanks,

Peter

-- 
 
Dott. Peter Hopfgartner
 
R3 GIS Srl - GmbH
Via Johann Kravogl-Str. 2
I-39012 Meran/Merano (BZ)
Email: peter.hopfgartner at r3-gis.com
Tel. : +39 0473 494949
Fax  : +39 0473 069902
www  : http://www.r3-gis.com




More information about the postgis-users mailing list