[pmapper-users] Internal Server Error with postgis search

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

[pmapper-users] Internal Server Error with postgis search

Pedro Venâncio


Hi all,

Some new information about the error that I reported yesterday.

A search to a layer on the same database, that works well, shows the following result on pm_debug.log:

[18-Sep-2013 13:15:47] P.MAPPER debug info
XML->//definition
 SimpleXMLElement Object
(
    [@attributes] => Array
        (
            [type] => suggest
            [connectiontype] => db
            [minlength] => 1
            [startleft] => 0
            [sort] => asc
        )

    [comment] => SimpleXMLElement Object
        (
        )

    [dsn] => pgsql://xxx:xxxxxxx@localhost/pinhel_20
    [sql] => SELECT DISTINCT rua FROM data.ruas WHERE rua ~* '[search]' ORDER BY rua
)

[18-Sep-2013 13:15:50] P.MAPPER debug info
request
 Array
(
    [searchitem] => n_rua2
    [fldname] => rua
    [q] => norto
    [limit] => 0
    [timestamp] => 1379502950458
)

[18-Sep-2013 13:15:50] P.MAPPER debug info
Parameters for attribute search file: suggest.php function: __construct
 Array
(
    [type] => db
    [sort] => asc
    [minlength] => 1
    [regexleft] =>
    [startleft] => 0
    [dependfld] =>
    [dsn] => pgsql://xxx:xxxxxxx@localhost/pinhel_20
    [encoding] => UTF-8
    [sql] => SELECT DISTINCT rua FROM data.ruas WHERE rua ~* '[search]' ORDER BY rua
    [dependfldval] =>
)

[18-Sep-2013 13:15:50] P.MAPPER debug info
 SELECT DISTINCT rua FROM data.ruas WHERE rua ~* 'norto' ORDER BY rua
[18-Sep-2013 13:15:51] P.MAPPER debug info
Searcharray in search.php->getSearchParameters()
 Array
(
    [rua] => Rua Norton de Matos
    [mode] => search
)

[18-Sep-2013 13:15:51] P.MAPPER debug info
Parameters for searchArray
file: query.php->q_execAttributeQuery

 Array
(
    [rua] => Rua Norton de Matos
    [mode] => search
)

[18-Sep-2013 13:15:51] P.MAPPER debug info
Parameters for searchParams
file: query.php->q_execAttributeQuery
 Array
(
    [layerName] => ruas
    [layerType] => postgis
    [firstFld] => rua
    [qStr] =>   rua ILIKE '%Rua Norton de Matos%'
)

[18-Sep-2013 13:15:51] P.MAPPER debug info
P.MAPPER-DEBUG: squery.php/dumpPGQueryResults() - SQL Cmd:
 SELECT n_rua,
                         ST_xmin(box3d(the_geom)),
                         ST_ymin(box3d(the_geom)),
                         ST_xmax(box3d(the_geom)),
                         ST_ymax(box3d(the_geom)),
                         n_rua,rua,comprimento
                    FROM ruas
                   WHERE   rua ILIKE '%Rua Norton de Matos%'
                   LIMIT 301








The layer that gives the Internal Server Error shows, on pm_debug.log:

[18-Sep-2013 13:15:18] P.MAPPER debug info
XML->//definition
 SimpleXMLElement Object
(
    [@attributes] => Array
        (
            [type] => suggest
            [connectiontype] => db
            [minlength] => 1
            [startleft] => 0
            [sort] => asc
        )

    [comment] => SimpleXMLElement Object
        (
        )

    [dsn] => pgsql://xxx:xxxxxxx@localhost/cartografia_oficial
    [sql] => SELECT DISTINCT arteria FROM rede_viaria.geopnh WHERE arteria ~* '[search]' ORDER BY arteria
)

[18-Sep-2013 13:15:20] P.MAPPER debug info
request
 Array
(
    [searchitem] => n_rede_viaria
    [fldname] => arteria
    [q] => no
    [limit] => 0
    [timestamp] => 1379502920339
)

[18-Sep-2013 13:15:20] P.MAPPER debug info
Parameters for attribute search file: suggest.php function: __construct
 Array
(
    [type] => db
    [sort] => asc
    [minlength] => 1
    [regexleft] =>
    [startleft] => 0
    [dependfld] =>
    [dsn] => pgsql://xxx:xxxxxxx@localhost/cartografia_oficial
    [encoding] => UTF-8
    [sql] => SELECT DISTINCT arteria FROM rede_viaria.geopnh WHERE arteria ~* '[search]' ORDER BY arteria
    [dependfldval] =>
)

[18-Sep-2013 13:15:20] P.MAPPER debug info
 SELECT DISTINCT arteria FROM rede_viaria.geopnh WHERE arteria ~* 'no' ORDER BY arteria
[18-Sep-2013 13:15:21] P.MAPPER debug info
request
 Array
(
    [searchitem] => n_rede_viaria
    [fldname] => arteria
    [q] => norto
    [limit] => 0
    [timestamp] => 1379502921111
)

[18-Sep-2013 13:15:21] P.MAPPER debug info
Parameters for attribute search file: suggest.php function: __construct
 Array
(
    [type] => db
    [sort] => asc
    [minlength] => 1
    [regexleft] =>
    [startleft] => 0
    [dependfld] =>
    [dsn] => pgsql://xxx:xxxxxxx@localhost/cartografia_oficial
    [encoding] => UTF-8
    [sql] => SELECT DISTINCT arteria FROM rede_viaria.geopnh WHERE arteria ~* '[search]' ORDER BY arteria
    [dependfldval] =>
)

[18-Sep-2013 13:15:21] P.MAPPER debug info
 SELECT DISTINCT arteria FROM rede_viaria.geopnh WHERE arteria ~* 'norto' ORDER BY arteria
[18-Sep-2013 13:15:22] P.MAPPER debug info
Searcharray in search.php->getSearchParameters()
 Array
(
    [arteria] => R NORTON DE MATOS
    [mode] => search
)




and on php_errors.log:

[18-Sep-2013 11:15:22 UTC] PHP Warning:  mapObj::getLayerByName(): getLayerByName failed for : geopnh
, in /var/pmapper/incphp/query/search.php on line 116
[18-Sep-2013 11:15:22 UTC] PHP Fatal error:  Call to a member function getMetaData() on a non-object in /var/pmapper/incphp/query/search.php on line 213                                                                                                                                    





I have already tried the solutions proposed in this thread
http://sourceforge.net/mailarchive/forum.php?thread_name=18419253.post%40talk.nabble.com&forum_name=pmapper-users 

but unsuccessfully.

Anyone have suggestions?


Thank you very much!

Best regards,
Pedro






____________________________________

----- Original Message -----
From: Pedro Venâncio
To: pmapper-users
Sent: Tuesday, September 17, 2013 6:55 PM
Subject: Internal Server Error with postgis search



Hi,

I'm using (yet) pmapper 4.2 and I'm having difficulty creating a postgis search. Despite being using pmapper 4.2, I've done this update http://svn.pmapper.net/trac/changeset/1272 and I have other searches working properly.

The search that does not work is this one:

        <searchitem name="n_rede_viaria" description="Rede Viaria">
            <layer type="postgis" name="geopnh">
                <field type="s" name="arteria" description="Nome da Arteria" wildcard="0">
                    <definition type="suggest" connectiontype="db" minlength="1" startleft="0" sort="asc">
                    <dsn encoding="UTF-8">pgsql://xxxxxx:xxxxxxxxxx@localhost/cartografia_oficial</dsn>
                    <sql>SELECT DISTINCT arteria FROM rede_viaria.geopnh WHERE arteria ~* '[search]' ORDER BY arteria</sql>
                    </definition>
                </field>
            </layer>
        </searchitem>



With this, the suggestions appears as I write the name, but when I click on one of the suggestions I get (on firebug) an Internal Server Error - pm_cjs.js (linha 38)

POST http://localhost/incphp/xajax/x_info.php    500 Internal Server Error    6ms

and on Send (Post): &findlist=0&arteria=R NORTON DE MATOS&=Consultar&searchitem=n_rede_viaria&mode=search


May it be a result of the content of "arteria" field be in uppercase? How can I get around this?


Thank you very much!

Best regards,

Pedro

------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13.
http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
_______________________________________________
pmapper-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/pmapper-users
Reply | Threaded
Open this post in threaded view
|

Re: [pmapper-users] Internal Server Error with postgis search

Thomas
Hi,

Could you send the layer definition in the mapfile please (layer named
"geopnh")?

Thomas

Le 18/09/2013 14:02, Pedro Venâncio a écrit :

>
> Hi all,
>
> Some new information about the error that I reported yesterday.
>
> A search to a layer on the same database, that works well, shows the following result on pm_debug.log:
>
> [18-Sep-2013 13:15:47] P.MAPPER debug info
> XML->//definition
>   SimpleXMLElement Object
> (
>      [@attributes] => Array
>          (
>              [type] => suggest
>              [connectiontype] => db
>              [minlength] => 1
>              [startleft] => 0
>              [sort] => asc
>          )
>
>      [comment] => SimpleXMLElement Object
>          (
>          )
>
>      [dsn] => pgsql://xxx:xxxxxxx@localhost/pinhel_20
>      [sql] => SELECT DISTINCT rua FROM data.ruas WHERE rua ~* '[search]' ORDER BY rua
> )
>
> [18-Sep-2013 13:15:50] P.MAPPER debug info
> request
>   Array
> (
>      [searchitem] => n_rua2
>      [fldname] => rua
>      [q] => norto
>      [limit] => 0
>      [timestamp] => 1379502950458
> )
>
> [18-Sep-2013 13:15:50] P.MAPPER debug info
> Parameters for attribute search file: suggest.php function: __construct
>   Array
> (
>      [type] => db
>      [sort] => asc
>      [minlength] => 1
>      [regexleft] =>
>      [startleft] => 0
>      [dependfld] =>
>      [dsn] => pgsql://xxx:xxxxxxx@localhost/pinhel_20
>      [encoding] => UTF-8
>      [sql] => SELECT DISTINCT rua FROM data.ruas WHERE rua ~* '[search]' ORDER BY rua
>      [dependfldval] =>
> )
>
> [18-Sep-2013 13:15:50] P.MAPPER debug info
>   SELECT DISTINCT rua FROM data.ruas WHERE rua ~* 'norto' ORDER BY rua
> [18-Sep-2013 13:15:51] P.MAPPER debug info
> Searcharray in search.php->getSearchParameters()
>   Array
> (
>      [rua] => Rua Norton de Matos
>      [mode] => search
> )
>
> [18-Sep-2013 13:15:51] P.MAPPER debug info
> Parameters for searchArray
> file: query.php->q_execAttributeQuery
>
>   Array
> (
>      [rua] => Rua Norton de Matos
>      [mode] => search
> )
>
> [18-Sep-2013 13:15:51] P.MAPPER debug info
> Parameters for searchParams
> file: query.php->q_execAttributeQuery
>   Array
> (
>      [layerName] => ruas
>      [layerType] => postgis
>      [firstFld] => rua
>      [qStr] =>   rua ILIKE '%Rua Norton de Matos%'
> )
>
> [18-Sep-2013 13:15:51] P.MAPPER debug info
> P.MAPPER-DEBUG: squery.php/dumpPGQueryResults() - SQL Cmd:
>   SELECT n_rua,
>                           ST_xmin(box3d(the_geom)),
>                           ST_ymin(box3d(the_geom)),
>                           ST_xmax(box3d(the_geom)),
>                           ST_ymax(box3d(the_geom)),
>                           n_rua,rua,comprimento
>                      FROM ruas
>                     WHERE   rua ILIKE '%Rua Norton de Matos%'
>                     LIMIT 301
>
>
>
>
>
>
>
>
> The layer that gives the Internal Server Error shows, on pm_debug.log:
>
> [18-Sep-2013 13:15:18] P.MAPPER debug info
> XML->//definition
>   SimpleXMLElement Object
> (
>      [@attributes] => Array
>          (
>              [type] => suggest
>              [connectiontype] => db
>              [minlength] => 1
>              [startleft] => 0
>              [sort] => asc
>          )
>
>      [comment] => SimpleXMLElement Object
>          (
>          )
>
>      [dsn] => pgsql://xxx:xxxxxxx@localhost/cartografia_oficial
>      [sql] => SELECT DISTINCT arteria FROM rede_viaria.geopnh WHERE arteria ~* '[search]' ORDER BY arteria
> )
>
> [18-Sep-2013 13:15:20] P.MAPPER debug info
> request
>   Array
> (
>      [searchitem] => n_rede_viaria
>      [fldname] => arteria
>      [q] => no
>      [limit] => 0
>      [timestamp] => 1379502920339
> )
>
> [18-Sep-2013 13:15:20] P.MAPPER debug info
> Parameters for attribute search file: suggest.php function: __construct
>   Array
> (
>      [type] => db
>      [sort] => asc
>      [minlength] => 1
>      [regexleft] =>
>      [startleft] => 0
>      [dependfld] =>
>      [dsn] => pgsql://xxx:xxxxxxx@localhost/cartografia_oficial
>      [encoding] => UTF-8
>      [sql] => SELECT DISTINCT arteria FROM rede_viaria.geopnh WHERE arteria ~* '[search]' ORDER BY arteria
>      [dependfldval] =>
> )
>
> [18-Sep-2013 13:15:20] P.MAPPER debug info
>   SELECT DISTINCT arteria FROM rede_viaria.geopnh WHERE arteria ~* 'no' ORDER BY arteria
> [18-Sep-2013 13:15:21] P.MAPPER debug info
> request
>   Array
> (
>      [searchitem] => n_rede_viaria
>      [fldname] => arteria
>      [q] => norto
>      [limit] => 0
>      [timestamp] => 1379502921111
> )
>
> [18-Sep-2013 13:15:21] P.MAPPER debug info
> Parameters for attribute search file: suggest.php function: __construct
>   Array
> (
>      [type] => db
>      [sort] => asc
>      [minlength] => 1
>      [regexleft] =>
>      [startleft] => 0
>      [dependfld] =>
>      [dsn] => pgsql://xxx:xxxxxxx@localhost/cartografia_oficial
>      [encoding] => UTF-8
>      [sql] => SELECT DISTINCT arteria FROM rede_viaria.geopnh WHERE arteria ~* '[search]' ORDER BY arteria
>      [dependfldval] =>
> )
>
> [18-Sep-2013 13:15:21] P.MAPPER debug info
>   SELECT DISTINCT arteria FROM rede_viaria.geopnh WHERE arteria ~* 'norto' ORDER BY arteria
> [18-Sep-2013 13:15:22] P.MAPPER debug info
> Searcharray in search.php->getSearchParameters()
>   Array
> (
>      [arteria] => R NORTON DE MATOS
>      [mode] => search
> )
>
>
>
>
> and on php_errors.log:
>
> [18-Sep-2013 11:15:22 UTC] PHP Warning:  mapObj::getLayerByName(): getLayerByName failed for : geopnh
> , in /var/pmapper/incphp/query/search.php on line 116
> [18-Sep-2013 11:15:22 UTC] PHP Fatal error:  Call to a member function getMetaData() on a non-object in /var/pmapper/incphp/query/search.php on line 213
>
>
>
>
>
> I have already tried the solutions proposed in this thread
> http://sourceforge.net/mailarchive/forum.php?thread_name=18419253.post%40talk.nabble.com&forum_name=pmapper-users
>
> but unsuccessfully.
>
> Anyone have suggestions?
>
>
> Thank you very much!
>
> Best regards,
> Pedro
>
>
>
>
>
>
> ____________________________________
>
> ----- Original Message -----
> From: Pedro Venâncio
> To: pmapper-users
> Sent: Tuesday, September 17, 2013 6:55 PM
> Subject: Internal Server Error with postgis search
>
>
>
> Hi,
>
> I'm using (yet) pmapper 4.2 and I'm having difficulty creating a postgis search. Despite being using pmapper 4.2, I've done this update http://svn.pmapper.net/trac/changeset/1272 and I have other searches working properly.
>
> The search that does not work is this one:
>
>          <searchitem name="n_rede_viaria" description="Rede Viaria">
>              <layer type="postgis" name="geopnh">
>                  <field type="s" name="arteria" description="Nome da Arteria" wildcard="0">
>                      <definition type="suggest" connectiontype="db" minlength="1" startleft="0" sort="asc">
>                      <dsn encoding="UTF-8">pgsql://xxxxxx:xxxxxxxxxx@localhost/cartografia_oficial</dsn>
>                      <sql>SELECT DISTINCT arteria FROM rede_viaria.geopnh WHERE arteria ~* '[search]' ORDER BY arteria</sql>
>                      </definition>
>                  </field>
>              </layer>
>          </searchitem>
>
>
>
> With this, the suggestions appears as I write the name, but when I click on one of the suggestions I get (on firebug) an Internal Server Error - pm_cjs.js (linha 38)
>
> POST http://localhost/incphp/xajax/x_info.php    500 Internal Server Error    6ms
>
> and on Send (Post): &findlist=0&arteria=R NORTON DE MATOS&=Consultar&searchitem=n_rede_viaria&mode=search
>
>
> May it be a result of the content of "arteria" field be in uppercase? How can I get around this?
>
>
> Thank you very much!
>
> Best regards,
>
> Pedro
>
> ------------------------------------------------------------------------------
> LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
> 1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
> 2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
> Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13.
> http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
> _______________________________________________
> pmapper-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/pmapper-users
>
>

--


Thomas RAFFIN
Chef de Projet Internet
[hidden email] <mailto:[hidden email]> Sirap <http://sirap.fr> Tel
: 04 75 72 84 10
Fax : 04 75 70 07 98
Rue Paul Louis Héroult - BP 253
26106 Romans cedex

------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13.
http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
_______________________________________________
pmapper-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/pmapper-users
Reply | Threaded
Open this post in threaded view
|

Re: [pmapper-users] Internal Server Error with postgis search

Pedro Venâncio
Hi Thomas,

Yes, of course. Here it is:

LAYER
    NAME "rede_viaria"
    STATUS DEFAULT
    TYPE LINE
    CONNECTIONTYPE postgis
    PROCESSING "CLOSE_CONNECTION=DEFER"
    CONNECTION "user=xxx password=xxxxxxx dbname=cartografia_oficial host=localhost options='-c client_encoding=LATIN1'"
    DATA "the_geom from rede_viaria.geopnh using unique id_0"
    TOLERANCE 3
    TOLERANCEUNITS pixels
    TEMPLATE void   
    PROJECTION
    "init=epsg:3763"
    END
    METADATA
    "DESCRIPTION" "Rede Viaria"
    "RESULT_FIELDS" "id_0,arteria,r_cp4,r_cp3"
    "RESULT_HEADERS" "ID,Nome da Rua,CP 4,CP 3"
    "ows_title"      "Rede Viaria"
    END
    CLASS
    Name 'rede_viaria'
    COLOR 250 0 0
    END
  END




Thank you very much!





----- Original Message -----
From: Thomas RAFFIN

Hi,

Could you send the layer definition in the mapfile please (layer named
"geopnh")?

Thomas

Le 18/09/2013 14:02, Pedro Venâncio a écrit :

>
> Hi all,
>
> Some new information about the error that I reported yesterday.
>
> A search to a layer on the same database, that works well, shows the following result on pm_debug.log:
>
> [18-Sep-2013 13:15:47] P.MAPPER debug info
> XML->//definition
>   SimpleXMLElement Object
> (
>      [@attributes] => Array
>          (
>              [type] => suggest
>              [connectiontype] => db
>              [minlength] => 1
>              [startleft] => 0
>              [sort] => asc
>          )
>
>      [comment] => SimpleXMLElement Object
>          (
>          )
>
>      [dsn] => pgsql://xxx:xxxxxxx@localhost/pinhel_20
>      [sql] => SELECT DISTINCT rua FROM data.ruas WHERE rua ~* '[search]' ORDER BY rua
> )
>
> [18-Sep-2013 13:15:50] P.MAPPER debug info
> request
>   Array
> (
>      [searchitem] => n_rua2
>      [fldname] => rua
>      [q] => norto
>      [limit] => 0
>      [timestamp] => 1379502950458
> )
>
> [18-Sep-2013 13:15:50] P.MAPPER debug info
> Parameters for attribute search file: suggest.php function: __construct
>   Array
> (
>      [type] => db
>      [sort] => asc
>      [minlength] => 1
>      [regexleft] =>
>      [startleft] => 0
>      [dependfld] =>
>      [dsn] => pgsql://xxx:xxxxxxx@localhost/pinhel_20
>      [encoding] => UTF-8
>      [sql] => SELECT DISTINCT rua FROM data.ruas WHERE rua ~* '[search]' ORDER BY rua
>      [dependfldval] =>
> )
>
> [18-Sep-2013 13:15:50] P.MAPPER debug info
>   SELECT DISTINCT rua FROM data.ruas WHERE rua ~* 'norto' ORDER BY rua
> [18-Sep-2013 13:15:51] P.MAPPER debug info
> Searcharray in search.php->getSearchParameters()
>   Array
> (
>      [rua] => Rua Norton de Matos
>      [mode] => search
> )
>
> [18-Sep-2013 13:15:51] P.MAPPER debug info
> Parameters for searchArray
> file: query.php->q_execAttributeQuery
>
>   Array
> (
>      [rua] => Rua Norton de Matos
>      [mode] => search
> )
>
> [18-Sep-2013 13:15:51] P.MAPPER debug info
> Parameters for searchParams
> file: query.php->q_execAttributeQuery
>   Array
> (
>      [layerName] => ruas
>      [layerType] => postgis
>      [firstFld] => rua
>      [qStr] =>   rua ILIKE '%Rua Norton de Matos%'
> )
>
> [18-Sep-2013 13:15:51] P.MAPPER debug info
> P.MAPPER-DEBUG: squery.php/dumpPGQueryResults() - SQL Cmd:
>   SELECT n_rua,
>                           ST_xmin(box3d(the_geom)),
>                           ST_ymin(box3d(the_geom)),
>                           ST_xmax(box3d(the_geom)),
>                           ST_ymax(box3d(the_geom)),
>                           n_rua,rua,comprimento
>                      FROM ruas
>                     WHERE   rua ILIKE '%Rua Norton de Matos%'
>                     LIMIT 301
>
>
>
>
>
>
>
>
> The layer that gives the Internal Server Error shows, on pm_debug.log:
>
> [18-Sep-2013 13:15:18] P.MAPPER debug info
> XML->//definition
>   SimpleXMLElement Object
> (
>      [@attributes] => Array
>          (
>              [type] => suggest
>              [connectiontype] => db
>              [minlength] => 1
>              [startleft] => 0
>              [sort] => asc
>          )
>
>      [comment] => SimpleXMLElement Object
>          (
>          )
>
>      [dsn] => pgsql://xxx:xxxxxxx@localhost/cartografia_oficial
>      [sql] => SELECT DISTINCT arteria FROM rede_viaria.geopnh WHERE arteria ~* '[search]' ORDER BY arteria
> )
>
> [18-Sep-2013 13:15:20] P.MAPPER debug info
> request
>   Array
> (
>      [searchitem] => n_rede_viaria
>      [fldname] => arteria
>      [q] => no
>      [limit] => 0
>      [timestamp] => 1379502920339
> )
>
> [18-Sep-2013 13:15:20] P.MAPPER debug info
> Parameters for attribute search file: suggest.php function: __construct
>   Array
> (
>      [type] => db
>      [sort] => asc
>      [minlength] => 1
>      [regexleft] =>
>      [startleft] => 0
>      [dependfld] =>
>      [dsn] => pgsql://xxx:xxxxxxx@localhost/cartografia_oficial
>      [encoding] => UTF-8
>      [sql] => SELECT DISTINCT arteria FROM rede_viaria.geopnh WHERE arteria ~* '[search]' ORDER BY arteria
>      [dependfldval] =>
> )
>
> [18-Sep-2013 13:15:20] P.MAPPER debug info
>   SELECT DISTINCT arteria FROM rede_viaria.geopnh WHERE arteria ~* 'no' ORDER BY arteria
> [18-Sep-2013 13:15:21] P.MAPPER debug info
> request
>   Array
> (
>      [searchitem] => n_rede_viaria
>      [fldname] => arteria
>      [q] => norto
>      [limit] => 0
>      [timestamp] => 1379502921111
> )
>
> [18-Sep-2013 13:15:21] P.MAPPER debug info
> Parameters for attribute search file: suggest.php function: __construct
>   Array
> (
>      [type] => db
>      [sort] => asc
>      [minlength] => 1
>      [regexleft] =>
>      [startleft] => 0
>      [dependfld] =>
>      [dsn] => pgsql://xxx:xxxxxxx@localhost/cartografia_oficial
>      [encoding] => UTF-8
>      [sql] => SELECT DISTINCT arteria FROM rede_viaria.geopnh WHERE arteria ~* '[search]' ORDER BY arteria
>      [dependfldval] =>
> )
>
> [18-Sep-2013 13:15:21] P.MAPPER debug info
>   SELECT DISTINCT arteria FROM rede_viaria.geopnh WHERE arteria ~* 'norto' ORDER BY arteria
> [18-Sep-2013 13:15:22] P.MAPPER debug info
> Searcharray in search.php->getSearchParameters()
>   Array
> (
>      [arteria] => R NORTON DE MATOS
>      [mode] => search
> )
>
>
>
>
> and on php_errors.log:
>
> [18-Sep-2013 11:15:22 UTC] PHP Warning:  mapObj::getLayerByName(): getLayerByName failed for : geopnh
> , in /var/pmapper/incphp/query/search.php on line 116
> [18-Sep-2013 11:15:22 UTC] PHP Fatal error:  Call to a member function getMetaData() on a non-object in /var/pmapper/incphp/query/search.php on line 213
>
>
>
>
>
> I have already tried the solutions proposed in this thread
> http://sourceforge.net/mailarchive/forum.php?thread_name=18419253.post%40talk.nabble.com&forum_name=pmapper-users
>
> but unsuccessfully.
>
> Anyone have suggestions?
>
>
> Thank you very much!
>
> Best regards,
> Pedro
>
>
>
>
>
>
> ____________________________________
>
> ----- Original Message -----
> From: Pedro Venâncio
> To: pmapper-users
> Sent: Tuesday, September 17, 2013 6:55 PM
> Subject: Internal Server Error with postgis search
>
>
>
> Hi,
>
> I'm using (yet) pmapper 4.2 and I'm having difficulty creating a postgis search. Despite being using pmapper 4.2, I've done this update http://svn.pmapper.net/trac/changeset/1272 and I have other searches working properly.
>
> The search that does not work is this one:
>
>          <searchitem name="n_rede_viaria" description="Rede Viaria">
>              <layer type="postgis" name="geopnh">
>                  <field type="s" name="arteria" description="Nome da Arteria" wildcard="0">
>                      <definition type="suggest" connectiontype="db" minlength="1" startleft="0" sort="asc">
>                      <dsn encoding="UTF-8">pgsql://xxxxxx:xxxxxxxxxx@localhost/cartografia_oficial</dsn>
>                      <sql>SELECT DISTINCT arteria FROM rede_viaria.geopnh WHERE arteria ~* '[search]' ORDER BY arteria</sql>
>                      </definition>
>                  </field>
>              </layer>
>          </searchitem>
>
>
>
> With this, the suggestions appears as I write the name, but when I click on one of the suggestions I get (on firebug) an Internal Server Error - pm_cjs.js (linha 38)
>
> POST http://localhost/incphp/xajax/x_info.php    500 Internal Server Error    6ms
>
> and on Send (Post): &findlist=0&arteria=R NORTON DE MATOS&=Consultar&searchitem=n_rede_viaria&mode=search
>
>
> May it be a result of the content of "arteria" field be in uppercase? How can I get around this?
>
>
> Thank you very much!
>
> Best regards,
>
> Pedro
>
> ------------------------------------------------------------------------------
> LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
> 1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
> 2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
> Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13.
> http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
> _______________________________________________
> pmapper-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/pmapper-users
>
>

--


Thomas RAFFIN
Chef de Projet Internet
[hidden email] <mailto:[hidden email]>     Sirap <http://sirap.fr>     Tel
: 04 75 72 84 10
Fax : 04 75 70 07 98
Rue Paul Louis Héroult - BP 253
26106 Romans cedex

------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13.
http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
_______________________________________________
pmapper-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/pmapper-users 

------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13.
http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
_______________________________________________
pmapper-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/pmapper-users
Reply | Threaded
Open this post in threaded view
|

Re: [pmapper-users] Internal Server Error with postgis search

Thomas
The layer name is not "geopnh" but "rede_viaria".

You have to replace in your search.xml:
<layer type="postgis" name="geopnh">
with:
<layer type="postgis" name="rede_viaria">

Bye

Thomas



Le 18/09/2013 15:19, Pedro Venâncio a écrit :

> Hi Thomas,
>
> Yes, of course. Here it is:
>
> LAYER
>      NAME "rede_viaria"
>      STATUS DEFAULT
>      TYPE LINE
>      CONNECTIONTYPE postgis
>      PROCESSING "CLOSE_CONNECTION=DEFER"
>      CONNECTION "user=xxx password=xxxxxxx dbname=cartografia_oficial host=localhost options='-c client_encoding=LATIN1'"
>      DATA "the_geom from rede_viaria.geopnh using unique id_0"
>      TOLERANCE 3
>      TOLERANCEUNITS pixels
>      TEMPLATE void
>      PROJECTION
>      "init=epsg:3763"
>      END
>      METADATA
>      "DESCRIPTION" "Rede Viaria"
>      "RESULT_FIELDS" "id_0,arteria,r_cp4,r_cp3"
>      "RESULT_HEADERS" "ID,Nome da Rua,CP 4,CP 3"
>      "ows_title"      "Rede Viaria"
>      END
>      CLASS
>      Name 'rede_viaria'
>      COLOR 250 0 0
>      END
>    END
>
>
>
>
> Thank you very much!
>
>
>
>
>
> ----- Original Message -----
> From: Thomas RAFFIN
>
> Hi,
>
> Could you send the layer definition in the mapfile please (layer named
> "geopnh")?
>
> Thomas
>
> Le 18/09/2013 14:02, Pedro Venâncio a écrit :
>> Hi all,
>>
>> Some new information about the error that I reported yesterday.
>>
>> A search to a layer on the same database, that works well, shows the following result on pm_debug.log:
>>
>> [18-Sep-2013 13:15:47] P.MAPPER debug info
>> XML->//definition
>>     SimpleXMLElement Object
>> (
>>        [@attributes] => Array
>>            (
>>                [type] => suggest
>>                [connectiontype] => db
>>                [minlength] => 1
>>                [startleft] => 0
>>                [sort] => asc
>>            )
>>
>>        [comment] => SimpleXMLElement Object
>>            (
>>            )
>>
>>        [dsn] => pgsql://xxx:xxxxxxx@localhost/pinhel_20
>>        [sql] => SELECT DISTINCT rua FROM data.ruas WHERE rua ~* '[search]' ORDER BY rua
>> )
>>
>> [18-Sep-2013 13:15:50] P.MAPPER debug info
>> request
>>     Array
>> (
>>        [searchitem] => n_rua2
>>        [fldname] => rua
>>        [q] => norto
>>        [limit] => 0
>>        [timestamp] => 1379502950458
>> )
>>
>> [18-Sep-2013 13:15:50] P.MAPPER debug info
>> Parameters for attribute search file: suggest.php function: __construct
>>     Array
>> (
>>        [type] => db
>>        [sort] => asc
>>        [minlength] => 1
>>        [regexleft] =>
>>        [startleft] => 0
>>        [dependfld] =>
>>        [dsn] => pgsql://xxx:xxxxxxx@localhost/pinhel_20
>>        [encoding] => UTF-8
>>        [sql] => SELECT DISTINCT rua FROM data.ruas WHERE rua ~* '[search]' ORDER BY rua
>>        [dependfldval] =>
>> )
>>
>> [18-Sep-2013 13:15:50] P.MAPPER debug info
>>     SELECT DISTINCT rua FROM data.ruas WHERE rua ~* 'norto' ORDER BY rua
>> [18-Sep-2013 13:15:51] P.MAPPER debug info
>> Searcharray in search.php->getSearchParameters()
>>     Array
>> (
>>        [rua] => Rua Norton de Matos
>>        [mode] => search
>> )
>>
>> [18-Sep-2013 13:15:51] P.MAPPER debug info
>> Parameters for searchArray
>> file: query.php->q_execAttributeQuery
>>
>>     Array
>> (
>>        [rua] => Rua Norton de Matos
>>        [mode] => search
>> )
>>
>> [18-Sep-2013 13:15:51] P.MAPPER debug info
>> Parameters for searchParams
>> file: query.php->q_execAttributeQuery
>>     Array
>> (
>>        [layerName] => ruas
>>        [layerType] => postgis
>>        [firstFld] => rua
>>        [qStr] =>   rua ILIKE '%Rua Norton de Matos%'
>> )
>>
>> [18-Sep-2013 13:15:51] P.MAPPER debug info
>> P.MAPPER-DEBUG: squery.php/dumpPGQueryResults() - SQL Cmd:
>>     SELECT n_rua,
>>                             ST_xmin(box3d(the_geom)),
>>                             ST_ymin(box3d(the_geom)),
>>                             ST_xmax(box3d(the_geom)),
>>                             ST_ymax(box3d(the_geom)),
>>                             n_rua,rua,comprimento
>>                        FROM ruas
>>                       WHERE   rua ILIKE '%Rua Norton de Matos%'
>>                       LIMIT 301
>>
>>
>>
>>
>>
>>
>>
>>
>> The layer that gives the Internal Server Error shows, on pm_debug.log:
>>
>> [18-Sep-2013 13:15:18] P.MAPPER debug info
>> XML->//definition
>>     SimpleXMLElement Object
>> (
>>        [@attributes] => Array
>>            (
>>                [type] => suggest
>>                [connectiontype] => db
>>                [minlength] => 1
>>                [startleft] => 0
>>                [sort] => asc
>>            )
>>
>>        [comment] => SimpleXMLElement Object
>>            (
>>            )
>>
>>        [dsn] => pgsql://xxx:xxxxxxx@localhost/cartografia_oficial
>>        [sql] => SELECT DISTINCT arteria FROM rede_viaria.geopnh WHERE arteria ~* '[search]' ORDER BY arteria
>> )
>>
>> [18-Sep-2013 13:15:20] P.MAPPER debug info
>> request
>>     Array
>> (
>>        [searchitem] => n_rede_viaria
>>        [fldname] => arteria
>>        [q] => no
>>        [limit] => 0
>>        [timestamp] => 1379502920339
>> )
>>
>> [18-Sep-2013 13:15:20] P.MAPPER debug info
>> Parameters for attribute search file: suggest.php function: __construct
>>     Array
>> (
>>        [type] => db
>>        [sort] => asc
>>        [minlength] => 1
>>        [regexleft] =>
>>        [startleft] => 0
>>        [dependfld] =>
>>        [dsn] => pgsql://xxx:xxxxxxx@localhost/cartografia_oficial
>>        [encoding] => UTF-8
>>        [sql] => SELECT DISTINCT arteria FROM rede_viaria.geopnh WHERE arteria ~* '[search]' ORDER BY arteria
>>        [dependfldval] =>
>> )
>>
>> [18-Sep-2013 13:15:20] P.MAPPER debug info
>>     SELECT DISTINCT arteria FROM rede_viaria.geopnh WHERE arteria ~* 'no' ORDER BY arteria
>> [18-Sep-2013 13:15:21] P.MAPPER debug info
>> request
>>     Array
>> (
>>        [searchitem] => n_rede_viaria
>>        [fldname] => arteria
>>        [q] => norto
>>        [limit] => 0
>>        [timestamp] => 1379502921111
>> )
>>
>> [18-Sep-2013 13:15:21] P.MAPPER debug info
>> Parameters for attribute search file: suggest.php function: __construct
>>     Array
>> (
>>        [type] => db
>>        [sort] => asc
>>        [minlength] => 1
>>        [regexleft] =>
>>        [startleft] => 0
>>        [dependfld] =>
>>        [dsn] => pgsql://xxx:xxxxxxx@localhost/cartografia_oficial
>>        [encoding] => UTF-8
>>        [sql] => SELECT DISTINCT arteria FROM rede_viaria.geopnh WHERE arteria ~* '[search]' ORDER BY arteria
>>        [dependfldval] =>
>> )
>>
>> [18-Sep-2013 13:15:21] P.MAPPER debug info
>>     SELECT DISTINCT arteria FROM rede_viaria.geopnh WHERE arteria ~* 'norto' ORDER BY arteria
>> [18-Sep-2013 13:15:22] P.MAPPER debug info
>> Searcharray in search.php->getSearchParameters()
>>     Array
>> (
>>        [arteria] => R NORTON DE MATOS
>>        [mode] => search
>> )
>>
>>
>>
>>
>> and on php_errors.log:
>>
>> [18-Sep-2013 11:15:22 UTC] PHP Warning:  mapObj::getLayerByName(): getLayerByName failed for : geopnh
>> , in /var/pmapper/incphp/query/search.php on line 116
>> [18-Sep-2013 11:15:22 UTC] PHP Fatal error:  Call to a member function getMetaData() on a non-object in /var/pmapper/incphp/query/search.php on line 213
>>
>>
>>
>>
>>
>> I have already tried the solutions proposed in this thread
>> http://sourceforge.net/mailarchive/forum.php?thread_name=18419253.post%40talk.nabble.com&forum_name=pmapper-users
>>
>> but unsuccessfully.
>>
>> Anyone have suggestions?
>>
>>
>> Thank you very much!
>>
>> Best regards,
>> Pedro
>>
>>
>>
>>
>>
>>
>> ____________________________________
>>
>> ----- Original Message -----
>> From: Pedro Venâncio
>> To: pmapper-users
>> Sent: Tuesday, September 17, 2013 6:55 PM
>> Subject: Internal Server Error with postgis search
>>
>>
>>
>> Hi,
>>
>> I'm using (yet) pmapper 4.2 and I'm having difficulty creating a postgis search. Despite being using pmapper 4.2, I've done this update http://svn.pmapper.net/trac/changeset/1272 and I have other searches working properly.
>>
>> The search that does not work is this one:
>>
>>            <searchitem name="n_rede_viaria" description="Rede Viaria">
>>                <layer type="postgis" name="geopnh">
>>                    <field type="s" name="arteria" description="Nome da Arteria" wildcard="0">
>>                        <definition type="suggest" connectiontype="db" minlength="1" startleft="0" sort="asc">
>>                        <dsn encoding="UTF-8">pgsql://xxxxxx:xxxxxxxxxx@localhost/cartografia_oficial</dsn>
>>                        <sql>SELECT DISTINCT arteria FROM rede_viaria.geopnh WHERE arteria ~* '[search]' ORDER BY arteria</sql>
>>                        </definition>
>>                    </field>
>>                </layer>
>>            </searchitem>
>>
>>
>>
>> With this, the suggestions appears as I write the name, but when I click on one of the suggestions I get (on firebug) an Internal Server Error - pm_cjs.js (linha 38)
>>
>> POST http://localhost/incphp/xajax/x_info.php    500 Internal Server Error    6ms
>>
>> and on Send (Post): &findlist=0&arteria=R NORTON DE MATOS&=Consultar&searchitem=n_rede_viaria&mode=search
>>
>>
>> May it be a result of the content of "arteria" field be in uppercase? How can I get around this?
>>
>>
>> Thank you very much!
>>
>> Best regards,
>>
>> Pedro
>>
>> ------------------------------------------------------------------------------
>> LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
>> 1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
>> 2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
>> Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13.
>> http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
>> _______________________________________________
>> pmapper-users mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/pmapper-users
>>
>>

--


Thomas RAFFIN
Chef de Projet Internet
[hidden email] <mailto:[hidden email]> Sirap <http://sirap.fr> Tel
: 04 75 72 84 10
Fax : 04 75 70 07 98
Rue Paul Louis Héroult - BP 253
26106 Romans cedex

------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13.
http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
_______________________________________________
pmapper-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/pmapper-users
Reply | Threaded
Open this post in threaded view
|

Re: [pmapper-users] Internal Server Error with postgis search

Pedro Venâncio
Here is how a person feel stupid... :-/ I mistook the layer name in the mapfile with the layer name in postgis.

Thank you very much Thomas!!

Best regards,
Pedro






----- Original Message -----
From: Thomas RAFFIN

The layer name is not "geopnh" but "rede_viaria".

You have to replace in your search.xml:
<layer type="postgis" name="geopnh">
with:
<layer type="postgis" name="rede_viaria">

Bye

Thomas



Le 18/09/2013 15:19, Pedro Venâncio a écrit :

> Hi Thomas,
>
> Yes, of course. Here it is:
>
> LAYER
>      NAME "rede_viaria"
>      STATUS DEFAULT
>      TYPE LINE
>      CONNECTIONTYPE postgis
>      PROCESSING "CLOSE_CONNECTION=DEFER"
>      CONNECTION "user=xxx password=xxxxxxx dbname=cartografia_oficial host=localhost options='-c client_encoding=LATIN1'"
>      DATA "the_geom from rede_viaria.geopnh using unique id_0"
>      TOLERANCE 3
>      TOLERANCEUNITS pixels
>      TEMPLATE void
>      PROJECTION
>      "init=epsg:3763"
>      END
>      METADATA
>      "DESCRIPTION" "Rede Viaria"
>      "RESULT_FIELDS" "id_0,arteria,r_cp4,r_cp3"
>      "RESULT_HEADERS" "ID,Nome da Rua,CP 4,CP 3"
>      "ows_title"      "Rede Viaria"
>      END
>      CLASS
>      Name 'rede_viaria'
>      COLOR 250 0 0
>      END
>    END
>
>
>
>
> Thank you very much!
>
>
>
>
>
> ----- Original Message -----
> From: Thomas RAFFIN
>
> Hi,
>
> Could you send the layer definition in the mapfile please (layer named
> "geopnh")?
>
> Thomas
>
> Le 18/09/2013 14:02, Pedro Venâncio a écrit :
>> Hi all,
>>
>> Some new information about the error that I reported yesterday.
>>
>> A search to a layer on the same database, that works well, shows the following result on pm_debug.log:
>>
>> [18-Sep-2013 13:15:47] P.MAPPER debug info
>> XML->//definition
>>     SimpleXMLElement Object
>> (
>>        [@attributes] => Array
>>            (
>>                [type] => suggest
>>                [connectiontype] => db
>>                [minlength] => 1
>>                [startleft] => 0
>>                [sort] => asc
>>            )
>>
>>        [comment] => SimpleXMLElement Object
>>            (
>>            )
>>
>>        [dsn] => pgsql://xxx:xxxxxxx@localhost/pinhel_20
>>        [sql] => SELECT DISTINCT rua FROM data.ruas WHERE rua ~* '[search]' ORDER BY rua
>> )
>>
>> [18-Sep-2013 13:15:50] P.MAPPER debug info
>> request
>>     Array
>> (
>>        [searchitem] => n_rua2
>>        [fldname] => rua
>>        [q] => norto
>>        [limit] => 0
>>        [timestamp] => 1379502950458
>> )
>>
>> [18-Sep-2013 13:15:50] P.MAPPER debug info
>> Parameters for attribute search file: suggest.php function: __construct
>>     Array
>> (
>>        [type] => db
>>        [sort] => asc
>>        [minlength] => 1
>>        [regexleft] =>
>>        [startleft] => 0
>>        [dependfld] =>
>>        [dsn] => pgsql://xxx:xxxxxxx@localhost/pinhel_20
>>        [encoding] => UTF-8
>>        [sql] => SELECT DISTINCT rua FROM data.ruas WHERE rua ~* '[search]' ORDER BY rua
>>        [dependfldval] =>
>> )
>>
>> [18-Sep-2013 13:15:50] P.MAPPER debug info
>>     SELECT DISTINCT rua FROM data.ruas WHERE rua ~* 'norto' ORDER BY rua
>> [18-Sep-2013 13:15:51] P.MAPPER debug info
>> Searcharray in search.php->getSearchParameters()
>>     Array
>> (
>>        [rua] => Rua Norton de Matos
>>        [mode] => search
>> )
>>
>> [18-Sep-2013 13:15:51] P.MAPPER debug info
>> Parameters for searchArray
>> file: query.php->q_execAttributeQuery
>>
>>     Array
>> (
>>        [rua] => Rua Norton de Matos
>>        [mode] => search
>> )
>>
>> [18-Sep-2013 13:15:51] P.MAPPER debug info
>> Parameters for searchParams
>> file: query.php->q_execAttributeQuery
>>     Array
>> (
>>        [layerName] => ruas
>>        [layerType] => postgis
>>        [firstFld] => rua
>>        [qStr] =>   rua ILIKE '%Rua Norton de Matos%'
>> )
>>
>> [18-Sep-2013 13:15:51] P.MAPPER debug info
>> P.MAPPER-DEBUG: squery.php/dumpPGQueryResults() - SQL Cmd:
>>     SELECT n_rua,
>>                             ST_xmin(box3d(the_geom)),
>>                             ST_ymin(box3d(the_geom)),
>>                             ST_xmax(box3d(the_geom)),
>>                             ST_ymax(box3d(the_geom)),
>>                             n_rua,rua,comprimento
>>                        FROM ruas
>>                       WHERE   rua ILIKE '%Rua Norton de Matos%'
>>                       LIMIT 301
>>
>>
>>
>>
>>
>>
>>
>>
>> The layer that gives the Internal Server Error shows, on pm_debug.log:
>>
>> [18-Sep-2013 13:15:18] P.MAPPER debug info
>> XML->//definition
>>     SimpleXMLElement Object
>> (
>>        [@attributes] => Array
>>            (
>>                [type] => suggest
>>                [connectiontype] => db
>>                [minlength] => 1
>>                [startleft] => 0
>>                [sort] => asc
>>            )
>>
>>        [comment] => SimpleXMLElement Object
>>            (
>>            )
>>
>>        [dsn] => pgsql://xxx:xxxxxxx@localhost/cartografia_oficial
>>        [sql] => SELECT DISTINCT arteria FROM rede_viaria.geopnh WHERE arteria ~* '[search]' ORDER BY arteria
>> )
>>
>> [18-Sep-2013 13:15:20] P.MAPPER debug info
>> request
>>     Array
>> (
>>        [searchitem] => n_rede_viaria
>>        [fldname] => arteria
>>        [q] => no
>>        [limit] => 0
>>        [timestamp] => 1379502920339
>> )
>>
>> [18-Sep-2013 13:15:20] P.MAPPER debug info
>> Parameters for attribute search file: suggest.php function: __construct
>>     Array
>> (
>>        [type] => db
>>        [sort] => asc
>>        [minlength] => 1
>>        [regexleft] =>
>>        [startleft] => 0
>>        [dependfld] =>
>>        [dsn] => pgsql://xxx:xxxxxxx@localhost/cartografia_oficial
>>        [encoding] => UTF-8
>>        [sql] => SELECT DISTINCT arteria FROM rede_viaria.geopnh WHERE arteria ~* '[search]' ORDER BY arteria
>>        [dependfldval] =>
>> )
>>
>> [18-Sep-2013 13:15:20] P.MAPPER debug info
>>     SELECT DISTINCT arteria FROM rede_viaria.geopnh WHERE arteria ~* 'no' ORDER BY arteria
>> [18-Sep-2013 13:15:21] P.MAPPER debug info
>> request
>>     Array
>> (
>>        [searchitem] => n_rede_viaria
>>        [fldname] => arteria
>>        [q] => norto
>>        [limit] => 0
>>        [timestamp] => 1379502921111
>> )
>>
>> [18-Sep-2013 13:15:21] P.MAPPER debug info
>> Parameters for attribute search file: suggest.php function: __construct
>>     Array
>> (
>>        [type] => db
>>        [sort] => asc
>>        [minlength] => 1
>>        [regexleft] =>
>>        [startleft] => 0
>>        [dependfld] =>
>>        [dsn] => pgsql://xxx:xxxxxxx@localhost/cartografia_oficial
>>        [encoding] => UTF-8
>>        [sql] => SELECT DISTINCT arteria FROM rede_viaria.geopnh WHERE arteria ~* '[search]' ORDER BY arteria
>>        [dependfldval] =>
>> )
>>
>> [18-Sep-2013 13:15:21] P.MAPPER debug info
>>     SELECT DISTINCT arteria FROM rede_viaria.geopnh WHERE arteria ~* 'norto' ORDER BY arteria
>> [18-Sep-2013 13:15:22] P.MAPPER debug info
>> Searcharray in search.php->getSearchParameters()
>>     Array
>> (
>>        [arteria] => R NORTON DE MATOS
>>        [mode] => search
>> )
>>
>>
>>
>>
>> and on php_errors.log:
>>
>> [18-Sep-2013 11:15:22 UTC] PHP Warning:  mapObj::getLayerByName(): getLayerByName failed for : geopnh
>> , in /var/pmapper/incphp/query/search.php on line 116
>> [18-Sep-2013 11:15:22 UTC] PHP Fatal error:  Call to a member function getMetaData() on a non-object in /var/pmapper/incphp/query/search.php on line 213
>>
>>
>>
>>
>>
>> I have already tried the solutions proposed in this thread
>> http://sourceforge.net/mailarchive/forum.php?thread_name=18419253.post%40talk.nabble.com&forum_name=pmapper-users
>>
>> but unsuccessfully.
>>
>> Anyone have suggestions?
>>
>>
>> Thank you very much!
>>
>> Best regards,
>> Pedro
>>
>>
>>
>>
>>
>>
>> ____________________________________
>>
>> ----- Original Message -----
>> From: Pedro Venâncio
>> To: pmapper-users
>> Sent: Tuesday, September 17, 2013 6:55 PM
>> Subject: Internal Server Error with postgis search
>>
>>
>>
>> Hi,
>>
>> I'm using (yet) pmapper 4.2 and I'm having difficulty creating a postgis search. Despite being using pmapper 4.2, I've done this update http://svn.pmapper.net/trac/changeset/1272 and I have other searches working properly.
>>
>> The search that does not work is this one:
>>
>>            <searchitem name="n_rede_viaria" description="Rede Viaria">
>>                <layer type="postgis" name="geopnh">
>>                    <field type="s" name="arteria" description="Nome da Arteria" wildcard="0">
>>                        <definition type="suggest" connectiontype="db" minlength="1" startleft="0" sort="asc">
>>                        <dsn encoding="UTF-8">pgsql://xxxxxx:xxxxxxxxxx@localhost/cartografia_oficial</dsn>
>>                        <sql>SELECT DISTINCT arteria FROM rede_viaria.geopnh WHERE arteria ~* '[search]' ORDER BY arteria</sql>
>>                        </definition>
>>                    </field>
>>                </layer>
>>            </searchitem>
>>
>>
>>
>> With this, the suggestions appears as I write the name, but when I click on one of the suggestions I get (on firebug) an Internal Server Error - pm_cjs.js (linha 38)
>>
>> POST http://localhost/incphp/xajax/x_info.php    500 Internal Server Error    6ms
>>
>> and on Send (Post): &findlist=0&arteria=R NORTON DE MATOS&=Consultar&searchitem=n_rede_viaria&mode=search
>>
>>
>> May it be a result of the content of "arteria" field be in uppercase? How can I get around this?
>>
>>
>> Thank you very much!
>>
>> Best regards,
>>
>> Pedro
>>
>> ------------------------------------------------------------------------------
>> LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
>> 1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
>> 2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
>> Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13.
>> http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
>> _______________________________________________
>> pmapper-users mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/pmapper-users
>>
>>

--


Thomas RAFFIN
Chef de Projet Internet
[hidden email] <mailto:[hidden email]>     Sirap <http://sirap.fr>     Tel
: 04 75 72 84 10
Fax : 04 75 70 07 98
Rue Paul Louis Héroult - BP 253
26106 Romans cedex

------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13.
http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
_______________________________________________
pmapper-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/pmapper-users 

------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13.
http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
_______________________________________________
pmapper-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/pmapper-users