Nikolay,

I found the cause of my problem.
The DrawFeature control is creating MultiLinestring geometries while the
layer needs a LineString. Setting the geometryType if the vector layer
didn't work. So I implemented a small function for the onFeatureInsert
event in the layer definition to make it LineString.

//  geometryType: "OpenLayers.Geometry.LineString",
    onFeatureInsert: function(feature){
        feature.geometry = feature.geometry.components[0];
    },

I should probably do some type checking before I assign the first geometry,
but this is working for now.

On Wed, Dec 14, 2011 at 1:25 PM, chaitanya_ch <[email protected]>wrote:

> I have a similar problem.
> My geometry is of type Linestring and the SRS is epsg:4326
>
> PostgreSQL-8.4.8, PostGIS-1.5.2
>
> I'm including the DEBUG messages
>
> ...
> 2011-12-14 12:57:29,025 INFO [org.geoserver.wfs] -
> Request: getServiceInfo
> 2011-12-14 12:57:29,326 DEBUG [org.geoserver.wfs] - Locating FeatureSource
> uri:'http://localhost/test1' name:'table1'
> 2011-12-14 12:57:29,326 DEBUG [org.geoserver.wfs] - located FeatureType w/
> typeRef 'test1:table1' and elementName '{http://localhost/test1}table1'
> 2011-12-14 12:57:29,326 DEBUG [org.geoserver.wfs] - Transasction
> Insert:net.opengis.wfs.impl.InsertElementTypeImpl@3d2ca2 (feature:
> [SimpleFeatureImpl:table1=[SimpleFeatureImpl.Attribute: fid<fid
> id=fid--77e35c98_1343b534f7f_-7ff6>=0, SimpleFeatureImpl.Attribute:
> wkb_geometry<wkb_geometry id=fid--77e35c98_1343b534f7f_-7ff6>=]], handle:
> null, idgen: <unset>, inputFormat: <unset>, srsName: null)
> 2011-12-14 12:57:29,326 DEBUG [org.geoserver.wfs] - Use featureValidation
> to
> check contents of insert
> 2011-12-14 12:57:29,326 ERROR [org.geoserver.wfs] - Transaction failed
> org.geoserver.wfs.WFSTransactionException: Error performing insert:
> java.lang.String cannot be cast to com.vividsolutions.jts.geom.Geometry
>        at
>
> org.geoserver.wfs.InsertElementHandler.execute(InsertElementHandler.java:202)
>        at org.geoserver.wfs.Transac...
>
> --
> View this message in context:
> http://osgeo-org.1803224.n2.nabble.com/WFS-error-performing-insert-java-lang-String-cannot-be-cast-to-com-vividsolutions-jts-geom-Geometry-tp7091003p7092704.html
> Sent from the GeoServer - User mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> Cloud Computing - Latest Buzzword or a Glimpse of the Future?
> This paper surveys cloud computing today: What are the benefits?
> Why are businesses embracing it? What are its payoffs and pitfalls?
> http://www.accelacomm.com/jaw/sdnl/114/51425149/
> _______________________________________________
> Geoserver-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>



-- 
Best regards,
Chaitanya kumar CH.

+91-9494447584
17.2416N 80.1426E
------------------------------------------------------------------------------
10 Tips for Better Server Consolidation
Server virtualization is being driven by many needs.  
But none more important than the need to reduce IT complexity 
while improving strategic productivity.  Learn More! 
http://www.accelacomm.com/jaw/sdnl/114/51507609/
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to