slick-pg icon indicating copy to clipboard operation
slick-pg copied to clipboard

st_distance_sphere geography/geometry mismatch

Open therealchuckliu opened this issue 7 years ago • 9 comments

I am getting the error "ERROR: function st_distance_sphere(geography, geometry) does not exist" because my db column is a geography column and I am trying to call distanceSphere using makePoint in the same way that is done in the tests. Unfortunately, that creates a geometry object and I think the error is saying either both need to be geography or geometry, can anyone think of a simple workaround for this?

therealchuckliu avatar May 25 '17 19:05 therealchuckliu

Interestingly, distance works

therealchuckliu avatar May 25 '17 19:05 therealchuckliu

Yes, slick-pg didn't have good support for geography. It's majorly target to geometry.

tminglei avatar May 26 '17 01:05 tminglei

Is this still the case? If yes, is a pull request welcome?

naderghanbari avatar Jun 18 '19 18:06 naderghanbari

+1 to geography support

jdcohen220 avatar Nov 07 '19 19:11 jdcohen220

Can you guys recommend any geography java sdk?

Currently vividsolutions jts or locationtech jts only support geometry.

tminglei avatar Nov 09 '19 02:11 tminglei

@tminglei I think there is a geotools module for jts that handles geographic types, I have not personally used it: https://docs.geotools.org/latest/javadocs/org/geotools/geometry/jts/JTS.html

jdcohen220 avatar Nov 18 '19 13:11 jdcohen220

@jdcohen220 seems not a good choice.

tminglei avatar Nov 21 '19 07:11 tminglei

I finally self-made the geography types by extending jts geometry types, and added geography support . Can you guys help review and check it?

tminglei avatar Nov 23 '19 08:11 tminglei

It's on a new branch geography. If it looks good, I'll merge it to branch master.

tminglei avatar Nov 23 '19 08:11 tminglei