Query failes in NHSP2.1.2 with PostGIS

Description

I updated to NHSP 2.1.2GA and we are using it on Postgres 8.4 / PostGIS 1.5. Npgsql 2.0.0.0,

First of all I want to inform about a problem which we resolved on our own.
In PostGisDialect.cs we added some .toLower() on string schema, table, column (e.g. in GetSpatialCreateString), because the DB-creation failed. In NH on postgres, a class Foo will get mapped to the table foo. There are two ways to solve this: in all SQL-statements, name the table without quotes (Foo) or in lower-case with quotes ("foo").
I attached our fix in the attachment.

Now we are stuck with this: When doing querys with the Criteria API, I get this error message:

SpatialExpression.Intersects
FEHLER: 42725: Funktion st_intersects(geometry, text) ist nicht eindeutig
(ERROR: operator st_intersects(geometry, text) is not unique)

Some code:
IGeometry geom = new Polygon(...); //queryrectangle
ICriteria crit = session.CreateCriteria(typeof (Building))
.Add(SpatialExpression.Intersects("BoundingBox", geom))
List<Building> result = crit.List<Building>();

Environment

None

Attachments

4

Activity

Show:

Paul Meems 
July 9, 2014 at 6:45 AM

Yes we use PG v9.3.4 and PostGISv2.1. We;ve upgraded to NHibernate 3.2.0-GA and use Npgsql-2.1.2 (with our own fix) and NHibernate.Spatial-2.1.2.GA (with custom fixes) and compile ourselves.

Gerrit 
July 8, 2014 at 2:56 PM

Hi,
ok, we are still using Npgsql 2.0.11.91 ...
Maybe I will give the new Npgsql a try! I still have some problems using
the newest Postgres version - we are still working on Postgres 9.1

Are you working with Postgres 9.2 or 9.3 and get NHibernate running?

Gerrit

Paul Meems 
July 7, 2014 at 2:04 PM

We're facing the same error (operator st_intersects(geometry, text) is not unique) with PG9.3 with PostGIS2.1 and NHSP2.1.2
It's been years since this is reported. Any progress on a solution?

Gerrit 
December 29, 2011 at 9:45 AM

Hi Ricardo,
now I'm a little confused. I freshly downloaded the sources and run the NUnit tests (it was the first time i did this after study...). NUnit works fine, but on some tests I got the same Failure Messages described above.

I'm running Windows7 with
"PostgreSQL 9.0.5, compiled by Visual C++ build 1500, 32-bit"
and
"POSTGIS="1.5.2" GEOS="3.2.2-CAPI-1.6.2" PROJ="Rel. 4.6.1, 21 August 2008" LIBXML="2.7.6" USE_STATS"

I've attached

  • NHSPUnittest.txt

  • PostGisSpatialQueriesFixture.HqlDistance Stacktrace.txt

Details

Assignee

Reporter

Components

Affects versions

Priority

Who's Looking?

Open Who's Looking?
Created October 26, 2010 at 2:26 AM
Updated July 9, 2014 at 6:45 AM
Who's Looking?