Hello Paolo,
Here under a working example on how to connect to postgresql/postgis table
(used with Cartoweb) :
LAYER
NAME "tree"
TYPE POINT
STATUS ON
METADATA
"id_attribute_string" "id_object"
"query_returned_attributes" "id_object"
END
SYMBOLSCALE 1000
CONNECTIONTYPE postgis
CONNECTION "user=xxxx password=yyyy dbname=zzzz host=localhost port=5432"
DATA "the_geom from tree using unique id_object using srid=21781"
TEMPLATE "blabla"
LABELITEM "id_object"
MAXSCALEDENOM 4990
SYMBOLSCALEDENOM 1000
POSTLABELCACHE ON
CLASS
STYLE
SYMBOL "circle"
COLOR 255 0 125
MINSIZE 1
SIZE 6
MAXSIZE 10
END
END
END
You could also try to use QGIS and check if you are able to connect to your
postgresql table.
Hope that helps!
BaK
On Tue, Mar 13, 2012 at 8:53 AM, VT <[email protected]> wrote:
> Hi,
> I'm trying to join a postgres table to shapefile layer (one-to-many) but I
> get no response from identify tool.
> Connection to postgres works correctly in a separate php file:
>
> $connstr = "dbname=cbam_db user=postgres password=mypass host=localhost
> port=5432";
>
> $dbh = pg_connect($connstr);
> if ($dbh)
> {
> //do nothing... go on...
> echo "...ok...";
> }
> else
> {
> echo "....troubles....<br>";
> }
> $sql2 = "SELECT * FROM cbam_table";
> $stat2 = pg_exec($dbh, $sql2);
> $data2 = pg_fetch_array($stat2, $i2);
> for ($i2 = 0; $i2 < $rows2; $i2++)
> echo $data2["categoria"];
> }
>
>
>
> **********
>
> this is my mapfile piece:
>
>
> LAYER
> NAME "censnew"
> TYPE line
> DATA "censnew"
> CLASSITEM "Categ"
> TEMPLATE void
> METADATA
> "DESCRIPTION" "Reticolo di competenza"
> "RESULT_FIELDS" "NOME,COMUNE,CATEG,LUNGH"
> "RESULT_HEADERS" "Nome,Comune,Categoria,Lunghezza(m)"
> "ows_title" "Reticolo di competenza"
> "RESULT_JOIN" "pgsql://
>
> postgres:[email protected]:5432/cbam_db||cbam_table@categoria@1@categoria||CATEG||1<http://postgres:[email protected]:5432/cbam_db%7C%7Ccbam_table@categoria@1@categoria%7C%7CCATEG%7C%7C1>
> "
> END
> ...
> ...
>
> postgresql table "cbam_table" has one text column named "categoria".
> I tried with localhost instead of 127.0.0.1 but query window doesn't
> display. All works fine if I comment "RESULT_JOIN" row.
>
> Where am i wrong?
>
> thank you very much
>
> Paolo
>
> ------------------------------------------------------------------------------
> Keep Your Developer Skills Current with LearnDevNow!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-d2d
> _______________________________________________
> pmapper-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/pmapper-users
>
------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
pmapper-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pmapper-users