Querying using georefferencial units

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Querying using georefferencial units

Eduardo Zenaide
Hi, list.

ok, i am able to get polygon extents.
but the query string is made using a pixel referrencing based on previous image.
there's a way to tell MapServer to query using georeferrencing units? or maybe any way to convert the pixel units to georreferencial?

i'm using an application based on GMap and i've seen some GMapPix2Geo function on the code. this could be used on the query string?

--
Eduardo Zenaide
Reply | Threaded
Open this post in threaded view
|

Re: Querying using georefferencial units

Steve Lime
Hi Eduardo: Sure, this is no problem. All the query routines expect map units (not pixels) and it's the CGI program that does that conversion before-hand.

To query by point use mapxy, by bbox use mapext and by shape use mapshp. For example:

  http://.../cgi-bin/mapserv?map=my.map&mode=query&qlayer=parcels&mapxy=1234.5678+1234.5678

Steve

>>> Eduardo Zenaide <[hidden email]> 05/09/07 2:28 PM >>>
Hi, list.

ok, i am able to get polygon extents.
but the query string is made using a pixel referrencing based on previous
image.
there's a way to tell MapServer to query using georeferrencing units? or
maybe any way to convert the pixel units to georreferencial?

i'm using an application based on GMap and i've seen some GMapPix2Geo
function on the code. this could be used on the query string?

--
Eduardo Zenaide
Reply | Threaded
Open this post in threaded view
|

Re: Querying using georefferencial units

Eduardo Zenaide
thanks, Steve, but there's one thing i didn't understand:

when MapServer do the query, it uses the georreferencial units, ok. but, it uses pixels to do the zooming thing. like this:

###############

... var_minxp=&var_minx=-38.234122&var_miny=-11.52665&var_maxx=-34.594394&var_maxy=-8.133178&minx=-38.736107&miny=-11.526650&maxx=-34.092409&maxy=-8.133178
...
CMD=QUERY_POINT&INPUT_TYPE=auto_rect&INPUT_COORD=168%2C180%3B216%2C225

###############

the final part is used to do the zoom. with ROSA tool it works, but i'm trying to do this using a search string with a text box. my function do this:

###############

function determinaQSTRING() {
        var hostPar = "http://localhost:82/zaal/al.php?";
        var keymapPar = "KEYMAPXSIZE=100&KEYMAPYSIZE=75&";
        var layerFixa = "Limite_Estadual_AL=Y&grid=Y&";
        var layer = document.pesquisa.layersList.value;
        var modePar = "&CMD=QUERY_POINT&INPUT_TYPE=auto_rect&";
        var imagePar = "imagewidth=760&imageheight=570";
        var queryEntry = document.pesquisa.busca.value;
        var operador = document.pesquisa.operadores.value;
        var minx = "minx=-37.561294&";
        var miny = "miny=-9.304462& ";
        var maxx = "maxx=-37.228709&";
        var maxy = "maxy=-9.160048&";
        document.pesquisa.qstring.value = "(\"[NOME]\" "+ operador +" /"+ queryEntry +"/)";
        window.opener.document.location = hostPar + keymapPar + layerFixa + layer + "=Y&" + minx + miny + maxx + maxy + imagePar + modePar + "INPUT_COORD=";
}

###############

i've tried to change the minx, miny, etc vars to get the actual size of queried layers using the [shpxy] and [shpminx], etc. i'm still trying to figure it out, but i've already tested using the exactly coordinates - just as in the function above - and didn't work.
when the query is made through the search string, it gets this INPUT_COORD to zoom. and it uses pixel units. i think if i could convert the pixel units to georreferencial it will work.

sorry to bother and all, but i'm really stuck with it.

thanks in advance :)


2007/5/10, Steve Lime <[hidden email]>:
Hi Eduardo: Sure, this is no problem. All the query routines expect map units (not pixels) and it's the CGI program that does that conversion before-hand.

To query by point use mapxy, by bbox use mapext and by shape use mapshp. For example:

  http://.../cgi-bin/mapserv?map=my.map&mode=query&qlayer=parcels&mapxy=1234.5678+1234.5678

Steve

>>> Eduardo Zenaide <[hidden email] > 05/09/07 2:28 PM >>>
Hi, list.

ok, i am able to get polygon extents.
but the query string is made using a pixel referrencing based on previous
image.
there's a way to tell MapServer to query using georeferrencing units? or
maybe any way to convert the pixel units to georreferencial?

i'm using an application based on GMap and i've seen some GMapPix2Geo
function on the code. this could be used on the query string?

--
Eduardo Zenaide




--
Eduardo Zenaide
Reply | Threaded
Open this post in threaded view
|

Re: Querying using georefferencial units

Eduardo Zenaide
one more thing. can i access shape extents through $gpoMap object?
$gpoMap->extent->minx or something like this?

thanks!

2007/5/11, Eduardo Zenaide <[hidden email]>:
thanks, Steve, but there's one thing i didn't understand:

when MapServer do the query, it uses the georreferencial units, ok. but, it uses pixels to do the zooming thing. like this:

###############

... var_minxp=&var_minx=-38.234122&var_miny=-11.52665&var_maxx=-34.594394&var_maxy=-8.133178&minx=-38.736107&miny=-11.526650&maxx=-34.092409&maxy=-8.133178
...
CMD=QUERY_POINT&INPUT_TYPE=auto_rect&INPUT_COORD=168%2C180%3B216%2C225

###############

the final part is used to do the zoom. with ROSA tool it works, but i'm trying to do this using a search string with a text box. my function do this:

###############

function determinaQSTRING() {
        var hostPar = "<a href="http://localhost:82/zaal/al.php?" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://localhost:82/zaal/al.php?";
        var keymapPar = "KEYMAPXSIZE=100&KEYMAPYSIZE=75&";
        var layerFixa = "Limite_Estadual_AL=Y&grid=Y&";
        var layer = document.pesquisa.layersList.value;
        var modePar = "&CMD=QUERY_POINT&INPUT_TYPE=auto_rect&";
        var imagePar = "imagewidth=760&imageheight=570";
        var queryEntry = document.pesquisa.busca.value;
        var operador = document.pesquisa.operadores.value;
        var minx = "minx=-37.561294&";
        var miny = "miny=-9.304462& ";
        var maxx = "maxx=-37.228709&";
        var maxy = "maxy=-9.160048&";
        document.pesquisa.qstring.value = "(\"[NOME]\" "+ operador +" /"+ queryEntry +"/)";
        window.opener.document.location = hostPar + keymapPar + layerFixa + layer + "=Y&" + minx + miny + maxx + maxy + imagePar + modePar + "INPUT_COORD=";
}

###############

i've tried to change the minx, miny, etc vars to get the actual size of queried layers using the [shpxy] and [shpminx], etc. i'm still trying to figure it out, but i've already tested using the exactly coordinates - just as in the function above - and didn't work.
when the query is made through the search string, it gets this INPUT_COORD to zoom. and it uses pixel units. i think if i could convert the pixel units to georreferencial it will work.

sorry to bother and all, but i'm really stuck with it.

thanks in advance :)


2007/5/10, Steve Lime <[hidden email]>:
Hi Eduardo: Sure, this is no problem. All the query routines expect map units (not pixels) and it's the CGI program that does that conversion before-hand.

To query by point use mapxy, by bbox use mapext and by shape use mapshp. For example:

  http://.../cgi-bin/mapserv?map=my.map&mode=query&qlayer=parcels&mapxy=1234.5678+1234.5678

Steve

>>> Eduardo Zenaide <[hidden email] > 05/09/07 2:28 PM >>>
Hi, list.

ok, i am able to get polygon extents.
but the query string is made using a pixel referrencing based on previous
image.
there's a way to tell MapServer to query using georeferrencing units? or
maybe any way to convert the pixel units to georreferencial?

i'm using an application based on GMap and i've seen some GMapPix2Geo
function on the code. this could be used on the query string?

--
Eduardo Zenaide




--
Eduardo Zenaide



--
Eduardo Zenaide