[mapserver-users] Can QUERY mode process XY as map/data coordinates instead of pixel XY?

Lime, Steve D (MNIT) Steve.Lime at state.mn.us
Mon Jan 27 10:08:13 PST 2014


Two alternatives come to mind:

 1)  Set the extent with the [shpext] tag, then you really don't need the mapxy tag. E.g. mapext=[shpext], note you can expand that value using the "expand" attribute (given in layer units I believe).
 2) Add a scale parameter, e.g. mapxy==[mapx]+[mapy]&scale=sssss. Could also use [shpxy] + [scale] instead of mapx/mapy so that your map is centered on the selected feature rather than on the click.

Steve

-----Original Message-----
From: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Eduardo Kanegae
Sent: Monday, January 27, 2014 12:03 PM
To: List (MapServer Users)
Subject: Re: [mapserver-users] Can QUERY mode process XY as map/data coordinates instead of pixel XY?

hi Steve,

In fact I'm doing a "zoom-to-found-feature" with this identify. I'm using 'shpext' to create such ZoomTo. Because the queried layer is a line layer, when feature found is a straight line it works. But if the feature found is more like a curve or do not have any segments at the center (200px 200px), then "no feature found" error is displayed.

https://dl.dropboxusercontent.com/u/108047961/debug/map-hitpoint.jpg - see the blue pin icon

https://dl.dropboxusercontent.com/u/108047961/debug/map-info.jpg - and identify/zoomTo window is shown

Then, as suggested, I changed img.x and img.y to "mapxy=[mapx]+[mapy]"
and the feature is highlighted BUT the map is shown at the default extent (MAP->EXTENT) https://dl.dropboxusercontent.com/u/108047961/debug/map-3.jpg

Eduardo Patto Kanegae
http://www.webmapit.com | @webmapit
Eduardo Patto Kanegae
http://www.webmapit.com | @webmapit


2014-01-27 Lime, Steve D (MNIT) <Steve.Lime at state.mn.us>:
> Hi Eduardo: It's not real clear what you're trying accomplish, but I can say that imgext and img.x/.y can only take pixel coordinates. Is the problem that in your  template you can't reference the map coordinates of the click? If so, the [mapx] and [mapy] tags expose that info.
>
> -----Original Message-----
> From: mapserver-users-bounces at lists.osgeo.org 
> [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Eduardo 
> Kanegae
> Sent: Monday, January 27, 2014 11:11 AM
> To: List (MapServer Users)
> Subject: [mapserver-users] Can QUERY mode process XY as map/data coordinates instead of pixel XY?
>
> hi,
>
> I'm running MapServer 6.4.0 under Linux and I need to render an output query map (hilighting matched feature) using an URL like this:
> * IMPORTANT: this 2nd query map is being rendered after a 1st query mode - it's embed into layer's template.
>
> http://myserver/cgi-bin/mapserv?MAP=../mymap.map&MODE=query&LAYERS=all
> &QFORMAT=AGG8&MAP_SIZE=440+440&IMGEXT=[shpext_esc
> expand=75]&QLAYER=[cl]&IMG.X=220&IMG.Y=220
>
> BUT, I do not want to inform IMG.X and IMG.Y because this works only if I select a simple a flat line. If I choose a "curved line" (not simple flat line), XY will fall OUTSIDE the line and then my simulated "click into center" (220, 220) fails.
>
> Then, I wanted to know if is there a way to pass img.x and img.y as map coordinates, not pixel coordinates.
>
> thanks in advance.
>
> Eduardo Patto Kanegae
> http://www.webmapit.com | @webmapit
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>
>
_______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users





More information about the MapServer-users mailing list