[Featureserver] PostGIS insert statement question

Christopher Schmidt crschmidt at metacarta.com
Mon May 18 12:33:55 EDT 2009


On Sun, May 17, 2009 at 10:48:15PM -0500, Jennifer Strahan wrote:
> Hi there,
> 
> I was playing with this some more today.  I neglected to mention in my 
> previous email that I'm using OpenLayers to submit the drawings and was 
> using the nightly build:
> http://dev.openlayers.org/nightly/OpenLayers.js.  After switching it 
> back to  http://openlayers.org/api/OpenLayers.js, I'm no longer having 
> the error with the geometry column. 

Can you share you example code? I really can't imagine how this would be
the problem. Is this the *only* thing you changed? 

-- Chris

> Thanks,
> Jennifer
> 
> Christopher Schmidt wrote:
> >On Fri, May 15, 2009 at 04:47:34PM -0500, Jennifer Strahan wrote:
> >  
> >>Hi Josh,
> >>
> >>I'm using a version from svn trunk that I checked out on May 8, 2009
> >>
> >>I removed the geometry= line from my layer config and am still getting 
> >>the same error. 
> >>    
> >
> >The only thing I can think of is that you have another
> >featureserver.config somewhere that is causing problems. Try changing
> >your layer name? Looking at the code, the *default* should be the_geom;
> >there is no code anywhere that I can see which uses 'geoemetry' without
> >you explicitly specifying it as such...
> >
> >-- Chris
> >
> >  
> >>Thanks,
> >>Jennifer
> >>
> >>Josh Livni wrote:
> >>    
> >>>Odd, it looks like the current svn update method should work with any 
> >>>geometry column name you specify..
> >>>
> >>> - What version are you using (svn trunk?) 
> >>> - What happens if you remove the geometry= line from your layer config?
> >>>
> >>> -Josh
> >>>
> >>>
> >>>On Fri, May 15, 2009 at 1:33 PM, Jennifer Strahan 
> >>><jennifer at greeninfo.org <mailto:jennifer at greeninfo.org>> wrote:
> >>>
> >>>    Hello Everyone,
> >>>
> >>>    I'm hoping someone can suggest how to solve an error I'm getting when
> >>>    trying to insert a record into a PostGIS datasource:
> >>>
> >>>    An error occurred: column "geometry" of relation
> >>>    "padus_v1_mn_edits" does not exist
> >>>    LINE 1: ...T INTO "padus_v1_mn_edits" (comm_date, wdpa_name,
> >>>    geometry, ...
> >>>                                                                ^
> >>>
> >>>     File "/var/www/featureserver-pine/web_request/handlers.py", line
> >>>    219, in cgi
> >>>       accepts = accepts )
> >>>     File "/var/www/featureserver-pine/FeatureServer/Server.py", line
> >>>    167, in dispatchRequest
> >>>       result = method(action)
> >>>     File
> >>>    "/var/www/featureserver-pine/FeatureServer/DataSource/PostGIS.py",
> >>>    line 116, in create
> >>>       cursor.execute(str(sql), self.feature_values(feature))
> >>>
> >>>
> >>>
> >>>    Looks like the insert statement uses the column name "geometry"
> >>>    when it
> >>>    should be "the_geom"
> >>>
> >>>    Below is my config for the layer.  Any help would be much 
> >>>    appreciated.
> >>>    I guess I can just rename my geometry column.  But I was hoping to 
> >>>    get
> >>>    it working with the current name.
> >>>
> >>>    Thanks,
> >>>    Jennifer
> >>>
> >>>    #Use this layer to submit and display user edits
> >>>    [padus_v1_mn_edits]
> >>>    type=PostGIS
> >>>    dsn=dbname=db_pine password=xxxxxx user=pine
> >>>    layer=padus_v1_mn_edits
> >>>    geometry=the_geom
> >>>    fid=gid
> >>>    srid=900913
> >>>    attribute_cols=us_id, manag_desc, wdpa_name, gis_acres, gap_status,
> >>>    gis_source, sourcedate, class_desc, owner_desc, comments, comm_name,
> >>>    comm_org, comm_email, comm_date
> >>>    gaping_security_hole=yes
> >>>
> >>>    --
> >>>    Jennifer Strahan, GIS Specialist
> >>>    GreenInfo Network - www.greeninfo.org <http://www.greeninfo.org> -
> >>>    Information and Mapping in the Public Interest
> >>>
> >>>    **As of Oct. 13, 2008 we have a new address**
> >>>    564 Market Street, Suite 510
> >>>    San Francisco CA 94104
> >>>
> >>>    Phone: 651-917-0191
> >>>    Fax: 415-979-0371
> >>>    Email: jennifer at greeninfo.org <mailto:jennifer at greeninfo.org>
> >>>
> >>>    _______________________________________________
> >>>    Featureserver mailing list
> >>>    Featureserver at openlayers.org <mailto:Featureserver at openlayers.org>
> >>>    http://featureserver.org/mailman/listinfo/featureserver
> >>>
> >>>
> >>>      
> >>-- 
> >>Jennifer Strahan, GIS Specialist
> >>GreenInfo Network - www.greeninfo.org -
> >>Information and Mapping in the Public Interest
> >>
> >>**As of Oct. 13, 2008 we have a new address**
> >>564 Market Street, Suite 510
> >>San Francisco CA 94104
> >>
> >>Phone: 651-917-0191
> >>Fax: 415-979-0371
> >>Email: jennifer at greeninfo.org 
> >>
> >>_______________________________________________
> >>Featureserver mailing list
> >>Featureserver at openlayers.org
> >>http://featureserver.org/mailman/listinfo/featureserver
> >>    
> >
> >  
> 
> 
> -- 
> Jennifer Strahan, GIS Specialist
> GreenInfo Network - www.greeninfo.org -
> Information and Mapping in the Public Interest
> 
> **As of Oct. 13, 2008 we have a new address**
> 564 Market Street, Suite 510
> San Francisco CA 94104
> 
> Phone: 651-917-0191
> Fax: 415-979-0371
> Email: jennifer at greeninfo.org 
> 

-- 
Christopher Schmidt
MetaCarta



More information about the Featureserver mailing list