Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I keep getting an insert error from geoserver when trying to save a point, poly etc etc to my postgis table. any ideas, my code is below

    var Projection = new OpenLayers.Projection("EPSG:4326"); 

    var map = new OpenLayers.Map("Map", {
        //projection: new OpenLayers.Projection("EPSG:900913"),

    //add google map
    var GoogleMap = new OpenLayers.Layer.Google(
            maxExtent: new OpenLayers.Bounds(-20037508.34, -20037508.34, 20037508.34, 20037508.34),
            numZoomLevels: 21  

    var NYC = new OpenLayers.Layer.WMS(
      "nyc_buildings - Tiled", "http://soiisdev:8080/geoserver/wms",
            layers: 'cite:nyc_buildings',
            styles: '',
            format: "image/png",
            tiled: 'true',
            transparent: true,
            buffer: 0,
            displayOutsideMaxExtent: true

   var saveStrategy = new OpenLayers.Strategy.Save({auto:true})

    var vectors = new OpenLayers.Layer.Vector("Vectors", {
        strategies: [
            new OpenLayers.Strategy.BBOX(), 
        protocol: new OpenLayers.Protocol.WFS({
            version: "1.1.0", 
            url:  "http://soiisdev:8080/geoserver/wfs",
            featureNS : "", 
            featureType: "nyc_vectors",
            srsName: "EPSG:4326"

    map.addLayers([GoogleMap, NYC, vectors]); 

    var LonLat = new OpenLayers.LonLat(-73.988113, 40.750898);
    LonLat.transform(Projection, map.getProjectionObject());  
    map.setCenter(LonLat, 15); 

ive checked the header in fiddler and below is the xml sent to geoserver

<wfs:Transaction xmlns:wfs="" service="WFS" version="1.1.0"  xmlns:xsi=" xsi:schemaLocation="">
 <feature:nyc_vectors xmlns:feature="">
     <gml:Point xmlns:gml="" srsName="EPSG:4326">
       <gml:pos>-73.986374928559 40.742379645006</gml:pos>

share|improve this question
you should post the postgreSQL error message – simo Apr 27 '11 at 12:43
I'd agree; the code looks good, so post the error, and possibly any logs. – Hairy Apr 27 '11 at 13:24
Recent one of 2.1 RC release has issue with WFS-T and Postgis. try with latest RC5 – Senthil Apr 27 '11 at 17:47
Probably just a copy and paste mistake, but the XML is incomplete: The closing </wfs:Transaction> and </wfs:insert> are missing. Mmmh, also the xmlns:xsi attribute is missing a closing quote! – hfs Oct 21 '12 at 20:18

You should also post the version of PostGIS and PostgreSQL you are using.

To determine that use:

SELECT postgis_full_version(); SELECT version();

Note in PostGIS 2.0 we dropped a lot of deprecated functions. This has caused some people running GeoServer some problems. If you are running GeoServer latest RC and PostGIS 2.0 and you are still having problems. Install the legacy.sql file packaged with PostGIS 2.0.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.