Hi Kristof,

On May 7, 2008, at 2:53 AM, [EMAIL PROTECTED] wrote:
> I read in the mail archive that you don't need to specify geometry  
> field(s) for PostGIS datasources. They are all defined in  
> 'geometry_columns' table.
>

You workaround sounds like a good route - that way you know exactly  
what you are getting.

However, as far as I have experienced this behavior you describe is  
standard as documented.  I've been using a PostGIS table with both  
point and polygon fields in the same projection. When both are defined  
in the geometry columns table the point field is used by default by  
Mapnik (it is listed first in the geometry_columns table by row and  
first by column in the spatial table). When I delete the polygon  
record in the geometry_columns, then the Polygon field is used (I then  
have to remember to change to appropriate symbolization for polygons  
not points).

Since I have a debug build of mapnik I can see this output:

When both fields are defined in the geometry_columns  the point field  
is used, called 'point':

select asbinary(point) as geom from mytable where point &&  
setSRID('BOX3D(-123.670455932617 43.5280494689941,-122.010025024414  
45.5669860839844)'::box3d,4326)

And when the point record is deleted from the geometry_columns, and  
only the 'poly' (Polygon Field) is defined:

select asbinary(poly) as geom from mytable where poly &&  
setSRID('BOX3D(-123.670455932617 43.5280494689941,-122.010025024414  
45.5669860839844)'::box3d,4326)

Are your two geometry fields of the same type? Are they of the same  
projection?

If you could send a small testcase sql insert of your data perhaps we  
could debug further.

Cheers,

Dane

ps. Thanks for your work on the XML schema - that's helpful to new  
users.


>
> I get an empty map when I use a PostGIS table with multiple geometry  
> fields. (I checked that only 1 column is registered in the  
> 'geometry_columns' table.)
> I have a workaround now, using a PostGIS view that has only one of  
> the geometry columns of the originating table.
> If this behaviour is 'as designed', it is usefull to mention this  
> somewhere in the (future) documentation. If not, this should be  
> fixed ;-)
>
> Kristof Vydt
>
> _______________________________________________
> Mapnik-users mailing list
> [email protected]
> https://lists.berlios.de/mailman/listinfo/mapnik-users

_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users

Reply via email to