[Featureserver] BBOX request throws error for PostGIS
Josh Livni
mailing_lists at umbrellaconsulting.com
Tue Feb 12 19:55:12 EST 2008
Ah - I didn't think of that.
Note, however, that featureserver (as far as I know) never responds to
an SRS request -- it doesn't transform stuff on the fly. Your layer is
defined for just one SRID - if you don't specify that in your config
file, then it defaults to 4326.
I see the docs don't really make this obvious - I'll update them. But
please try instead of hardcoding the default into Postgis.py, adding
this line to your layer config -- it should accomplish the same thing
for you...
srid=900913
Cheers,
-Josh
Jennifer Strahan wrote:
> 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
>>
>>
>
> _______________________________________________
> Featureserver mailing list
> Featureserver at openlayers.org
> http://featureserver.org/mailman/listinfo/featureserver
>
More information about the Featureserver
mailing list