search.xml with postgis - invalidJSON in pmapper v4.2.0

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

search.xml with postgis - invalidJSON in pmapper v4.2.0

Suman
Hi all Pmapper User
I am using ms4w v3.0.6. , mapserver v6.0.3, PHP v5.4.3. and pmapper 4.2.0.
When I run a query on a PostGIS table I can see suggestions but when i click them no any response.
This is my inline search.xml
--------------------------------------------------------------------------------------------------
<searchlist version="1.0">
        <dataroot>$</dataroot>
       
        <searchitem name="Utility_and_services" description="Utility and services suggest">
            <layer type="postgis" name="Utility_and_services">
                <field type="s" name="name" description="Utility and services suggest" wildcard="2">
                    <definition type="suggest" connectiontype="db" minlength="1" startleft="1" sort="asc" dependfld="gid">
                        <dsn encoding="UTF-8">pgsql://postgres:postgres@localhost:5432/gisdb</dsn>
                                                <sql>SELECT DISTINCT name FROM public.tbl_utility WHERE name ~* '^[search]' ORDER BY name</sql>
                                        </definition>
                </field> 
            </layer>
        </searchitem>
    </searchlist>
---------------------------------------------------------------------------------------------------

and i found in chrome console invalid JSON

Invalid JSON: <br />
Warning:  pg_query(): Query failed: ERROR:  function xmin(box3d) does not exist
LINE 2:                          xmin(box3d(geom)),
                                 ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts. in C:\ms4w\apps\newbrt\biratnagar\incphp\query\squery.php on line 712<br />
<br />
Warning:  pg_numrows() expects parameter 1 to be resource, boolean given in C:\ms4w\apps\newbrt\biratnagar\incphp\query\squery.php on line 716<br />
{"mode":"search", "queryResult":0}                                                                               pm_cjs.js:38

http://pmapper-users-p-mapper-users-mailing-list.993774.n3.nabble.com/pmapper-users-search-xml-with-postgis-invalidJSON-td2790207.html#a4025076
i tried all above given suggestions but i cant solve this problem.. plz help me..

suman
Reply | Threaded
Open this post in threaded view
|

Re: [pmapper-users] search.xml with postgis - invalidJSON in pmapper v4.2.0

Serge Claudio Rafanoharana
Dear Suman,

I just had a quick view of you code and I think you should make the name
"lower case"; and refer to this hint:
":HINT:  No function matches the given name and argument types. You might
need
to add explicit type casts."

Please have a look at: http://svn.pmapper.net/trac/wiki/DocManualsearch

Cheers,
Serge

On Sun, Mar 3, 2013 at 5:17 PM, Suman <[hidden email]> wrote:

> Hi all Pmapper User
> I am using ms4w v3.0.6. , mapserver v6.0.3, PHP v5.4.3. and pmapper 4.2.0.
> When I run a query on a PostGIS table I can see suggestions but when i
> click
> them no any response.
> This is my inline search.xml
>
> --------------------------------------------------------------------------------------------------
> <searchlist version="1.0">
>         <dataroot>$</dataroot>
>
>         <searchitem name="Utility_and_services" description="Utility and
> services suggest">
>             <layer type="postgis" name="Utility_and_services">
>                 <field type="s" name="name" description="Utility and
> services suggest" wildcard="2">
>                     <definition type="suggest" connectiontype="db"
> minlength="1" startleft="1" sort="asc" dependfld="gid">
>                         <dsn
> encoding="UTF-8">pgsql://postgres:postgres@localhost:5432/gisdb</dsn>
>                                                 <sql>SELECT DISTINCT name
> FROM public.tbl_utility WHERE name ~* '^[search]' ORDER BY name</sql>
>                                         </definition>
>                 </field>
>             </layer>
>         </searchitem>
>     </searchlist>
>
> ---------------------------------------------------------------------------------------------------
>
> and i found in chrome console invalid JSON
>
> Invalid JSON: <br />
> Warning:  pg_query(): Query failed: ERROR:  function xmin(box3d) does not
> exist
> LINE 2:                          xmin(box3d(geom)),
>                                  ^
> HINT:  No function matches the given name and argument types. You might
> need
> to add explicit type casts. in
> C:\ms4w\apps\newbrt\biratnagar\incphp\query\squery.php on line 712<br />
> <br />
> Warning:  pg_numrows() expects parameter 1 to be resource, boolean given in
> C:\ms4w\apps\newbrt\biratnagar\incphp\query\squery.php on line 716<br />
> {"mode":"search", "queryResult":0}
> pm_cjs.js:38
>
>
> http://pmapper-users-p-mapper-users-mailing-list.993774.n3.nabble.com/pmapper-users-search-xml-with-postgis-invalidJSON-td2790207.html#a4025076
> <
> http://pmapper-users-p-mapper-users-mailing-list.993774.n3.nabble.com/pmapper-users-search-xml-with-postgis-invalidJSON-td2790207.html#a4025076
> >
> i tried all above given suggestions but i cant solve this problem.. plz
> help
> me..
>
> suman
>
>
>
> --
> View this message in context:
> http://pmapper-users-p-mapper-users-mailing-list.993774.n3.nabble.com/search-xml-with-postgis-invalidJSON-in-pmapper-v4-2-0-tp4025077.html
> Sent from the pmapper-users -- p.mapper users mailing list mailing list
> archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_feb
> _______________________________________________
> pmapper-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/pmapper-users
>



--
Serge
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
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] search.xml with postgis - invalidJSON in pmapper v4.2.0

Suman
thanx for your reply but i have got the solution.. it was from armin.

http://pmapper-users-p-mapper-users-mailing-list.993774.n3.nabble.com/pmapper-users-search-xml-with-postgis-invalidJSON-td2790207.html

thanx for your support.

suman
Reply | Threaded
Open this post in threaded view
|

[pmapper-users] Internal Server Error with postgis search

Pedro Venâncio
In reply to this post by Serge Claudio Rafanoharana
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