Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mask layer failure when nonsquare pixels #5114

Closed
AsgerPetersen opened this issue Jul 6, 2015 · 3 comments
Closed

Mask layer failure when nonsquare pixels #5114

AsgerPetersen opened this issue Jul 6, 2015 · 3 comments

Comments

@AsgerPetersen
Copy link

This (anonymized) URL
http://host/fcgi-bin/mapserv.fcgi?map=/mapfile_with_mask_layer.map&request=GetMap&bbox=562968.936898,6123011.53890,614428.41406,6154345.17839&crs=EPSG:25832&layers=masked_layer&styles=&width=1281&height=781&format=image/png&transparent=TRUE&bgcolor=0xFFFFFF&exceptions=XML&version=1.3.0 returns a nicely masked map.

Whereas this URL
http://host/fcgi-bin/mapserv.fcgi?map=/mapfile_with_mask_layer.map&request=GetMap&bbox=562968.936896,6123011.5389,614428.41406,6154345.17839&crs=EPSG:25832&layers=masked_layer&styles=&width=1281&height=781&format=image/png&transparent=TRUE&bgcolor=0xFFFFFF&exceptions=XML&version=1.3.0 returns a blank image.

Note that the only difference between the URLs is on the 6th decimal of xmin in the bbox.

Looking at the debug output from the failing request these lines stand out:

...
msDrawMap(): kicking into non-square pixel preserving mode.
...
msPostGISLayerWhichShapes query: select encode(ST_AsBinary(ST_Force2D("geom"),'NDR'),'hex') as geom,"uid" from (select g.uid, g.geom
from public.filter_polygon g WHERE uid in (5,6 )) as subquery where geom && 
ST_GeomFromText('POLYGON((0 0,0 781,1281 781,1281 0,0 0))',find_srid('','public.filter_polygon','geom'))
...

Note that the BBOX used for the postgresql query seems to be the image size rather than the bounding coordinates of the request.

The debug output from the successful request doesn't show the non-square pixel preserving mode-notice and the postgres query looks like this:

...
msPostGISLayerWhichShapes query: select encode(ST_AsBinary(ST_Force2D("geom"),'NDR'),'hex') as geom,"uid" from (select g.uid, g.geom 
from public.filter_polygon g WHERE uid in (5,6 )) as subquery where geom && 
ST_GeomFromText('POLYGON((562989.02256434 6123011.53890013,562989.02256434 6154345.17838987,614408.32839366 6154345.17838987,614408.32839366 6123011.53890013,562989.02256434 6123011.53890013))',find_srid('','public.filter_polygon','geom'))
...

I am using mapserver 6.4.1.

@AsgerPetersen
Copy link
Author

For future reference:
Explicitly setting a PROJECTION block on the mask layer works around this issue.

@jratike80
Copy link

No similar reports since 2015. Explicitly setting a PROJECTION block imho is not a workaround, leaving it unset is hazardous.

@AsgerPetersen
Copy link
Author

No similar reports for eight years. Time flies by...

A great thank you to everyone working on this project. It is much appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants