Andreas

have a look here

http://svn.pmapper.net/trac/browser/pmapper/trunk/config/dev/search.xml

If you do not need things like options/suggest then the definition
should be quite straightforward:

<searchitem name="cities_pg" description="City PG">
    <layer type="postgis" name="cities10000eu_pg">
        <field type="s" name="name" description="City"  wildcard="1" />
    </layer>
</searchitem>

For options/suggest username/passwd need to be defined in the dsn like

<dsn encoding="UTF-8">pgsql://username:[EMAIL PROTECTED]/gisdb</dsn>


armin


On Fri, Oct 17, 2008 at 9:23 AM, Andreas Haux
<[EMAIL PROTECTED]> wrote:
> Hi,
>
> p.mapper is great - and I am experimenting for quite a while but
> didn't found out how exactly to define a search funktion in the
> search.xml file using PostGIS; the examples show the connection
> without sending a username and password.
>
> e.g.:
> Database name ist testdb
> Tablename is testfile
> Username is testperson
> Password is testpassword
>
> and I would like to select all the geometries where the field NAME is
> <searchstring>
>
> Here is your example where I have tried to fill this informations in,
> but I failed - I would simply like to establish a connection but did
> not know how to handle username and password (since the XML file is
> open to the public I could/would not include it here):
>
>     <searchitem name="testsearch" description="Only a test">
>         <layer type="postgis" name="testfile">
>             <field type="s" name="name" description="City"
> wildcard="2">
>                 <definition type="suggest" connectiontype="db"
> sort="asc" minlength="1" dependfld="cmcncd">
>                     <dsn encoding="UTF-8">pgsql://
> postgres:[EMAIL PROTECTED]/testdb</dsn>
>                     <sql>SELECT DISTINCT name FROM testtfile WHERE
> name ~* '^[search]' ORDER BY name</sql>
>                     </definition>
>             </field>
>         </layer>
>     </searchitem>
>
> As far as I understand I don't need the suggest type in my case
> instead of receiving the results immediately at the map. So the most
> simple example how to write a request with PostGIS would be appreciated!
>
> Thanks for your help!
>
> Regards
> Andreas
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> pmapper-users mailing list
> pmapper-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/pmapper-users
>

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
pmapper-users mailing list
pmapper-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pmapper-users

Reply via email to