[hibernate-dev] [HSEARCH] Geospatial indexing and queries

Hardy Ferentschik hardy at hibernate.org
Wed Dec 21 11:30:40 EST 2011


>> On a side node, do we really need 'of()'. Sure it makes it sounds a little more like real English, but then why is there no 'and()' between lat and long.
>> The whole DSL part only carries so far when directly hosted in Java. If there is no compelling reason for 'of()' i would argue one can drop it.
> 
> There is a reason for the of(). An overloaded form used when the user passes a Coordinates object is like this
> 
> builder
>    .spatial()
>        .forLocation("location")
>        .within(500, Unit.KM)
>            .of(coordinates)
>        .createQuery();
> 
> So you can see there is a symmetry to it.

Fair enough then. As long as there is a use for it :-)


> But we can reduce the number of methods called by doing something like this
> 
> builder
>    .spatial()
>        .forLocation("location")
>        .within(500, Unit.KM)
>            .ofLatitude(48.8d).andLongitude(2.29d)
>        .createQuery();
> 
> Would you like it better?

much actually :-)


>> what's about 'proximity' instead of 'spatial'?
> 
> I am somewhat neutral, but I think the industry term is spatial queries. Thoughts?

The industry term is spatial, but I think the John Doe user might be more familiar with proximity.

--Hardy





More information about the hibernate-dev mailing list