[geos-devel] Getting Parse Exception

Sandro Santilli strk at keybit.net
Wed Jul 10 13:00:52 PDT 2013

On Thu, Jul 11, 2013 at 12:59:05AM +0530, vishal tiwari wrote:
> I was making test case for VoronoiDiagramBuilder [1] , but got this
> following exception:
>    group: geos::triangulate::Voronoi, test: test<1>
>    problem: unexpected exception
>    exception typeid: N4geos2io14ParseExceptionE
>    message: "ParseException: Expected number but encountered ','"
> Is it not able to parse the string data that i have passed? Or the error in
> the implementation of VoronoiDiagram? If its not in the VoronoiDiagram
> code, then how do i fix it?
> [1]
> https://github.com/vishaltiwari/libgeos/blob/svn-trunk/tests/unit/triangulate/VoronoiTest.cpp

It is unable to parse the string data you have passed.
Indeed you're using a comma between X and Y ordinate values of each point
in the MULTIPOINT geometry.

> Also, i was trying to use the C++ wrapper, directly in order to test my
> code, in some "file.cpp", and after including the necessary header files, i
> am getting errors like:
> - mytest.cpp:(.text+0xf): undefined reference to
> `geos::io::WKTReader::WKTReader()'
> - mytest.cpp:(.text+0x58): undefined reference to
> `geos::io::WKTReader::read(std::basic_string<char, std::char_traits<char>,
> std::allocator<char> > const&)'
> I think this might be some linkage problem or something like that. How do i
> directly use the header files that are defined.

You need to add "VoronoiTest.cpp" to tests/unit/Makefile.am
then run ./autogen.sh from the top-level dir and ./configure again.
Then you build with:
  cd tests/unit
  make geos_unit


More information about the geos-devel mailing list