RE: [mapserver-users] Join from SHP file to PostgreSQL table

2010-11-29 Thread Fawcett, David (MPCA)
Flavio, 

Take a look at this page if you haven't:  http://mapserver.org/mapfile/join.html

Under 'Description', it mentions that you can't use joined data to 'affect the 
look of a map'.  I am pretty sure that this rules out your case.

David.

-Original Message-
From: mapserver-users-boun...@lists.osgeo.org 
[mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of flaviocarmo
Sent: Monday, November 29, 2010 8:44 AM
To: mapserver-users@lists.osgeo.org
Subject: [mapserver-users] Join from SHP file to PostgreSQL table


Hi,

I need to make a layer with a join between a shapefile and a non-spatial
table, stored on PostgreSQL. I've found this documentation
(http://mapserver.org/mapfile/join.html) but i could make it work, so, can u
guys help me looking at this configuration and tell me whats wrong?

LAYER
 NAME join_shape
 TYPE POLYGON
 STATUS DEFAULT
 DATA join_shapefile.shp
 CLASS
   NAME Joined Shapes
   STYLE
 OUTLINECOLOR 120 120 120
 COLOR 0 30 255
   END
 END
 TOLERANCE 20
 JOIN
   NAME teste
   CONNECTION dbname='testdb' host=GSERVER1 port=5432
user='test'
password='test' sslmode=disable
   CONNECTIONTYPE ogr
   TABLE 'test.nonspatial'
   FROM code
   TO code
   TYPE ONE-TO-ONE
 END
   END # layer

In this layer, i want to show only the geometrys in the shapefile
join_shapefile.shp that have a CODE column that is the same the CODE
column in the test.nonspatial table, stored on Postgre.

That is possible?

Thanks again

Regards,

Flavio Carmo
-- 
View this message in context: 
http://osgeo-org.1803224.n2.nabble.com/Join-from-SHP-file-to-PostgreSQL-table-tp5784531p5784531.html
Sent from the Mapserver - User mailing list archive at Nabble.com.
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Join from SHP file to PostgreSQL table

2010-11-29 Thread Jeff McKenna

Hello Flavio,

As noted on the page you referred to, this JOIN only works for executed 
queries...and I do not see a TEMPLATE in your layer.  Are you aware that 
this join only works for queries?  (see the examples in that documentation)


-jeff


--
Jeff McKenna
MapServer Consulting and Training Services
http://www.gatewaygeomatics.com/



On 10-11-29 10:43 AM, flaviocarmo wrote:


Hi,

I need to make a layer with a join between a shapefile and a non-spatial
table, stored on PostgreSQL. I've found this documentation
(http://mapserver.org/mapfile/join.html) but i could make it work, so, can u
guys help me looking at this configuration and tell me whats wrong?

LAYER
  NAME join_shape
  TYPE POLYGON
  STATUS DEFAULT
  DATA join_shapefile.shp
  CLASS
NAME Joined Shapes
STYLE
  OUTLINECOLOR 120 120 120
  COLOR 0 30 255
END
  END
  TOLERANCE 20
  JOIN
NAME teste
CONNECTION dbname='testdb' host=GSERVER1 port=5432
user='test'
password='test' sslmode=disable
CONNECTIONTYPE ogr
TABLE 'test.nonspatial'
FROM code
TO code
TYPE ONE-TO-ONE
  END
END # layer

In this layer, i want to show only the geometrys in the shapefile
join_shapefile.shp that have a CODE column that is the same the CODE
column in the test.nonspatial table, stored on Postgre.

That is possible?


___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Join from SHP file to PostgreSQL table

2010-11-29 Thread Carlos Ruiz
Flavio,

Column names are case sensitive, have you checked this ?

Cheers from México


IC Carlos Ruiz




From: flaviocarmo flavio.o.ca...@gmail.com
To: mapserver-users@lists.osgeo.org
Sent: Mon, November 29, 2010 8:43:44 AM
Subject: [mapserver-users] Join from SHP file to PostgreSQL table


Hi,

I need to make a layer with a join between a shapefile and a non-spatial
table, stored on PostgreSQL. I've found this documentation
(http://mapserver.org/mapfile/join.html) but i could make it work, so, can u
guys help me looking at this configuration and tell me whats wrong?

LAYER
 NAME join_shape
 TYPE POLYGON
 STATUS DEFAULT
 DATA join_shapefile.shp
 CLASS
   NAME Joined Shapes
   STYLE
 OUTLINECOLOR 120 120 120
 COLOR 0 30 255
   END
 END
 TOLERANCE 20
 JOIN
   NAME teste
   CONNECTION dbname='testdb' host=GSERVER1 port=5432
user='test'
password='test' sslmode=disable
   CONNECTIONTYPE ogr
   TABLE 'test.nonspatial'
   FROM code
   TO code
   TYPE ONE-TO-ONE
 END
   END # layer

In this layer, i want to show only the geometrys in the shapefile
join_shapefile.shp that have a CODE column that is the same the CODE
column in the test.nonspatial table, stored on Postgre.

That is possible?

Thanks again

Regards,

Flavio Carmo
-- 
View this message in context: 
http://osgeo-org.1803224.n2.nabble.com/Join-from-SHP-file-to-PostgreSQL-table-tp5784531p5784531.html

Sent from the Mapserver - User mailing list archive at Nabble.com.
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users



  ___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Join from SHP file to PostgreSQL table

2010-11-29 Thread Brent Fraser

Flavio,

  I think that if you have CONNECTIONTYPE OGR, the connection string 
must have PG: (unlike the native mapserver Postgres connections?):


CONNECTIONTYPE ogr
CONNECTION PG:dbname='testdb' host=GSERVER1 port=5432 user='test' 
password='test' sslmode=disable


If this works let me know, and I'll change the join documentation

Best Regards,
Brent Fraser


On 11/29/2010 7:43 AM, flaviocarmo wrote:

Hi,

I need to make a layer with a join between a shapefile and a non-spatial
table, stored on PostgreSQL. I've found this documentation
(http://mapserver.org/mapfile/join.html) but i could make it work, so, can u
guys help me looking at this configuration and tell me whats wrong?

LAYER
  NAME join_shape
  TYPE POLYGON
  STATUS DEFAULT
  DATA join_shapefile.shp
  CLASS
NAME Joined Shapes
STYLE
  OUTLINECOLOR 120 120 120
  COLOR 0 30 255
END
  END
  TOLERANCE 20
  JOIN
NAME teste
CONNECTION dbname='testdb' host=GSERVER1 port=5432
user='test'
password='test' sslmode=disable
CONNECTIONTYPE ogr
TABLE 'test.nonspatial'
FROM code
TO code
TYPE ONE-TO-ONE
  END
END # layer

In this layer, i want to show only the geometrys in the shapefile
join_shapefile.shp that have a CODE column that is the same the CODE
column in the test.nonspatial table, stored on Postgre.

That is possible?

Thanks again

Regards,

Flavio Carmo


___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users