[MapServer Error]: msQueryByPoint(): No matching record(s) found. /OGR/MYSQL

Frank Warmerdam warmerdam at POBOX.COM
Mon May 8 06:26:09 PDT 2006


grabiel wrote:
>  Hi
>    I have posted one message for ogr/mysql problem(No reply so far). If anyone has implemented ogr/mysql/php Plz. help me out. What i am trying is to relate a shape file with mysql table. I can able to fetch the data through ogrinfo in command line which is like this--->
>    
> [root at localhost bin]ogrinfo /usr/local/apache/htdocs/gmap/htdocs/data/n_state.shp -sql "SELECT st_nm, nsdata.name,nsdata.capital,nsdata.id from n_state
> LEFT JOIN 'MYSQL:test,host=localhost,user=root,tables=nsdata'.nsdata ON n_state.st_nm=nsdata.name"
> 
> The command above woks fine but when i try the same from mapfile, I am getting the following error. 
>> Warning: [MapServer Error]: msQueryByPoint(): No matching record(s) found. 
>> in /usr/local/apache/htdocs/gmap/htdocs/gmap75.inc.php on line 425
>  
>  The error above is only for the layer where i have used OGR/MySql table, whereas for layers where i havenot used OGR/MySql(simply shape file & Metadata) its showing the results.
>      
> My mapfile code for ogr is something like this--> 
...
> LAYER
>     NAME "n_state"
>     TYPE POINT
>     CONNECTIONTYPE OGR
>     CONNECTION "/usr/local/apache/htdocs/gmap/htdocs/data/n_state.shp"
>     DATA "SELECT * from n_state left join 'MYSQL:test,host=localhost,user=root,tables=nsdata'.nsdata ON n_state.st_nm=nsdata.name"
>     STATUS ON
>     CLASSITEM "st_nm"
>     CLASS
>         NAME "NEIGHBOURING STATE"
>         EXPRESSION /A*/ 
>         COLOR 255 0 0
>         OUTLINECOLOR 255 0 0
>         SYMBOL "NS"
>     END
> END

Grabriel,

Have you verified with ogrinfo that the attribute st_nm appears with the
expected values?

Try:

   ogrinfo -ro /usr/local/apache/htdocs/gmap/htdocs/data/n_state.shp \
    -sql "SELECT * from n_state left join
          'MYSQL:test,host=localhost,user=root,tables=nsdata'.nsdata ON
          n_state.st_nm=nsdata.name"

If everything looks ok there, then you might review your use of EXPRESSION.
It looks ok to me, but I'm not sure.

Good luck,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGF, http://osgeo.org



More information about the MapServer-users mailing list