>I'm not sure I've got you question, if you're trying to join two (or more) 
>POSTGIS tables, then you should do like this:
>
>    CONNECTIONTYPE postgis
>    CONNECTION "user=*** dbname=vngeo host=localhost password=*** port=***"
>    TYPE POINT
>    UNITS METERS
>    DATA "the_geom from (select vngeo_ristoranti.gid AS gid, 
>vngeo_ristoranti.gtype AS gtype, vngeo_ristoranti.gwebsites AS 
>gwebsites , vngeo_ristoranti.gname AS gname, vngeo_ristoranti.the_geom AS 
>the_geom , vngeo_attrvalue.value AS titolo from vngeo_ristoranti LEFT JOIN 
>vngeo_attrvalue ON vngeo_ristoranti.gid=vngeo_attrvalue.resid WHERE 
>vngeo_ristoranti.gwebsites LIKE '#9#' AND vngeo_attrvalue.lang = 'it' AND 
>vngeo_attrvalue.attrcode='titolo' AND 
>vngeo_attrvalue.layer='vngeo_ristoranti') AS foo USING UNIQUE gid USING 
>SRID=26591"

>In this case the main table is vngeo_ristoranti, the joined attributes table 
>is vngeo_attrvalue.

Thanks for your help.
I test your example and i wrote this:
DATA "the_geom from (select route.identifian AS identifian, route.nom AS nom, 
route.code_insee AS code_insee , route.oid AS oid, route.the_geom AS the_geom , 
commune.nomc AS nomc from route LEFT JOIN commune ON 
route.code_insee=commune.code_insee) AS route USING UNIQUE oid USING SRID=27582"

It's good when i use the query tool but when i use the search tool of pmapper 
on the window bottom, the join field (nomc) make error like this:

Warning: pg_exec() [function.pg-exec]: Query failed: ERROR: column "nomc" does 
not exist in C:\wwwroot\pmapper\incphp\query\squery.php on line 580

Warning: pg_numrows(): supplied argument is not a valid PostgreSQL result 
resource in C:\wwwroot\intranet\pmapper7\incphp\query\squery.php on line 581
      no result found.

      I think that error is in function pg_exec() in ../DB/pgsql.php because 
when i print (echo $query in ../incphp/squery.php line 580) the query setting 
of it, the result is:

      SELECT oid, xmin(box3d(the_geom)), ymin(box3d(the_geom)), 
xmax(box3d(the_geom)), ymax(box3d(the_geom)), identifian,nom,code_insee,nomc 
FROM route WHERE UPPER(nom) LIKE '%SABLES%'

      I don't know how to fix this function.
      Thanks a lot.

      FP 
-------------- section suivante --------------
Une pi?ce jointe HTML a ?t? enlev?e...
URL: 
http://www.faunalia.com/pipermail/pmapper-users/attachments/20051110/c415dadd/attachment-0001.htm
From [EMAIL PROTECTED]  Thu Nov 10 19:44:15 2005
From: [EMAIL PROTECTED] (Armin Burger)
Date: Thu Nov 10 19:44:53 2005
Subject: [Pmapper-users] RE: Pb with RESULT_JOIN postgis geometry to a
        postgresql data
In-Reply-To: <[EMAIL PROTECTED]>
References: <[EMAIL PROTECTED]>
Message-ID: <[EMAIL PROTECTED]>

Francois,

I checked the code. The reason why it's not working is that the 
attribute search on PostGIS layers does not consider the DATA definition 
including the join but just uses the fields in the geometry (main) 
table. That's because it's not so straightforward to parse the 
information of the DATA definition. A fast workaround would be to 
specify the join via a database view and use the view instead of the 
geometry table.

I will see how difficult it is to parse all the DATA information for the 
attribute search.

Armin

Fran?ois PINET wrote:
>  >I'm not sure I've got you question, if you're trying to join two (or 
> more)
>  >POSTGIS tables, then you should do like this:
>  >
>  >    CONNECTIONTYPE postgis
>  >    CONNECTION "user=*** dbname=vngeo host=localhost password=*** 
> port=***"
>  >    TYPE POINT
>  >    UNITS METERS
>  >    DATA "the_geom from (select vngeo_ristoranti.gid AS gid,
>  >vngeo_ristoranti.gtype AS gtype, vngeo_ristoranti.gwebsites AS
>  >gwebsites , vngeo_ristoranti.gname AS gname, vngeo_ristoranti.the_geom AS
>  >the_geom , vngeo_attrvalue.value AS titolo from vngeo_ristoranti LEFT 
> JOIN
>  >vngeo_attrvalue ON vngeo_ristoranti.gid=vngeo_attrvalue.resid WHERE
>  >vngeo_ristoranti.gwebsites LIKE '#9#' AND vngeo_attrvalue.lang = 'it' AND
>  >vngeo_attrvalue.attrcode='titolo' AND
>  >vngeo_attrvalue.layer='vngeo_ristoranti') AS foo USING UNIQUE gid USING
>  >SRID=26591"
> 
>  >In this case the main table is vngeo_ristoranti, the joined attributes 
> table
>  >is vngeo_attrvalue.
> Thanks for your help.
> I test your example and i wrote this:
> DATA "the_geom from (select route.identifian AS identifian, route.nom AS 
> nom, route.code_insee AS code_insee , route.oid AS oid, route.the_geom 
> AS the_geom , commune.nomc AS nomc from route LEFT JOIN commune ON 
> route.code_insee=commune.code_insee) AS route USING UNIQUE oid USING 
> SRID=27582"
>  
> It's good when i use the query tool but when i use the search tool of 
> pmapper on the window bottom, the join field (nomc) make error like this:
> 
> *Warning*: pg_exec() [function.pg-exec 
> <http://192.168.3.5/pmapper7/function.pg-exec>]: Query failed: ERROR: 
> column "nomc" does not exist in 
> *C:\wwwroot\pmapper\incphp\query\squery.php* on line *580*
> 
> *Warning*: pg_numrows(): supplied argument is not a valid PostgreSQL 
> result resource in 
> *C:\wwwroot\intranet\pmapper7\incphp\query\squery.php* on line *581*
> no result found.
>  
> I think that error is in function pg_exec() in ../DB/pgsql.php because 
> when i print (echo $query in ../incphp/squery.php line 580) the query 
> setting of it, the result is:
>  
> SELECT oid, xmin(box3d(the_geom)), ymin(box3d(the_geom)), 
> xmax(box3d(the_geom)), ymax(box3d(the_geom)), 
> identifian,nom,code_insee,nomc FROM route WHERE UPPER(nom) LIKE '%SABLES%'
> I don't know how to fix this function.
> Thanks a lot.
>  
> FP
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Pmapper-users mailing list
> [EMAIL PROTECTED]
> http://faunalia.it/cgi-bin/mailman/listinfo/pmapper-users

Reply via email to