[mapserver-dev] Re: Difference between queryByRect and queryByShape

Steve Lime sdlime at gmail.com
Sun Aug 7 23:23:27 EDT 2011


Query by shape and rect both operate using map coordinates. Conversion from screen to map coordinates would need to be done elsewhere, for example, in MapServer CGI. 

The rect and shape bounding box are used to search for candidate shapes within a layer. I'm not sure why the image size would factor into anything, I'd have to check the code. I'm wondering if the shape you create from the rect is complete (has a bounding box)...

Steve

Sent from my iPad

On Aug 4, 2011, at 5:19 PM, dragoncino <dragoncino at yahoo.it> wrote:

> Thanks for your suggestion, but I probably discovered what's the difference.
> I have calculated with another GIS software that the right number of streets
> actually inside the rectangle is 4. 
> Now, the number of streets given from querybyshape decreised with the
> increase of map size (default width was 320 px), reaching the number of 4
> when size was somthing like width = 10000 px.
> So, I definitely think that querybyshape is calculated on the "screen",
> while querybyrect is calculated oin the "world". This explain why in real
> usage (= if the user draws the polygon on the screen, and then this is used
> to make the query), querybyshape behaves more or less correctly. 
> This is anyway a bad behaviour, in my opinion.
> 
> Fabrizio
> 
> --
> View this message in context: http://osgeo-org.1803224.n2.nabble.com/Difference-between-queryByRect-and-queryByShape-tp6625562p6654466.html
> Sent from the Mapserver - Dev mailing list archive at Nabble.com.
> _______________________________________________
> mapserver-dev mailing list
> mapserver-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-dev


More information about the mapserver-dev mailing list