[postgis] Viewing mapserver itasca demo layer using postgis

Tyler Mitchell tmitchell at lignum.com
Mon Jan 21 15:18:50 PST 2002


Good explanation thank you.
The final syntax you gave me for the expression statement worked perfectly!
You should update: http://postgis.refractions.net/docs/x324.html#AEN357
since it doesn't include the single quotes around the field name.  That's
what prevented me from getting it to work.


                                                                                                                     
                    Paul Ramsey                                                                                      
                    <pramsey at refrac       To:     postgis at yahoogroups.com                                            
                    tions.net>            cc:                                                                        
                                          Fax to:                                                                    
                    01/21/2002            Subject:     Re: [postgis] Viewing mapserver itasca demo layer using       
                    02:20 PM               postgis                                                                   
                    Please respond                                                                                   
                    to postgis                                                                                       
                                                                                                                     
                                                                                                                     




The 'FILTER' is applied to the actual database by appending it to the
SQL statement. So the 'FILTER' must be a valid chuck of SQL logic. The
'EXPRESSION' is applied by mapserver once the dataset is already
retrieved, so it follows mapserver expression rules, as given in the
mapserver doco. For your example, you are doing a string comparison. The
mapserver doco seems to indicate (and do not hate me for telling you
this, yes, it is really obscure) that ('[cty_name]' eq 'Itasca') will
work.
Paul

Tyler Mitchell wrote:
>
> No change.  I get all the other shapefile layers showing just fine, but
> none from this file.
> All I've done was run the shp2pgsql, load the sql that it generated, then
> "grant select on ctybdpy to public".
> Then made my changes in the map file according to the online postgis
docs.
> Is there any projection stuff I need to do?
> Has anyone else went through this process, or have a database table that
I
> could load to try this with.  I'm not convinced I loaded postgis right -
> but I did it by the book and didn't get any errors.  Anything I should
> check?
>
>
>                     Paul Ramsey
>                     <pramsey at refrac       To:     postgis at yahoogroups.com
>                     tions.net>            cc:
>                                           Fax to:
>                     01/21/2002            Subject:     Re: [postgis]
Viewing mapserver itasca demo layer using
>                     12:14 PM               postgis
>                     Please respond
>                     to postgis
>
>
>
> Change your STATUS to DEFAULT and see if that helps.
> P.
>
> Tyler Mitchell wrote:
> >
> > Okay, I've used shp2pgsql to put the ctybdpy2.shp into a table with the
> > same name.  But I don't get any information on my map.  I've compiled
> > postgresql and postgis from source and successfully compiled mapserver
to
> > support it.
> >
> > Here are my various settings - can you spy a problem?
> >
> > BTW - the only thing I have in my error_log is: gd-png warning: alpha
> > channel not supported which I think is some other problem (I think it's
> > from my conversion of gif->png I did earlier).
> > -----------------------
> > Here's the layer in the map file (it's the first layer):
> >
> > LAYER
> >   CONNECTIONTYPE postgis
> >   NAME "ctybdpy2"
> >   CONNECTION "dbname=testgis"
> >   DATA "the_geom from ctybdpy2"
> >   TYPE POLYGON
> >   STATUS ON
> >   CLASS
> >     EXPRESSION ([cty_name] = 'Itasca')
> >     OUTLINECOLOR 128 128 128
> >     COLOR 225 225 185
> >   END
> >   CLASS # every other county in the state
> >     EXPRESSION /./
> >     OUTLINECOLOR 128 128 128
> >     COLOR 255 255 255
> >   END
> >   METADATA
> >     WMS_TITLE "County Boundary"
> >     WMS_ABSTRACT "Itasca County boundary shapefile. See
> > http://deli.dnr.state.mn
> >     WMS_SRS "EPSG:26915"
> >   END
> > END
> > -----------------------
> > Here are the various listings from pgsql.  Is it a permissions problem?
> I
> > put in permissions for nobody, is that necessary?
> >
> > testgis=# \dp
> >           Access permissions for database "testgis"
> >      Relation     |            Access permissions
> > ------------------+-------------------------------------------
> >  ctybdpy2         | {"=r","mitchtj=r","root=arwR","nobody=r"}
> >  geometry_columns |
> >  spatial_ref_sys  |
> > (7 rows)
> >
> > testgis=# \d ctybdpy2
> >              Table "ctybdpy2"
> >  Attribute |       Type        | Modifier
> > -----------+-------------------+----------
> >  gid       | integer           |
> >  area      | double precision  |
> >  perimeter | double precision  |
> >  cty_name  | character varying |
> >  coun      | integer           |
> >  cty_abbr  | character varying |
> >  island    | character varying |
> >  cty_fips  | integer           |
> >  recno     | integer           |
> >  the_geom  | geometry          |
> > Constraints: (srid(the_geom) = -1)
> >              ((geometrytype(the_geom) = 'MULTIPOLYGON'::text) OR
> (the_geom
> > ISNULL))
> >
> >
> > To unsubscribe from this group, send an email to:
> > postgis-unsubscribe at yahoogroups.com
> >
> >
> >
> > Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
>
> --
>       __
>      /
>      | Paul Ramsey
>      | Refractions Research
>      | Email: pramsey at refractions.net
>      | Phone: (250) 885-0632
>      \_
>
> To unsubscribe from this group, send an email to:
> postgis-unsubscribe at yahoogroups.com
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
> To unsubscribe from this group, send an email to:
> postgis-unsubscribe at yahoogroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

--
      __
     /
     | Paul Ramsey
     | Refractions Research
     | Email: pramsey at refractions.net
     | Phone: (250) 885-0632
     \_


To unsubscribe from this group, send an email to:
postgis-unsubscribe at yahoogroups.com



Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/







------------------------ Yahoo! Groups Sponsor ---------------------~-->
Sponsored by VeriSign - The Value of Trust
Secure all your Web servers now - with a proven 5-part
strategy. The FREE Server Security Guide shows you how.
http://us.click.yahoo.com/uCuuSA/VdiDAA/yigFAA/PhFolB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, send an email to:
postgis-unsubscribe at yahoogroups.com

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 





More information about the postgis-users mailing list