Re: [geos-devel] perl bindings for geos (Geo::Geos)

2019-08-14 Thread Ivan Baidakou
On Wed, 14 Aug 2019 11:39:32 +0200
Sebastiaan Couwenberg  wrote:

> > The bindings are done 
> > for C++ geos interface, and mostly maches 1 to 1, when it is possible to 
> > keep API "perlish",
> > i.e. not to crash due to dangling reference.  
> .
> Why not the stable C API?
> 
> The bindings are likely to break every time GEOS is updated. They will
> at least need to be rebuilt when GEOS is updated to link to the new library.
> 

It was internal decision to use C++ API instead of C. Among the reasons:

- library distribution model: it was decided to let the libgeos be shipped 
via cpan.org rather then rely on system library & their maintainers [1]. 
That's way it is a little bit controlled from our side and we less dependent
on system maintainers (e.g. see report matrix availablity [2])

- It is trivial to write Perl(XS) adapters for C++ interface, rather than
for C, as we are using XS::Framework [3]. For example, for perl code

my $exterior_ring = $polygon->getExteriorRing()

the binding will be 3-line code (XS)

LinearRing* geos::geom::Polygon::getExteriorRing() {
RETVAL = dyn_cast(THIS->getExteriorRing()->clone());
}

(See full samples at [4])

- We don't wanted to loose performance having additional stability layer.

So, yes, with new Geos version we have to bump new bindings release. When 
we used the library internally, and the new 3.7.0 was released, the
transition 3.6.2 => 3.7.0 was almost trivial (less then one hour). 


[1] https://metacpan.org/pod/CPP::geos 
[2] http://matrix.cpantesters.org/?dist=CPP-geos+3.7.2.0
[3] https://metacpan.org/pod/XS::Framework
[4] https://metacpan.org/source/DMOL/Geo-Geos-1.0.1/xsi


WBR, Ivan Baidakou
___
geos-devel mailing list
geos-devel@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/geos-devel

[geos-devel] perl bindings for geos (Geo::Geos)

2019-08-14 Thread Ivan Baidakou
Hello, 

We (i.e. crazy-panda.ru) are glad to announce perl bindings for geos [1]. The 
bindings are done 
for C++ geos interface, and mostly maches 1 to 1, when it is possible to keep 
API "perlish",
i.e. not to crash due to dangling reference.

The bindings where successfully tested for Linux and FreeBSD. At the moment for 
Windows bindings
are not available.


PS. There were a few compilation issues on NetBSD, reported by cpantesters 
(i.e. [2]). I wasn't 
able to figure out what's wrong here:

/home/cpan/pit/bare/conf/perl-5.14.1/.cpanplus/5.14.1/build/f497Xw7PTu/CPP-geos-3.7.0.3_8/geos-3.7.2/include/geos/geom/Coordinate.inl:
 In member function 'bool geos::geom::Coordinate::isNull() const':
/home/cpan/pit/bare/conf/perl-5.14.1/.cpanplus/5.14.1/build/f497Xw7PTu/CPP-geos-3.7.0.3_8/geos-3.7.2/build/include/geos/platform.h:73:29:
 error: 'isnan' was not declared in this scope
 #define ISNAN(x) isnan(x)
 ^
/home/cpan/pit/bare/conf/perl-5.14.1/.cpanplus/5.14.1/build/f497Xw7PTu/CPP-geos-3.7.0.3_8/geos-3.7.2/include/geos/geom/Coordinate.inl:38:10:
 note: in expansion of macro 'ISNAN'
  return (ISNAN(x) && ISNAN(y) && ISNAN(z));
  ^
/home/cpan/pit/bare/conf/perl-5.14.1/.cpanplus/5.14.1/build/f497Xw7PTu/CPP-geos-3.7.0.3_8/geos-3.7.2/build/include/geos/platform.h:73:29:
 note: suggested alternative:
 #define ISNAN(x) isnan(x)
 ^
/home/cpan/pit/bare/conf/perl-5.14.1/.cpanplus/5.14.1/build/f497Xw7PTu/CPP-geos-3.7.0.3_8/geos-3.7.2/include/geos/geom/Coordinate.inl:38:10:
 note: in expansion of macro 'ISNAN'
  return (ISNAN(x) && ISNAN(y) && ISNAN(z));
  ^
In file included from 
/home/cpan/pit/bare/conf/perl-5.14.1/.cpanplus/5.14.1/build/f497Xw7PTu/CPP-geos-3.7.0.3_8/geos-3.7.2/src/algorithm/Angle.cpp:19:0:
/usr/include/g++/cmath:648:5: note:   'std::isnan'
 isnan(_Tp __x)
 ^

however, disabling the following line

check_include_files(ieeefp.h HAVE_IEEEFP_H)

in CMakeLists.txt fixed the situation with compilation on NetBSD [3].


[1] https://metacpan.org/pod/release/DMOL/Geo-Geos-1.0.1/lib/Geo/Geos.pm
[2] http://www.cpantesters.org/cpan/report/5385b464-bd38-11e9-9447-c8c4cdff8d62
[3] http://matrix.cpantesters.org/?dist=CPP-geos%203.7.2.0


WBR,
Ivan Baidakou
___
geos-devel mailing list
geos-devel@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/geos-devel

[geos-devel] [GEOS] #977: Delaunay Triangulation adds additional area to the original geometry.

2019-07-18 Thread Ivan Baidakou
Hello dear geos-developers,

Could you, please, comment the issue [1], i.e whether it is confirmed, wont-fix 
etc. ?

[1] https://trac.osgeo.org/geos/ticket/977

WBR, Ivan Baidakou
___
geos-devel mailing list
geos-devel@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/geos-devel