[Featureserver] BBOX request throws error for PostGIS

Jennifer Strahan jennifer at greeninfo.org
Tue Feb 12 17:28:04 EST 2008


Hello, 

I just posted the following message to the OpenLayers user's group, but 
I think it also might solve your issue, some I'm copying here:

For some reason the SQL that FeatureServer generates has the wrong 
SRID.  I figured this out by adding a few lines to PostGIS.py to write 
the sql to a file.  The resulting SQL has 4326 for the SRID when it 
should be 900913. 

For example if my request is:
http://69.59.158.11/featureserver/featureserver.cgi/parkinfo_google?format=WFS&maxfeatures=50&SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&SRS=EPSG%3A900913&BBOX=-40075016.6784,-40075016.50840001,40075016.6784,40075016.8484

The sql is:
SELECT AsText(the_geom_google) as fs_text_geom, gid, unit_name, 
agncy_nam, access FROM "holdingsfeb08" WHERE the_geom_google && 
SetSRID('BOX3D(-40075016.678400 -40075016.508400,40075016.678400 
40075016.848400)'::box3d, 4326) and intersects(the_geom_google, 
SetSRID('BOX3D(-40075016.678400 -40075016.508400,40075016.678400 
40075016.848400)'::box3d, 4326)) LIMIT 50

If I change line 28 from
 def __init__(self, name, srid = 4326, fid = "ogc_fid", geometry = 
"the_geom", order = "", attribute_cols = '*', writable = True, **args):

to

 def __init__(self, name, srid = 900913, fid = "ogc_fid", geometry = 
"the_geom", order = "", attribute_cols = '*', writable = True, **args):

All works fine.  So it seems like the parameter from the URL is not 
overwriting the initial value set here. 

Jennifer

Jennifer Strahan
GIS Specialist
GreenInfo Network
116 New Montgomery St. Ste. 738
San Francisco, CA 94105
(415)979-0343x306



Ed Fialkowski wrote:
> Okay, I fixed that up. Sorry about that.
>
> Here ya go Josh:
> http://pocus.wustl.edu/cgi-bin/featureserver3/featureserver.cgi/GIS
>
> Thanks again.
> -Ed
> _______________________________________________
> Featureserver mailing list
> Featureserver at openlayers.org
> http://featureserver.org/mailman/listinfo/featureserver
>   




More information about the Featureserver mailing list