[geos-devel] using geos C Api

Rémi Cura remi.cura at gmail.com
Sun Oct 12 06:04:52 PDT 2014


Ok,
I'll try tomorow using exclusively functions from geos_c.h.
Is there some kind of example/tutorial arround?

Another 2 quick questions :
I would like to perform a polygon/polygon intersection.
  I can't find if there is a shortcut for the case where the two geometry
are disjoint (in which case the intersection would be empty geom)
  Shall I put myself this kind of shortcut before calling intersection?

About the new rectangle shortcuts . Are the rectangle bbox (north/South
East-West oriented), or are they real rectangle (oriented bbox)?

Cheers,
Rémi-C

2014-10-10 18:36 GMT+02:00 Sandro Santilli <strk at keybit.net>:

> On Fri, Oct 10, 2014 at 05:59:35PM +0200, Rémi Cura wrote:
> > Hello,
> > trying to use Geos C Api in a  Cpp program.
> > The Cpp programm uses CMake.
> >
> > Apparently the easy way to incorporate GEOS is by copying the QGIS
> solution.
> > I copy the FindGEOS.cmake file
> > <https://raw.githubusercontent.com/qgis/QGIS/master/cmake/FindGEOS.cmake
> >
> > then ad the path to it in CMakeList.txt
> >     set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}")
> >
> > then using the regular
> >   FIND_PACKAGE(GEOS REQUIRED)
> > fills GEOS_LIBRARY and GEOS_INCLUDE_DIR.
> >
> > Then I add GEOS LIBRARY has a target for link :
> > TARGET_LINK_LIBRARIES(simple_snapping.bin ${CERES_LIBRARIES}
> > ${GEOS_LIBRARY})
> >
> >
> > After that I'm stuck,
> > If I try to use Geos function I get an error by
> > ld :
> > " geometry_function.cc:-1: error: undefined reference to
> > `geos::io::WKTReader::WKTReader()'"
> >
> > Anybody has an idea of how to fix this?
>
> Is geos::io::WKTReader::WKTReader used by your geometry_function.cc ?
> That's the C++ API, not the C one.
>
> --strk;
> _______________________________________________
> geos-devel mailing list
> geos-devel at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/geos-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geos-devel/attachments/20141012/655551b3/attachment.html>


More information about the geos-devel mailing list