[postgis-users] Weird GEOS problem

George Vlahakis g.vlahakis at telenavis.com
Wed Dec 16 07:54:14 PST 2009


Hi Emilie,

 

Im trying to port over to npgsql but I cannot get the GeomFromWKB
function to get called correctly. No matter what I do with the wkb
parameter the query failes (error near \",\"). Any hints?

 

                const string sql = "INSERT INTO table ("

                                   + "client, category, description,
geom)"

                                   + " VALUES (?, ?, ?, GeomFromWKB(?,
4326)) RETURNING id";

 

                cmd = new NpgsqlCommand(sql, conn);

                cmd.Parameters.Add(string.Empty, request.ClientId);

                cmd.Parameters.Add(string.Empty, request.CategoryId);

                cmd.Parameters.Add(string.Empty, request.Description);

                byte[] bytes = GetWkbPolygon(request.Points);

                cmd.Parameters.Add(new NpgsqlParameter(string.Empty,
bytes));

                int id = (int)cmd.ExecuteScalar();

 

From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of
Emilie Laffray
Sent: Friday, December 11, 2009 1:13 PM
To: PostGIS Users Discussion
Subject: Re: [postgis-users] Weird GEOS problem

 

 

2009/12/11 George Vlahakis <g.vlahakis at telenavis.com>

Hi all,

 

Probably nobody has seen this, but on a particular machine (Win XP)
every 2-3 hours or so I am getting the following error:

 

System.Data.Odbc.OdbcException: ERROR [XX000] ERROR: Error creating GEOS
Coordinate Sequence; Error while executing the query

 

I might be wrong but you are using .NET? 
If it is indeed the case, I would suggest dropping the use of odbc, and
use npgsql which provides a direct connection to the database. It should
give you better performance, and maybe extra stability.

Emilie Laffray

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20091216/e3c6663d/attachment.html>


More information about the postgis-users mailing list