Hello guys...
I´m trying to execute a "within" postgis function using NH.Spatial ...
The SQL that I need to get is something like that :

select nomemunicipio from tblcity m where within
( '0101000020C31000000000000000C049C06666666666E633C0', m.the_geom)


So, I created my City class/xml, with geom like that:
 <property name="Geometry" column="the_geom">
                  <type
name="NHibernate.Spatial.Type.GeometryType,NHibernate.Spatial">
                          <param name="subtype">MULTIPOLYGON</param>
                          <param name="srid">4291</param>
                  </type>
</property>

That works great to load, insert ...

So, I execute that:

public IList FindByPoint(IPoint __point)
 {
           IList results = Session.CreateCriteria(typeof(City))
                .Add(SpatialExpression.Within("Geometry", __point))
                .List();
           return results;
}
And I always got a empty result...
The SQL generated was :

SELECT ... FROM tblCity this_ WHERE
ST_Within(this_.the_geom, :p0); :p0 =
'0101000020C31000000000000000C049C06666666666E633C0'

It seems the ST_Within attributes was inverted... The geometry (p0)
needs to be the fisrt in function...
Is that corrected?

Ps,: I´m using trunk build...

Thanks


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"NHibernate Contrib - Development Group" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com.ar/group/nhcdevs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to