5 Replies Latest reply on May 12, 2014 5:50 AM by Stefan Jager

    Is there a C library for Spatial Functions?


      I know there is a spatial jar but is there a lib or dll for this functionality ?

        • 1. Re: Is there a C library for Spatial Functions?
          Stefan Jager

          To use where and how? There are numerous libraries out there, that can do some or all or part of what Spatial can do, but what do you want to achieve?


          Basically all you need is a client that can connect to Oracle, execute SQL statements and call procedures/functions, and let Oracle do the work for you. Then retrieve the results and do what you want with the results.


          Be aware that frequently applications that perform some sort of GIS function first load ALL the data in memory, then execute the GIS function on that data in memory, and show the resultset. This usually causes severe memory overhead. If at all possible this is something you want to avoid: try to get as little data as possible over the network.


          Aside from that, using the Oracle Client stuff, it's not that difficult to write your own library. I once did that to display SDO_GEOMETRY in a little C# app, just to see if I could (I know, I'm a geek who is programming in his spare time ... )

          • 2. Re: Is there a C library for Spatial Functions?

            Hey Stefan,


            Well the jar gives you the prototypes for an SDO object, structures, functions etc.  I was just wondering if the same thing existed for other languages.

            • 3. Re: Is there a C library for Spatial Functions?
              Stefan Jager

              Hi FlyingGuy,


              They probably do exist (Google might be your friend here),  but I've never needed stuff like that outside of Oracle, so never had reason to look for it. What would you need those prototypes for? It's not that difficult to get to all the parts of an SDO_GEOMETRY with (relatively) plain SQL.




              • 4. Re: Is there a C library for Spatial Functions?

                Hey Stefan,


                True enough.  I am working on a front end application that will display a map based upon links in an oracle table that are sdo linestrings.  It would be quite nice to compute an sdo include or contains or an lrs projecting a point on a linestring, rtc. without having to go back to the database.  The java sdo jar has these sorts of calls but writing desktop apps in java is both tedious and the performance still suffers when compared to native applications not to mention look and feel.


                I googled around and really didn't find anything.  Having to re-invent the wheel is not that appealing.  I know there are open source programs that can do these types of things, but tearing apart something like that is more work then I want to deal with since my focus is fairly narrow.


                Anyway I can always pull things out as wkt's but that invloves a lot of overhead when you are trying to display over 100,000 links and then zoom into to sections of the map.

                • 5. Re: Is there a C library for Spatial Functions?
                  Stefan Jager

                  Well, I guess that did not work ... I tried answering here by simply replying to the notification email (as it says in the email how it should work), but obviously it didn't. Oh well.


                  What I replied was that you may want to look at the GDAL/OGR libraries (see OSGeo.org | Your Open Source Compass). The OGR-bit probably does what you want for C#, but I'm not sure: I've never seriously worked with it (I mainly work with proprietary stuff like ESRI, Intergraph, CadCorp - those guys will do what you want, but at a price :-) ). There's more libraries on there as well, is probably worth a look.


                  Webservices might be another solution, you could take a look at GeoServer (in comvination with OpenLayers). That will go back and forth between server and client, but the upside is that you don't have any installations to do on clients. But that really depends on your requirements I guess.