MapServer, PostGIS, Subquery with JOIN, WMS GetFeatureInfo / Followup Question

Jeff Hoffmann jeff at PROPERTYKEY.COM
Fri Feb 24 08:09:22 EST 2006


Nick Floersch wrote:
>  
> 
> ------------------------------------------------------------------------
> *From:* Nick Floersch
> *Sent:* Friday, February 24, 2006 5:03 AM
> *To:* Nick Floersch
> *Subject:* RE: MapServer, PostGIS, Subquery with JOIN, WMS 
> GetFeatureInfo / Followup Question
> 
> After my just previous post to the list, I decided to try my alternative 
> solution...
>  
>  "" Before anyone suggests the solution of using a view to encapsulate 
> my JOIN so it need not be in the subquery, I'll just say that I am aware 
> I could try that approach (though I have not yet done so), but 
> my curiosity has been piqued by this problem as it is, so I'm hoping to 
> find out more about the JOINs in subqueries issue I have. I would also 
> really love to know how MapServer gets the attribute columns for PostGIS 
> layers. ""

This is on my "figure out some day myself" list, too.  I'm doing the 
view thing right now, but I'd like to not have to create views for 
everything.

> ---snip---
>  
> The only thing I can think of is... does the PostGIS connector require 
> the table to have OIDs? It looks that way.

Yes.  It needs some unique field in order to randomly access an 
individual rows, it just so happens that OID is a convenient way to get 
that in most cases.  You can also specify your own unique column name 
with "using unique <column name>" if your view doesn't have an OID 
column but you have some other key you can use.  I just pull in the OID 
from the main geometry-containing table when I define the view.

--
Jeff Hoffmann
jeff at propertykey.com



More information about the mapserver-users mailing list