[pgpointcloud] python tools for pgpointcloud

Rémi Cura remi.cura at gmail.com
Mon Feb 16 02:39:47 PST 2015


Good !

As a point cloud researcher, I find 2. complicated (state of the art
dictate to locally choose neighbourhood size and form with sophisticated
algorithm).
It may be better done with the pcl library, but alas the python binding are
very limited.

The python now work to convert a pcpatch to several .tif, with correct src,
no data, and type (limited by gdal).

I still have work to do (clean, doc, bypass to export dimension without
modification, export mask explicilty, automatically create VRT from images).

I'm currently blocked because of unclear gdal python VRT creation options,
but I can still use a workaround (manually creating xml).

As an expert of postgis-raster, do you know if there is a way to create out
of db postgis raster from python? (gdal claims to be read only)

Cheers,
Rémi-C

2015-02-14 15:23 GMT+01:00 Bborie Park <dustymugs at gmail.com>:

> Hey Rémi-C,
>
> Yes, I plan on working further to add new functionality for pgpointcloud
> in python.
>
> My current plans are (in order of priority):
>
> 1. PostgreSQL function to convert/transform a patch/point from one schema
> to another.
> 2. A "Map Algebra"-like PostgreSQL function for computing values per point
> and neighborhood.
> 3. Like you, create a raster from a stored pointcloud
> 4. Refactor the patch fitting code.
>
> It sounds like we may be able to collaborate on a few areas.
>
> -bborie
>
>
> On Sat, Feb 14, 2015 at 4:07 AM, Rémi Cura <remi.cura at gmail.com> wrote:
>
>> Hello Bborie,
>> by pure luck I found your github repo that propose python tools for
>> pgpointcloud.
>> (here <https://github.com/dustymugs/pgpointcloud_utils>)
>>
>> From what I understood it can import an ogr layer (or geojson) into
>> postgres as a pgpointcloud patch, creating schema and format for this type
>> of points.
>> (with some limitations, maybe scale and offset?)
>>
>>
>> I am also in need of a python way to use pgpointcloud, in the inverse
>> direction that you
>> (you did OGR *->* pgpointcloud, I'm doing pgpointcloud *<->*numpy *->*(gdal,
>> ...) )
>>
>> First I tried a swig python interface to pgpointcloud C lib,
>> but I couldn't use it correctly because I don't know how to fabricate C
>> pointer in python. (I can provide the few changes to get the automatic SWIG
>> API if somebody is interested)
>>
>> I wrote classes
>> <https://github.com/Remi-C/PPPP_utilities/blob/master/pointcloud/pg_pointcloud_classes.py>
>> to represent pc_schema, and tools to parse a xml pcschema and convert it to
>> the python class.
>> Then I wrote tools to convert pgpatch to/from strongly typed numpy array.
>>
>> Those numpy array seems to be good candidates as a python common type,
>> because many python lib understand numpy (including gdal, and all the
>> scientific lib I use, like python-pcl, scikit-learn, etc ).
>>
>> My next step
>> <https://github.com/Remi-C/PPPP_utilities/blob/master/pointcloud/patch_to_raster.py>
>> is to convert those numpy array into gdal rasters.
>>
>>
>> Obviously we already did some work twice (reading/writting wkb points for
>> instance, which was difficult for my python skill level).
>>
>> Do you plan (or somebody else) to work further on pgpointcloud python
>> interface?
>>
>> Cheers,
>> Rémi-C
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/pgpointcloud/attachments/20150216/1df62050/attachment.html>


More information about the pgpointcloud mailing list