Hey Andrea,

I have been continuing to look at the ogr datastore recently. Unfortunately
despite my best efforts I still can't figure why it won't work for me on
osx. It would be nice if another osx developer could confirm to rule out
anything specific to my environment. I have also reached out to the bridj
user list but have yet to hear anything back yet.

That said, it got me thinking. What about supporting both interfaces?
Basically the idea is to come up with an adapter interface, and then
implement it based on bridj/jna and then another implementation based on
the jni interface and existing ogr java api. I played around a bit today
and here is what i came up with, posted to my github repo.

  https://github.com/jdeolive/geotools/tree/ogr

The adapter interface.


https://github.com/jdeolive/geotools/blob/ogr/modules/unsupported/ogr/src/main/java/org/geotools/data/ogr/OGR.java

And the bridj implementation:


https://github.com/jdeolive/geotools/blob/ogr/modules/unsupported/ogr/src/main/java/org/geotools/data/ogr/bridj/BridjOGR.java

All the existing classes are now written against the interface, with the
concrete implementation being provided by a specific data astore factory:


https://github.com/jdeolive/geotools/blob/ogr/modules/unsupported/ogr/src/main/java/org/geotools/data/ogr/bridj/BridjOGRDataStoreFactory.java

All tests pass. This was in part an exercise to get aquatinted with the ogr
java api and with bridj. But I think this could be a decent way forward,
especially if it turns out that bridj does have issues on some platforms.

What do you think?

-Justin

-- 
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.
------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
GeoTools-Devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to