This project has moved and is read-only. For the latest updates, please go here.

Help with PostGIS, Npqsql and rendering...

Sep 27, 2006 at 12:32 PM
Hi there,

I am recently started using SharpMap to do some basic map rendering work. I have a PostGIS database with three tables, and am trying to render a map with SharpMap. I however keep getting the same error every time I compile in VS2005. One table is a multipolygon table, one is a multiline, and one is a Point-based table in PostGIS. What am I doing wrong ??? I have tried adding a reference to the Npgsql.dll, but then get some sort of assembly reference message. Below is the error code. I can post my project / source if necessary....

Exception Details: Npgsql.NpgsqlException: ERROR: 42883: function extent() does not exist

Source Error:

Line 45: map.Layers.Add(layBasemap);
Line 46:
Line 47: SharpMap.Geometries.BoundingBox mapExtents = map.GetExtents();
Line 48: map.Zoom = mapExtents.Width * 3;
Line 49: map.MaximumZoom = mapExtents.Width * 3;


Sep 27, 2006 at 4:04 PM

Have you activated the PostGis extension for your database?
Look at your database with pgadmin, if under aggregates the
aggregate "extent(geom)" exist.

if it doesn't exist, your database isn't really "spatial".

Sep 27, 2006 at 7:12 PM
...And make sure you use a PostGIS template database when you create your own database.