Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

st_distance_sphere not found during GeonamesFeatureSimpleImporter #53

Open
kayakko opened this issue Oct 31, 2019 · 7 comments
Open

st_distance_sphere not found during GeonamesFeatureSimpleImporter #53

kayakko opened this issue Oct 31, 2019 · 7 comments

Comments

@kayakko
Copy link

kayakko commented Oct 31, 2019

Hi
I have installed gisgraphy-5.0-beta3 over java 1.8.201 postgres 12 and postgis_3_0
When importing the data , for the GeonamesFeatureSimpleImporter i've got an error.
The traslation is st_distance_sphere was not found.
Any help to solve the issue?
This is the message
Caused by: org.postgresql.util.PSQLException: ERRORE: la funzione st_distance_sphere(geometry, geometry) non esiste
Hint: Nessuna funzione trovata con nome e tipi di argomenti forniti. Potrebbe essere necessario convertire i tipi esplicitamente.
Position: 1237
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2497)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2233)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:310)
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:446)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:370)
at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:149)
at org.postgresql.jdbc.PgPreparedStatement.executeQuery(PgPreparedStatement.java:108)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:93)
at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:208)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1953)
at org.hibernate.loader.Loader.doQuery(Loader.java:802)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274)
at org.hibernate.loader.Loader.doList(Loader.java:2533)

@gisgraphy
Copy link
Owner

gisgraphy commented Nov 3, 2019 via email

@kayakko
Copy link
Author

kayakko commented Nov 4, 2019

Yes, as I mentioned in the issue, postgis_3_0

@kayakko
Copy link
Author

kayakko commented Nov 4, 2019

SELECT PostGIS_Version();

3.0 USE_GEOS=1 USE_PROJ=1 USE_STATS=1

@gisgraphy
Copy link
Owner

gisgraphy commented Nov 4, 2019 via email

@gisgraphy
Copy link
Owner

gisgraphy commented Nov 4, 2019 via email

@kayakko
Copy link
Author

kayakko commented Nov 4, 2019

I checked the geo_postgis docs and found the problem:
The funcion now is called st_distancesphere(geometryA, geometryB)
The code generating the error:
com.gisgraphy.domain.repository.GenericGisDao.getNearest(GenericGisDao.java:664)
uses :st_distance_sphere
Seems GeoPostGIS vers 3.x changed the function name from "st_distance_sphere" to "st_distancesphere"
I tried the translated sql on pgadmin and is working

@gisgraphy
Copy link
Owner

gisgraphy commented Nov 4, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants