Re: [Qgis-developer] GEOS geometry from QgsGeometry with the Python API?
On Wed, Apr 18, 2012 at 12:06:31AM +0200, G. Allegri wrote: Right, it would need some kung-fu across QGIS-GEOS python bindings. It was never really a top priority for me since QgsGeometry exposes the most important GEOS geometry algorithms. I would like to extend it, to include the linearref methods exposed by the C API: - GEOSInterpolate (- GEOSInterpolateNormalized) - GEOSProject (- GEOSProjectNormalized) Good idea to extend the QgsGeometry API. and other buffer methods like GEOSSingleSidedBuffer Ehm, please call it OffsetCurve (single-sided buffer was a wrong name, and means a buffer on a single side [areal result]). For now I will use the geos_c lib throug ctypes, but supporting some more GEOS C/API methods directly from C++ would remove a lot of overhead and would speed up performance, obviously. Why don't you extent QgsGeometry API ? --strk; ,--o-. | __/ |Delivering high quality PostGIS 2.0 ! | / 2.0 |http://strk.keybit.net - http://vizzuality.com `-o--' ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] GEOS geometry from QgsGeometry with the Python API?
Why don't you extent QgsGeometry API ? Because I'm not so much experienced with C++, and I'm scared :D But this could be a good occasion to get back to it ;) I will extend it on my github fork and send a push request as soon as I have it. giovanni --strk; ,--o-. | __/ |Delivering high quality PostGIS 2.0 ! | / 2.0 |http://strk.keybit.net - http://vizzuality.com `-o--' ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] GEOS geometry from QgsGeometry with the Python API?
On Mon, Apr 16, 2012 at 11:00 AM, G. Allegri gioha...@gmail.com wrote: Hi, I've just realized that the python api does't support the QgsGeometry.asGeos() method. I understand that it would require SIP to manage the marshalling and the bindings to GEOS too, so what is the best way to obtain a GEOS geometry from the QgsGeoemtry? Right, it would need some kung-fu across QGIS-GEOS python bindings. It was never really a top priority for me since QgsGeometry exposes the most important GEOS geometry algorithms. I mean, is there something better then passing through the WKB representation and creating a GEOS instance from python? That's probably the easiest thing right now. Internally, QgsGeometry is by default stored in WKB anyway. Martin ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] GEOS geometry from QgsGeometry with the Python API?
Right, it would need some kung-fu across QGIS-GEOS python bindings. It was never really a top priority for me since QgsGeometry exposes the most important GEOS geometry algorithms. I would like to extend it, to include the linearref methods exposed by the C API: - GEOSInterpolate (- GEOSInterpolateNormalized) - GEOSProject (- GEOSProjectNormalized) and other buffer methods like GEOSSingleSidedBuffer That's probably the easiest thing right now. Internally, QgsGeometry is by default stored in WKB anyway. For now I will use the geos_c lib throug ctypes, but supporting some more GEOS C/API methods directly from C++ would remove a lot of overhead and would speed up performance, obviously. giovanni Martin ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer