[Featureserver] Help with FeatureServer , OpenLayers and PostGIS

Gabriel ODUORI gabriel.oduori at gmail.com
Thu Sep 8 04:11:34 EDT 2011


Hi Tom,

Thanks for the insight. My problems starts at the point when i want to link
OpenLayers with FeatureServer. Is there is any other configuration i need to
do apart from  featureserver.cfg file?

Looks like when i pass my url which is
localhost/featureserver-1.2/featureserver.cgi/mylayer?Format=WFS as the
source of the layers it isnt seen.


Thanks ,

Gabriel.


On 7 September 2011 17:39, Tom A. Cox <tomc at hot.rr.com> wrote:

> Gabriel,
>
> I haven't done a lot of work with Featureserver/OpenLayers and I haven't
> used
> WMS at all, but I have a basic mapping system I worked on last year using
> WFS.
> Hope this info helps.
>
> My featureserver.cfg file is similar to yours.  The OpenLayers interface
> uses
> WFS.  So...
>
> featureserver.cfg:
>
> [frontload]
> type=PostGIS
> dsn=host=localhost dbname=gis user=tomc password=
> layer=frontload
> fid=fid
> geometry=way
> srid=4326
>
> attribute_cols=service_ref,service_num,service_name,street_num,street_name,city,state,zipcode,container_type,serial_number,begin_date,status
>
>
> index.html script section:
>
> var cgi_url = "/cgi-bin/featureserver.cgi";
>
> wfs_frontload = new OpenLayers.Layer.WFS(
>                "Frontload",
>                cgi_url + "/frontload?format=WFS",
>                {maxfeatures: max_features},
>                {extractAttributes: true, displayInLayerSwitcher: true,
>                    visibility: false, styleMap: map_styles,
>                    projection: new OpenLayers.Projection("EPSG:4326")}
>            );
>
> OpenStreetMap.js, OpenLayers.Layer.OSM.Mapnik function modified for base
> url.
> You may not need this if you are using a standard directory layout or for
> WMS.
>
>
> On Tuesday 06 September 2011 3:19:00 pm Gabriel ODUORI wrote:
> > Hi,
> >
> > I am working on my thesis and i am somehow stuck. I have a PostGIS
> database
> > up and running and have included sone tables in a configuration file that
> i
> > would like to be read and loaded on open layers.
> >
> > My cinfiguration looks like this
> >
> >
> > [Primary_canal]
> >     type=PostGIS
> >     dsn=host=localhost dbname=Project user=postgres password=gabbs
> >     layer=Primary_canal
> >     fid=gid #defaults to ogc_fid
> >     geometry=the_geom # defaults to the_geom
> >     srid=4326 #defaults to 4326
> >     attribute_cols=name,barragenam #optional
> >     order=name #optional
> >
> > I am looking for a way to have my layers served to open layers through a
> > method like this example from GeoServer.
> >
> >   new OpenLayers.Layer.WMS("Cities",
> >                 "http://demo.opengeo.org/geoserver/wms", {      ## I
> would
> > like this line to point to my table in the featureserver.cgi file
> >                     layers: "topp:tasmania_cities",
> >                     transparent: true,
> >                     format: "image/gif"
> >                 }, {
> >                     isBaseLayer: false,
> >                     buffer: 0
> > Many thanks,
> >
> > Gabriel.
> --
> Tom A. Cox
> IntelliSystems
> Systems Analyst and Consultant
> Office: 254-848-5598  Email: Tom Cox <tomc at hot.rr.com>
> _______________________________________________
> Featureserver mailing list
> Featureserver at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/featureserver
>



-- 
Jamia House
P.O. Box 101259 – 00101
Nairobi (Kenya)
+254 (0)733763826
gabriel.oduori at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/featureserver/attachments/20110908/19a568d3/attachment.html


More information about the Featureserver mailing list