Opened 19 years ago

Last modified 13 years ago

#1627 new defect

[WMS] ] SLD / stretch images when using FE !

Reported by: assefa Owned by: assefa
Priority: high Milestone:
Component: WMS Server Version: 4.8
Severity: normal Keywords:
Cc: fx.prunayre@…

Description

Hello list, one question about SLD & Mapserver 

A simple GetMap request on a LAYER 
http://services.sandre.eaufrance.fr/geos/zonage?
SERVICE=WMS&VERSION=1.1.1&Request=GetMap&LAYERS=CIBA&
return a correct image. 

A GetMap on the same layer using SLD and filter <PropertyIsEqualTo>
http://services.sandre.eaufrance.fr/geos/zonage?
SERVICE=WMS&VERSION=1.1.1&Request=GetMap&LAYERS=CIBA&SLD=http://sandre.eaufranc
e.fr/geo/sld/cibaExp.sld
return a correct image. (SLD used :
http://sandre.eaufrance.fr/geo/sld/cibaExp.sld)

A GetMap on the same layer using SLD and filter <Intersects>
http://services.sandre.eaufrance.fr/geos/zonage?
SERVICE=WMS&VERSION=1.1.1&Request=GetMap&LAYERS=CIBA&SLD=http://sandre.eaufranc
e.fr/geo/sld/cibaInBourgogne.sld
return an image which contains the object corresponding to the intersect query
but the image is stretched (on the y axis) ... 
(SLD used : http://sandre.eaufrance.fr/geo/sld/cibaInBourgogne.sld)

Any ideas ? Layers are in Oracle Spatial.

Attachments (4)

bug1627.zip (407.9 KB ) - added by assefa 19 years ago.
zip file : test data
ms_1627_data1.zip (2.2 KB ) - added by ddegasperi 13 years ago.
Data to reproduce the problem (Part 1)
ms_1627_data2.zip (20.7 KB ) - added by ddegasperi 13 years ago.
Data to reproduce the problem (Part 2)
ms_1627_data3.zip (254.3 KB ) - added by ddegasperi 13 years ago.
Data to reproduce the problem (Part 3)

Download all attachments as: .zip

Change History (19)

comment:1 by assefa, 19 years ago

I think the problem comes from the fact that when the the sld includes FE, the 
image created/sent was done using createimage instaed of using the 
prepareimage (that takes care of all non square pixels).

I have commited the change in 4.9. I hope it solves the specific problem but I 
have not tried it. In any case the change should have been made.

I will wait for the initila bug reporter to test it before closing (or 
investigating more) : François-Xavier PRUNAYRE (fx.prunayre@OIEAU.FR)

by assefa, 19 years ago

Attachment: bug1627.zip added

zip file : test data

comment:2 by assefa, 19 years ago

Cc: jlacroix@… added
e-mail from Julien on the problem :

 Requete mapserver standard:
http://127.0.0.1:8080/cgi-bin/mapserv?map=/home/julien/proj/fgs-dev/src/mapserver/bugs/bug1627/bug1627.map&mode=map&LAYERS=prov_bound

Requete WMS standard:
http://127.0.0.1:8080/cgi-bin/mapserv?map=/home/julien/proj/fgs-dev/src/mapserver/bugs/bug1627/bug1627.map&service=WMS&request=GetMap&version=1.1.1&LAYERS=prov_bound

Requete WMS avec un Filtre de type BBox:
http://127.0.0.1:8080/cgi-bin/mapserv?map=/home/julien/proj/fgs-dev/src/mapserver/bugs/bug1627/bug1627.map&service=WMS&request=GetMap&version=1.1.1&LAYERS=prov_bound&SLD=http://127.0.0.1:8080/sandre/sld_bbox.xml

Requete WMS avec un filtre de type Intersect:
http://127.0.0.1:8080/cgi-bin/mapserv?map=/home/julien/proj/fgs-dev/src/mapserver/bugs/bug1627/bug1627.map&service=WMS&request=GetMap&version=1.1.1&LAYERS=prov_bound&SLD=http://127.0.0.1:8080/sandre/sld_inter.xml

Commes-tu peux voir il y a des differences dans le rendu des cartes. 

comment:3 by assefa, 19 years ago

Julien,

 I have check this using the data and here is what I think :

  There is currently a diffrence on the image between a GetMap request (without
and extents or width/heigh seeting) and a simple cgi mode=map request.  The
reason being is the the mode=map adjusts the extsnts set in the map file to fit
the width/height. In the case of the wms, the original extents set in the map
file are the one used and we end up doing non square pixel.
  I think that the wms should adjust the extents before loading the parameters
of the request.  The width/height/extents can be set in the request (which by he
way are required parameters of the wms although not tested as such in Mapserver).
  
  The original issue that you see with the sld using a FE is related to this :
when using a FE, there is query which is done and during the query the map
extents and adjusted using the width/heigh set. 

 So by adjusting the extents beofre loading the wms requests, It solves the
problem. I was thinking that maybe this  would prevent a person from
intentionnaly distorting his map, but since width/heigh/bbox are required
parameters, It does kind of prevent that already.

 What do you think ? If there is no objection I will make the changes.
  

 

comment:4 by jlacroix, 19 years ago

Is there a reason the WMS request do not modify the extent before drawing?
Without knowing what's under the hood, I was thinking that it was to always
return exactly what was asked by the client. If it's not the case, then I agree
that WMS request should behave exactly lilke GetMap request.

comment:5 by fx.prunayre@…, 19 years ago

Cc: fx.prunayre@… added
I updated my mapserver with the latest CVS 
http://services.sandre.eaufrance.fr/geos/zonage?
<!--
 MapServer version 4.9 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP OUTPUT=SVG
SUPPORTS=PROJ SUPPORTS=FREETYPE SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT
SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER INPUT=EPPL7
INPUT=ORACLESPATIAL INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE 
-->

and still the same problem.

Francois

comment:6 by assefa, 19 years ago

Julien, Francois

 I added the code to adjust the extents using current width and height before
loading parameters. 

 Please give it a try. I tried it with Julien's data and It works.

comment:7 by fx.prunayre@…, 19 years ago

Results are coherent when setting no parameters BBOX, WIDTH and HEIGHT in URL
http://services.sandre.eaufrance.fr/geos/zonage?SERVICE=WMS&VERSION=1.1.1&Request=GetMap&LAYERS=CIBA&SRS=EPSG:4326&SLD=http://sandre.eaufrance.fr/geo/sld/cibaExp.sld
http://services.sandre.eaufrance.fr/geos/zonage?SERVICE=WMS&VERSION=1.1.1&Request=GetMap&LAYERS=CIBA&SRS=EPSG:4326&SLD=http://sandre.eaufrance.fr/geo/sld/cibaInBourgogne.sld
http://services.sandre.eaufrance.fr/geos/zonage?SERVICE=WMS&VERSION=1.1.1&Request=GetMap&LAYERS=CIBA&SRS=EPSG:4326&

... but images are not if using BBOX, WIDTH and HEIGHT parameters. Examples with
2 different projections :
http://services.sandre.eaufrance.fr/geos/zonage?SERVICE=WMS&VERSION=1.1.1&Request=GetMap&LAYERS=CIBA&WIDTH=300&HEIGHT=300&BBOX=-5,40,12,52&SRS=EPSG:4326&SLD=http://sandre.eaufrance.fr/geo/sld/cibaExp.sld
http://services.sandre.eaufrance.fr/geos/zonage?SERVICE=WMS&VERSION=1.1.1&Request=GetMap&LAYERS=CIBA&WIDTH=300&HEIGHT=300&BBOX=-5,40,12,52&SRS=EPSG:4326&SLD=http://sandre.eaufrance.fr/geo/sld/cibaInBourgogne.sld
http://services.sandre.eaufrance.fr/geos/zonage?SERVICE=WMS&VERSION=1.1.1&Request=GetMap&LAYERS=CIBA&WIDTH=300&HEIGHT=300&BBOX=-5,40,12,52&SRS=EPSG:4326&

http://services.sandre.eaufrance.fr/geos/zonage?SERVICE=WMS&VERSION=1.1.1&Request=GetMap&LAYERS=CIBA&WIDTH=300&HEIGHT=300&BBOX=0,1600000,1400000,2800000&SRS=EPSG:27582&SLD=http://sandre.eaufrance.fr/geo/sld/cibaExp.sld
http://services.sandre.eaufrance.fr/geos/zonage?SERVICE=WMS&VERSION=1.1.1&Request=GetMap&LAYERS=CIBA&WIDTH=300&HEIGHT=300&BBOX=0,1600000,1400000,2800000&SRS=EPSG:27582&SLD=http://sandre.eaufrance.fr/geo/sld/cibaInBourgogne.sld
http://services.sandre.eaufrance.fr/geos/zonage?SERVICE=WMS&VERSION=1.1.1&Request=GetMap&LAYERS=CIBA&WIDTH=300&HEIGHT=300&BBOX=0,1600000,1400000,2800000&SRS=EPSG:27582&

Almost ok. Thanks.

comment:8 by fwarmerdam, 19 years ago

Cc: warmerdam@… added
adding myself to the cc: list since this change has affected some of the
msautotest/wxs results.  I will need to update the test suite once things
are settled down.  

comment:9 by jlacroix, 19 years ago

Assefa,
Your fix is correct. Any chance to see it in 4.8?

Like Francois said however, when using the 3 parameters BBox, width and height
together, the bug shows again. Check URL for the attached test case:

Working request with Intersect:
http://127.0.0.1:8080/cgi-bin/mapserv?map=/home/julien/proj/fgs-dev/src/mapserver/bugs/bug1627/bug1627.map&service=WMS&request=GetMap&version=1.1.1&LAYERS=prov_bound&SLD=http://127.0.0.1:8080/sandre/sld_inter.xml

Not-working request with Intersect and bbox and height and width:
http://127.0.0.1:8080/cgi-bin/mapserv?map=/home/julien/proj/fgs-dev/src/mapserver/bugs/bug1627/bug1627.map&service=WMS&request=GetMap&version=1.1.1&LAYERS=prov_bound&SLD=http://127.0.0.1:8080/sandre/sld_bbox.xml&width=400&height=300&BBox=-2200000,-712631,3072800,3840000

comment:10 by assefa, 19 years ago

Julien,

 looking at your last tests, the results are consistent : 
   * in the first case (no width, height given), the image returned is adjusted
(extents are adjusted using the width height and this produces an image equally
proportinal in x and y)
  * in the 2nd case, we end up having a streched image (based on the extents and
the width/height given, we end up having non square pixels).

  Does this make sense ?

 I am not sure, if It should be added to 4.8. The changes are minimal in code
but It changed the behaviour. Daniel, can you comment on this if possible ?

 Julien, Francois,

  Is Francois case the same as the one Julien preseneted ? If not could I have
Francois's data to test it locally ?

 Thanks

comment:11 by fx.prunayre@…, 18 years ago

Problem is that when using Width, height and Bbox images are different if using
no filter, <PropertyIsEqualTo> and <Intersects>. 
When no filter and <PropertyIsEqualTo> images are consistent, but not with
intersects which is stretched.

Francois


comment:12 by jlacroix, 18 years ago

Francois,
Are you using latest CVS version? If I compare a request with Intersect and a
request with no filter, I get the exact same result. Let us know if you still
reproduce the problem with your data.

URLs for attached test case:
http://127.0.0.1:8080/cgi-bin/mapserv?map=/home/julien/proj/fgs-dev/src/mapserver/bugs/bug1627/bug1627.map&service=WMS&request=GetMap&version=1.1.1&LAYERS=prov_bound&SLD=http://127.0.0.1:8080/sandre/sld_bbox.xml&width=400&height=300&BBox=-2200000,-712631,3072800,3840000

http://127.0.0.1:8080/cgi-bin/mapserv?map=/home/julien/proj/fgs-dev/src/mapserver/bugs/bug1627/bug1627.map&service=WMS&request=GetMap&version=1.1.1&LAYERS=prov_bound&width=400&height=300&BBox=-2200000,-712631,3072800,3840000

comment:13 by fx.prunayre@…, 18 years ago

Hi - still testing bug 1627 -, I tried to convert to shapefile. But it is the same.

CVS version is ok for BBOX and was not in the previous one. But I still have the
problem with INTERSECTS.

http://services.sandre.eaufrance.fr/geos/mapservercvs?map=/home/www/data/bug1627/bug1627ciba.map&SERVICE=WMS&VERSION=1.1.1&Request=GetMap&LAYERS=CIBA&WIDTH=300&HEIGHT=300&BBOX=0,1600000,1400000,2800000&SRS=EPSG:27582&
BBOX filter return a consistent image :
- CVS version :
http://services.sandre.eaufrance.fr/geos/mapservercvs?map=/home/www/data/bug1627/bug1627ciba.map&SERVICE=WMS&VERSION=1.1.1&Request=GetMap&LAYERS=CIBA&WIDTH=300&HEIGHT=300&BBOX=0,1600000,1400000,2800000&SRS=EPSG:27582&SLD=http://sandre.eaufrance.fr/geo/sld/cibaInFrance.sld
- Old version (4.8b2):
http://services.sandre.eaufrance.fr/geos/mapserv48b2?map=/home/www/data/bug1627/bug1627ciba.map&SERVICE=WMS&VERSION=1.1.1&Request=GetMap&LAYERS=CIBA&WIDTH=300&HEIGHT=300&BBOX=0,1600000,1400000,2800000&SRS=EPSG:27582&SLD=http://sandre.eaufrance.fr/geo/sld/cibaInFrance.sld
but INTERSECTS doesn't
http://services.sandre.eaufrance.fr/geos/mapservercvs?map=/home/www/data/bug1627/bug1627ciba.map&SERVICE=WMS&VERSION=1.1.1&Request=GetMap&LAYERS=CIBA&WIDTH=300&HEIGHT=300&BBOX=0,1600000,1400000,2800000&SRS=EPSG:27582&SLD=http://sandre.eaufrance.fr/geo/sld/cibaInBourgogne2.sld

In both case geometry in filter is in WGS84.

Hope this could help. 

comment:14 by ddegasperi, 13 years ago

I've the same problem with mapserver 5.6.6 and mapserver 6.0

by ddegasperi, 13 years ago

Attachment: ms_1627_data1.zip added

Data to reproduce the problem (Part 1)

by ddegasperi, 13 years ago

Attachment: ms_1627_data2.zip added

Data to reproduce the problem (Part 2)

by ddegasperi, 13 years ago

Attachment: ms_1627_data3.zip added

Data to reproduce the problem (Part 3)

comment:15 by assefa, 13 years ago

Owner: changed from mapserverbugs to assefa
Note: See TracTickets for help on using tickets.