Re: [pmapper-users] Troubles with Search.xml / Problemas con Search.xml
Brought to you by:
arminburger
From: Armin B. <arm...@gm...> - 2009-03-26 18:10:24
|
all your expression examples work for me both on Windows and on Debian Linux (4 and 5). I don't know why you get some expressions like ( "Komsomolsk" =~ /(M|m)(A|a)(D|d)(R|r)(I|i)(D|d)/ ) armin On 26/03/2009 18:45, Carlos Cuello wrote: > Finally i could get the log file (i even tried by doing chmod 777 to the > directory and still it didn't work...after reinstalling it did :P) > Well, the trouble continues, even when working with the default data, > the one included on the install by default (europe map). > So here it is what appears on the pm_debug.log after trying to do a search: > With the wildcard = 0 > *[26-Mar-2009 13:31:03] P.MAPPER debug info > Searcharray in search.php->getSearchParameters() > Array > ( > [NAME] => Madrid > [mode] => search > [PHPSESSID] => 05e9db87af5dc5361fbcdd92b978d4b4 > ) > > [26-Mar-2009 13:31:03] P.MAPPER debug info > Parameters for searchArray > file: query.php->q_execAttributeQuery > > Array > ( > [NAME] => Madrid > [mode] => search > [PHPSESSID] => 05e9db87af5dc5361fbcdd92b978d4b4 > ) > > [26-Mar-2009 13:31:03] P.MAPPER debug info > Parameters for searchParams > file: query.php->q_execAttributeQuery > Array > ( > [layerName] => cities10000eu > [layerType] => shape > [firstFld] => NAME > [qStr] => ( ( "[NAME]" =~ /(M|m)(A|a)(D|d)(R|r)(I|i)(D|d)/ ) )* > > and with the wildcard = 2 > > *[26-Mar-2009 13:31:53] P.MAPPER debug info > Searcharray in search.php->getSearchParameters() > Array > ( > [NAME] => Madrid > [mode] => search > [PHPSESSID] => 05e9db87af5dc5361fbcdd92b978d4b4 > ) > > [26-Mar-2009 13:31:53] P.MAPPER debug info > Parameters for searchArray > file: query.php->q_execAttributeQuery > > Array > ( > [NAME] => Madrid > [mode] => search > [PHPSESSID] => 05e9db87af5dc5361fbcdd92b978d4b4 > ) > > [26-Mar-2009 13:31:53] P.MAPPER debug info > Parameters for searchParams > file: query.php->q_execAttributeQuery > Array > ( > [layerName] => cities10000eu > [layerType] => shape > [firstFld] => NAME > [qStr] => ( ( "[NAME]" = "Madrid") ) > )* > > So i downloaded the test_query_string.php file, placed on the util > folder and modified and look like this: > *<?php > > if (!extension_loaded('MapScript')) { > dl("php_mapscript." . PHP_SHLIB_SUFFIX); > } > > $mapFile = "/var/www/pmapper-3.2/config/default/pmapper_demo.map"; > $map = ms_newMapObj($mapFile); > $qLayer = $map->getLayerByName("cities10000eu"); > > //$qStr = '(( ( "[NAME]" =~ /(C|c)(A|a)(T|t)(A|a)/ ) ) AND ( > "[ISO2_CODE]" =~ /(I|i)(T|t)/ ) )'; > $qStr = '( ( "[name]" =~ /(M|m)(A|a)(D|d)(R|r)(I|i)(D|d)/ ) )'; > $query = $qLayer->queryByAttributes("NAME", $qStr, MS_MULTIPLE); > > $qLayer->open(); > $numResults = $qLayer->getNumResults(); > for ($iRes=0; $iRes < $numResults; $iRes++) { > $qRes = $qLayer->getResult($iRes); > $qShape = $qLayer->getShape($qRes->tileindex,$qRes->shapeindex); > $qShpIdx = $qShape->index; > print_r($qShape->values); > } > ?>* > > And the executed from the browser and this appear (actually it was quite > more long but it just repeat the same for different what I assume are > city names on the layer): > * > Warning: [MapServer Error]: msQueryByAttributes(): No matching record(s) > found. in **/var/www/pmapper-3.2/util/test_query_string.php on line **14 > > * *Warning: [MapServer Error]: msEvalExpression: Failed to parse > expression: ( "Komsomolsk" =~ /(M|m)(A|a)(D|d)(R|r)(I|i)(D|d)/ ) in > **/var/www/pmapper-3.2/util/test_query_string.php on line **14 > > * *Warning: [MapServer Error]: msyyparse(): syntax error in > **/var/www/pmapper-3.2/util/test_query_string.php on line **14 > > * *Warning: [MapServer Error]: msEvalExpression: Failed to parse > expression: ( "Okhtyrka" =~ /(M|m)(A|a)(D|d)(R|r)(I|i)(D|d)/ ) in > **/var/www/pmapper-3.2/util/test_query_string.php on line **14 > > * *Warning: [MapServer Error]: msyyparse(): syntax error in > **/var/www/pmapper-3.2/util/test_query_string.php on line **14 > > * *Warning: [MapServer Error]: msEvalExpression: Failed to parse > expression: ( "Yakymivka" =~ /(M|m)(A|a)(D|d)(R|r)(I|i)(D|d)/ ) in > **/var/www/pmapper-3.2/util/test_query_string.php on line **14 > > * *Warning: [MapServer Error]: msyyparse(): syntax error in > **/var/www/pmapper-3.2/util/test_query_string.php on line **14 > > *So then, i modify the file test_query_string.php again replacing > > *$qStr = '( ( "[name]" =~ /(M|m)(A|a)(D|d)(R|r)(I|i)(D|d)/ ) )';* > > for this > > *$qStr = '( ( "[name]" = "Madrid" ) )';* > > and the result was: > > *Array ( [GEONAMEID] => 3117735 [NAME] => Madrid [ASCIINAME] => Madrid > [ISO2_CODE] => ES [POPULATION] => 3117977 [GTOPO30] => 638 )* > > So the problem persists just the same...the only way that the search > returns results is by writing exactly as it figures on the layer data, > and it is not only on my project but in the default one as well....also, > i googled around and find an italian guy with the same problem and with > the same "configuration" (debian 5, pmapper 3.2, mapserver 5, etc). > And one last thing, i told you that this problem wasn't happening in the > same configuration but over windows server, well that was not entirely > right, the ms4w installed actually has the 3.1 version of pmapper. > So, here i am still with the same problem. Any thoughts? > best regards > > Carlos > > > 2009/3/25 Armin Burger <arm...@gm... > <mailto:arm...@gm...>> > > the directory for writing the php error log and the debug log must > be writable by the web server user www-data. if you check your > apache error logs you might see errors that it cannot write to > /var/www/. > > You could try setting this to the same dir as the tmp for creating > the map images, this must be writable by apache user, otherwise you > would not see any map. > > armin > > > > > On 25/03/2009 20:59, Carlos Cuello wrote: > > The pm_debug.log doesn't exist...not in the folder where it > suppose to be created (the same as the one where the php log is) > or in any other place. The debug level is set to 3 in the > config.ini file. > I'm using the debian package of the 3.2 version installed from > the repositories described on the wiki. > I know it doesn't make any sense that the log file don't exist, > but the pmapper is working just fine, except for the obvious > described problem > Any idea? > > carlos > > > 2009/3/25 Armin Burger <arm...@gm... > <mailto:arm...@gm...> <mailto:arm...@gm... > <mailto:arm...@gm...>>> > > > the debug log file is called 'pm_debug.log' and with level > set to 3 > it *will* create log output (~25 kB for opening the > application, I > have to remove some logging...). the script has been moved > outside > of the normal distribution sinve beta 4 and is available here: > > > http://svn.pmapper.net/trac/browser/pmapper/trunk/utils/test_query_string.php?format=txt > > armin > > > |