queryByPoint

Bart van den Eijnden BEN at SYNCERA-ITSOLUTIONS.NL
Mon Jun 13 07:53:34 PDT 2005


Hi,

Do you have a TEMPLATE set on your LAYER, and do you have a TOLERANCE defined? Also look at TOLERANCEUNITS.

Second question, there is code for this in Chameleon, pasted below.

/**
 * convert a pixel position to a georef position
 *
 * @param nPixPos integer the pixel position
 * @param dfPixMin float the minimum pixel position
 * @param dfPixMax float the maximum pixel position
 * @param dfGeoMin float the minimum georeferenced position
 * @param dfGeoMax float the maximum georeferenced position
 * @param nInversePix boolean, flag to invert Y coordinates if UL > LR
 * @return double geocoded position.
 */
function Pix2Geo($nPixPos, $dfPixMin, $dfPixMax, $dfGeoMin, $dfGeoMax,
                 $nInversePix = false)
{
    $dfWidthGeo = $dfGeoMax - $dfGeoMin;
    $dfWidthPix = $dfPixMax - $dfPixMin;

    $dfPixToGeo = $dfWidthGeo / $dfWidthPix;

    if (!$nInversePix)
        $dfDeltaPix = $nPixPos - $dfPixMin;
    else
        $dfDeltaPix = $dfPixMax - $nPixPos;

    $dfDeltaGeo = $dfDeltaPix * $dfPixToGeo;


    $dfPosGeo = $dfGeoMin + $dfDeltaGeo;

    return ($dfPosGeo);
}

Best regards,
Bart

Bart van den Eijnden
Syncera IT Solutions
Postbus 270
2600 AG  DELFT

tel.nr.: 015-7512436
email: BEN at Syncera-ITSolutions.nl
>>> Philippe Gondek <philippe.gondek at GMAIL.COM> 06/13/05 16:26 PM >>>
Hi List,

I want to use queryByPoint, but when I try I have this result :

>>>>>>>>>>>Warning: [MapServer Error]: msQueryByPoint(): No matching
record(s) found. in /var/www/localhost/htdocs/sigma/sigma.php on line
64

My second question is when I get the coordonates of my point where I
click it's a number of pixel... How to have my real coordonates???

Thank you all...

Philippe GONDEK



More information about the MapServer-users mailing list