[geos-devel] Porting polylabel to GEOS and PostGIS

Sandro Santilli strk at kbt.io
Mon Apr 10 02:16:15 PDT 2017


On Mon, Apr 10, 2017 at 11:33:44AM +0300, Nikolai Bezdna wrote:

> Can someone please provide guides on where to start with this port. 
>
> Is it reasonable to have this code in GEOS, or this has to be done
> with just plpgsql without touching any dependencies?

Hi Nikolai,
I think it's reasonable to have the code in GEOS.

The C++ would could go under src/operation/polylabel
and include/geos/operation/polylabel, with unit tests
under tests/unit/operation/polylabel.

Then you'd expose the functionality in the C-API in
capi/geos_c.h.in (both reentrant and non-reentrant versions,
to ease PostGIS connector) with tests in
tests/unit/capi/GEOSPolylabelTest.cpp (assuming that matches
the C-API function name).

You can check out src/algorithm/CentroidArea.cpp for inspiration,
and you'll have to mark each line with the "Last port: original work"
tag (see src/operation/sharedpaths/SharedPathsOp.cpp for example).

You can publish in-progress code in a pull request in the official
code repository [1] or any mirror to have the state of your work checked
by automated build bots.

It's recommended to file a trac ticket to plan inclusion of the new
code in next version (and reference the trac ticket number in the final
commit log or pull request title).

Feel free to ask more specific question as you move on.

[1] https://trac.osgeo.org/geos/wiki/CodeRepository

--strk;


More information about the geos-devel mailing list