[Featureserver] Fwd: postgis connection
Bobby Braswell
rob.braswell at unh.edu
Fri Oct 19 15:19:46 EDT 2007
Hi-
Update on my previous question, sorry for not including this piece of
information. This is the error I get when I try to manually upload a
point to my postgis featureserver instance:
% echo '{"id":1, "geometry":{"type":"Point", "coordinates":[[0,5]]}}'
| curl -k -d @- https://portsmouthresponse.unh.edu/cgi/
featureserver.cgi/scribble/
An error occurred: float argument required
File "/sw/lib/python2.5/site-packages/FeatureServer/Server.py",
line 273, in cgiHandler
format, content = service.dispatchRequest( params, path_info,
host, post_data, request_method, accepts )
File "/sw/lib/python2.5/site-packages/FeatureServer/Server.py",
line 137, in dispatchRequest
result = method(action)
File "/sw/lib/python2.5/site-packages/FeatureServer/DataSource/
PostGIS.py", line 113, in create
values = ", ".join(self.value_formats(feature)+["SetSRID('%
s'::geometry, %s) " % (self.to_wkt(feature.geometry), self.srid)])
File "/sw/lib/python2.5/site-packages/FeatureServer/DataSource/
PostGIS.py", line 70, in to_wkt
return "POINT(%s)" % coords_to_wkt(coords)
File "/sw/lib/python2.5/site-packages/FeatureServer/DataSource/
PostGIS.py", line 67, in coords_to_wkt
return ",".join(["%f %f" % tuple(c) for c in coords])
In particular, I'm not sure what the "float argument required"
message means.
Thanks in advance,
Rob Braswell
Begin forwarded message:
> From: Bobby Braswell <rob.braswell at unh.edu>
> Date: October 19, 2007 2:53:42 PM EDT
> To: featureserver at openlayers.org
> Subject: postgis connection
>
>
> Hi-
>
> I am trying to set up a postGIS backend to featureserver. I was
> previously using the DBM option, and this worked for me (it's
> awesome, by the way, thanks) with no problems. With postgis I am
> missing something, perhaps obvious, but I'm sorry that I couldn't
> find the answer in the archives or docs.
>
> My config file looks like the example in the documentation:
>
> [metadata]
> default_service=GeoJSON
>
> [scribble]
> type=PostGIS
> dsn=dbname=mydata
> layer=mylayer
> fid=ogc_fid
> geometry=wkb_geometry
>
> I believe I have settled access and permissions issues, and I have
> a postGIS database called mydata, with a table called mylayer,
> defined as follows:
>
> CREATE TABLE mylayer (ogc_fid INTEGER, wkb_geometry GEOMETRY;
> GRANT ALL ON TABLE mylayer TO www;
>
> The database was built using a postgis template and has the usual
> geometry_columns and spatial_ref_sys tables.
>
> However I get the following error from the browser:
> Error: invalid label
> Source File: https://portsmouthresponse.unh.edu/cgi/
> featureserver.cgi/scribble/all.json?maxfeatures=20&callback=load_list
> Line: 1, Column: 11
> Source Code:
> {"features": []}
>
> This line is what I get if I issue the create command using curl.
> I'm not sure what "invalid layer" is referring to.
>
> One question is: should I indeed be creating the table myself? In
> the DBM case, featureserver created the database in /tmp.
>
> Also: I feel like the table should have more columns corresponding
> to the attributes of the geometric objects I am uploading, for some
> reason I'm not clear on how many those are or where they are coming
> from. I hope I have provided a clear explanation of my problem and
> that it is not
>
> Rob Braswell
>
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/featureserver/attachments/20071019/bb893129/attachment.html
More information about the Featureserver
mailing list