Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

We have Java stored procedure in Oracle that make calls to functions offered by Oracle Spatial to perform spatial analysis and return results. I am looking to the same in PostGIS, is this possible?

share|improve this question

1 Answer 1

Yes, of course, through JDBC. See the PostGIS manual for JDBC clients. You can even build custom spatial functions on the server that can be used through JDBC.

share|improve this answer
    
Thank you for your response. Can we store java in postgresql? Can we create use plsql function to call POSTGIS linearreferencing methods to get starting and ending milepoints etc.? –  OPENGISTECH May 22 '12 at 21:43
    
There is PL/java, where you can write server-side procedural functions. However, PostGIS recently dropped their geometry support for PL/java, since it was not maintained. That's not to say you can't use it, just that you won't have access to the geometry object. You can still write something in PL/java to use linear referencing functions. Most folks use PL/pgSQL though. –  Mike T May 22 '12 at 21:59
    
I am interested in pure PLSQL functions to get result. Example would be providing x,y coordinates and geting nearest point on line, its length in miles, the line segments starting and ending mile point etc. I could see few linear refering methods in POSTGIS cheatsheet. I want to find out if we could simply use these methods to get results. Is is possible? –  OPENGISTECH May 23 '12 at 19:47
    
PL/pgSQL is very similar to PLSQL, so a few modifications would be needed, but nothing massive. The functions in PostGIS should be able to do all of the tasks you seek, particularly with accessing x,y coordinate values, length functions and linear referencing functions. For example, see gis.stackexchange.com/questions/23493/… –  Mike T May 23 '12 at 21:54
    
Thank you very much –  OPENGISTECH May 23 '12 at 22:22

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.