[OpenLayers-Users] All geometries displayed as points

cmay gufutomozytibyfe at tempomail.fr
Thu Apr 11 10:50:30 PDT 2013


Hi,

I  have a table (markers) with 3 columns in PostGIS:
1. id (serial NOT NULL PRIMARY KEY)
2. geometry_wkt (text)
3. geometry (geometry,4326)

I use a vector layer to generate WKT and I save it to the geometry_wkt
column.

<http://osgeo-org.1560.x6.nabble.com/file/n5046175/vector.png> 

I have a trigger in postgis that executes the following code when a new line
is added:

begin
  NEW.geometry = ST_GeomFromText(NEW.geometry_wkt,4326);
RETURN NEW;
END;

The geometry column is populated correctly and I can manually use ST_AsText
to get the correct wkt again.

Now I want to display all features (from all rows) on a map. I have tried
WMS and WFS.
I also tried to use only one type of geometry (polygons).

WMS displays all geometries as points: 

var wms_layer = new OpenLayers.Layer.WMS(
                    "Markers", "http://localhost:8080/geoserver/lesvos/wms",
    {
        transparent: 'TRUE',
        srs: 'EPSG:4326',
        layers: 'lesvos:markers',
        format: 'image/png',
        isBaseLayer: false,
        visibility: true
    }
);

<http://osgeo-org.1560.x6.nabble.com/file/n5046175/wms.png> 

WFS does not show anything:

var wfs_layer = new OpenLayers.Layer.Vector("Geom", {
 protocol: new OpenLayers.Protocol.WFS({
 version: "1.1.0",
 url: "http://localhost:8080/geoserver/wfs",
 featureNS :  "http://www.lesvos.net/lesvos",
 maxExtent: mapextent, //is defined elsewhere
 featureType: "markers",
 geometryName: "geometry"
 })
 })

<http://osgeo-org.1560.x6.nabble.com/file/n5046175/wfs.png> 

Geoserver Openlayers Preview:

<http://osgeo-org.1560.x6.nabble.com/file/n5046175/dots.png> 



--
View this message in context: http://osgeo-org.1560.x6.nabble.com/All-geometries-displayed-as-points-tp5045922p5046175.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.


More information about the Users mailing list