[geos-devel] C API and Coordinates

Paul Ramsey pramsey at opengeo.org
Fri Aug 14 12:57:07 EDT 2009


Speaking from the PostGIS side, the CAPI is mostly an outgrowth of
meeting our use cases, which are build-geometries-and-run-a-test and
build-geometries-and-get-a-new-geometry. All our fine-grained access
to geometry internals is done back in PostGIS land, not against the
GEOS objects. Hence, no CAPI infrastructure for that.

Basically, if the CAPI doesn't already support use-case-x then you are
in open ground and will be the primary user of said use case if you
add it to the CAPI.

P.

On Fri, Aug 14, 2009 at 9:50 AM, David Turner<novalis at novalis.org> wrote:
> It looks like the C API doesn't really support Coordinates.  The only
> way I can figure out to pass Coordinates is to use Geometry* as a
> parameter, and use dynamic_cast<Point *> to ensure that the Geometry is
> Point.  This leads to long-winded code -- not to mention a lack of
> compile-time type-checking.
>
> I've attached a patch which demonstrates the approach I describe above.
> Unfortunately, it's not a very clean patch, because I realized I had
> forgotten to completely constify the linearref code.  When I submit a
> final patch, I'll break the const changes out into a separate patch.
>
> The alternative is that I could simply declare Coordinate in the C API.
> I'm not sure what consequences that would have, or why it was rejected
> in the first place -- but it would simplify the code here and perhaps
> elsewhere.
>
> Please let me know what approach is most likely to get my patch
> accepted, or if there's something obvious that I'm missing.
>
> _______________________________________________
> geos-devel mailing list
> geos-devel at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/geos-devel
>


More information about the geos-devel mailing list