I'm working with PostGIS->GeoServer->OpenLayers on localhost. I followed a GeoServer tutorial to import some nyc sample data into my postgres/PostGIS database and link it to GeoServer. The layer seems to display correctly in GeoServer using the OpenLayers layer preview. I then attempted to use OpenLayers to display a WFS-T from GeoServer on localhost, routing the LH:8081 (where my GeoServer is located) through a proxy.cgi script to avoid Cross-Scripting. When I visit: proxy.cgi I do get the OpenLayers home page (without images).

But when I try to display the WFS vector layer in my OpenLayers HTML/JavaScript page in either Apache LH or Jetty LH:8081/geoserver/www/ the POST call to LH:8081/geoserver/wfs doesn't complete. I am dumbfounded as to why this is happening.

OpenLayers Post

GeoServer GetFeature

  • It looks to me like your wfs is working. It also looks to me like your base map is in EPSG: 2908 and wfs data is in 4326. That is why you are not seeing the wfs layer. Can you change the projection of your base layer or transform the wfs layer to 2908. I have not done that for a while so I do not have a piece of code handy to post. – Ralph Dell Apr 1 '14 at 12:45
  • The postgis geoserver layer (nyc_buildings) I would like to display on top of the OSM Map is in EPSG:2908. The OSM/Google is in WGS84 aja EPSG:4326 . If I change the vector layer using srsName: "EPSG:4326", instead of "EPSG:2908", this is what I get. But its still not projecting or even loading for the matter. dropbox.com/s/078ttqzqr570lfa/4326.png – Mark Bosky Apr 2 '14 at 20:18
  • On my apache errors.log I am getting "Script timed out before returning headers: proxy.cgi, referer: localhost:8080/test.html". Could that mean there is a problem with my cgi-bin/proxy.cgi file? – Mark Bosky Apr 2 '14 at 22:34
  • I do not know if you have a problem with your proxy.cgi or not. Is your web server apache? – Ralph Dell Apr 3 '14 at 12:42
  • Try this, load the nyc_buildings as your base layer, wms, and then load nyc_buildings as a wfs layer. If the wfs layer works your proxy is ok and your issue is projection. – Ralph Dell Apr 3 '14 at 12:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.