[Featureserver] Fwd: postgis connection
Christopher Schmidt
crschmidt at metacarta.com
Fri Oct 19 16:48:13 EDT 2007
On Fri, Oct 19, 2007 at 04:37:41PM -0400, Bobby Braswell wrote:
>
> Thanks very much for the quick reply. I changed my table definition
> to the following:
>
> createdb -U postgres mydata -T template_postgis
> psql -U postgres -d mydata
> # CREATE TABLE mylayer (ogc_fid SERIAL NOT NULL, CONSTRAINT
> mylayer_ogc_fid
> # PRIMARY KEY (ogc_fid));
> # GRANT ALL ON TABLE mylayer TO www;
> # GRANT ALL ON mylayer_ogc_fid_seq TO www;
> # SELECT AddGeometryColumn('','mylayer','wkb_geometry','4326','POINT',
> 2);
>
> Now I can successfully do the following manual upload:
>
> % echo '{"id":1, "geometry":{"type":"Point", "coordinates":
> [-70,43]}}' | curl -k -d @- https://portsmouthresponse.unh.edu/cgi/
> featureserver.cgi/scribble/
> {"crs": {"type": "none", "properties": {"info": "No CRS information
> has been provided with this data."}}, "type": "FeatureCollection",
> "features": [{"geometry": {"type": "Point", "coordinates": [0.0,
> 5.0]}, "type": "Feature", "id": 1, "properties": {}}]}
>
> And the point appears on my test OpenLayers map: https://
> portsmouthresponse.unh.edu/testmap.html
>
> which is great. However, I can't add a new feature from the map, as I
> had done before with the DBM database, via a simple 'post' of:
>
> {"type":"FeatureCollection","features":
> [{"type":"Feature","id":"OpenLayers.Feature.Vector_289","properties":
> {},"geometry":{"type":"Point","coordinates":
> [-70.87003784179687,43.2922607421875]}}],"crs":
> {"type":"OGC","properties":{"urn":"urn:ogc:def:crs:OGC:1.3:CRS84"}}}
> Features: 134
>
> Here is where I think I'm getting into the "new GeoJSON" issue.
>
> I tried removing the "default_service" line from my config file with
> no effect.
With OpenLayers 2.5, you'll need default_service=GeoJSON. Playing with
your FS, I was able to draw a point, then serialize the GeoJSON, and
dump it with curl to
https://portsmouthresponse.unh.edu/cgi/featureserver.cgi/scribble.geojson,
which worked. I think that means you just need to bring your
default_service= back.
Regards,
--
Christopher Schmidt
MetaCarta
More information about the Featureserver
mailing list