Postgres 9.0/Sharpmap Issues

Topics: Data Access, General Topics, SharpMap v0.9 / v1.x
Oct 16, 2010 at 6:00 AM
Edited Oct 18, 2010 at 1:10 PM

I had a working Sharpmap WMS version .9 website working with a Postgres 8.4 database with Postgis. When I upgraded to Postgres 9.0 I get this error below. Anyway I can fix this?


Byte order not recognized

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentException: Byte order not recognized

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[ArgumentException: Byte order not recognized]
   SharpMap.Converters.WellKnownBinary.GeometryFromWKB.Parse(BinaryReader reader) +191
   SharpMap.Converters.WellKnownBinary.GeometryFromWKB.Parse(Byte[] bytes) +140
   SharpMap.Data.Providers.PostGIS.ExecuteIntersectionQuery(BoundingBox bbox, FeatureDataSet ds) +3121
   SharpMap.Layers.VectorLayer.Render(Graphics g, Map map) +755
   SharpMap.Map.GetMap() +922
   SharpMap.Web.Wms.WmsServer.ParseQueryString(Map map, WmsServiceDescription description) +5151
   wms.ProcessRequest(HttpContext context) +501
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +181
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

Oct 18, 2010 at 1:09 PM

I forgot to add that I using Postgis 1.5.2. Is the error because of a change in Postgis.

Nov 25, 2010 at 4:50 PM
Edited Nov 25, 2010 at 8:15 PM

Hello redwingbeau,

after I upgraded my server to Postgres 9 I ran into the same issue:

This is what I found:

2010-11-04 Npgsql bug when handling bytea data with Postgresql 9.0 We are aware of this problem and a fix is already done. We plan to release a new version with this fix in a couple days. Sorry for any problem. The current workaround is change postgresql.conf to use the previous mode of bytea handling. For more info, see this bug report

I'll update the Npgsql library now.

Hth FObermaier

Update: It does work now as with Postgres 8.4 servers!