[gdal-dev] New PHP bindings - php5-gdal

2011-08-08 Thread Jean-François Gigand
Hi,

I am writing a PHP 5 module providing bindings for GDAL and OGR.

It is GPL3-licensed and available here:
http://projects.geonef.fr/projects/php5-gdal/wiki

It is far from complete, bindings are available for about a third of
the C++ interfaces.
I have been working on/with it for 8 months yet, and recently using it
on a production website as well.
I actually wrote the bindings I needed so far, the rest will follow
little by little, and any contribution is welcome.

php5-gdal provides PHP classes for the equivalent C++ class, same for
the methods. The C macro constants of GDAL/OGR are brought to PHP as
global constants.


I decided to write this library when I got limited at using OGR/PHP
(segfault crash) and noticed the latter has not been maintained for
years.
After trying to compile the SWIG bindings with no success, I thought a
good robust C++ code would be the best deal for providing OOP
interfaces to PHP.

As the GPL summary says, I hope that this library will be useful!
There is a dedicated ML, info on
http://ml.geonef.fr/mailman/listinfo/php5-gdal-dev

Best regards,

Jean-François Gigand - Geonef
Paris, France - http://geonef.fr/
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] New PHP bindings - php5-gdal

2011-08-09 Thread Jean-François Gigand
Hi,

2011/8/9 Daniel Morissette :
> On 11-08-09 04:04 AM, Peter Hopfgartner wrote:
>>
>> On 08/09/2011 12:32 AM, Jean-François Gigand wrote:
>>>
>>> Hi,
>>>
>>> I am writing a PHP 5 module providing bindings for GDAL and OGR.
>>>
>> This would be a very usefull addition to GDAL.
>
> We should add a link to it from the GDAL Wiki once the php5-gdal webpage is
> publicly available:
>
> http://trac.osgeo.org/gdal/#GDALOGRInOtherLanguages

Great!
With a notice that these bindings are yet incomplete.
I will soon update the wiki to list all available classes, methods,
functions and constants.

Would be good to have an API doc in php.net-style, if that's easy to do.

I have a few questions about prototype guidelines and how the
php5-gdal API should conform to. Closer to the GDAL/OGR C++ API or
closer to PHP's best practices? For example, should the constants be
kept in the global space, or should they move to class constants?

I also have questions about error management (use exceptions?) and
whether values returned through reference args should be returned
instead (such as arrays).
So far, I have stayed as close as possible to the GDAL/OGR API.

Is there anyone experienced with this type of issues, a foot in PHP
and another in C++ or GDAL, that I could discuss with?

>
>>> It is GPL3-licensed and available here:
>>> http://projects.geonef.fr/projects/php5-gdal/wiki
>>>
>> I'm wondering if it would'nt be more apprioprato to use the same license
>> as GDAL itself, see http://www.gdal.org.
>>
>
> Ideally BSD (in my mind), or at the minimum LGPL to make it clear that PHP
> code using it will not be bound by the GPL.
>
> (It is not clear to me whether scripting function calls to a CPL module
> makes the calling code bound to GPL as well. BSD or LGPL would avoid the
> question.)

I should have asked prior advise about what license suits best.
I'm not a specialist, but I agree that GPL is too restrictive for such
a library.
Since this work is nothing compared to the (amazing) set a features
provided by GDAL, it would be coherent that it inherit from the same
license. Moreover, PHP frameworks like Zend's or Symfony have a
BSD-style license.

I checked the PECL repository and most packages appear to be released
under the PHP license (http://www.php.net/license/3_01.txt), which
seems to suits PHP itself better than third-party extension modules.

So, I'm ok with choosing X11/MIT, unless any other strong advise is expressed.

>
>> BTW: I'm not able to access to the above mentioned address.
>
> There seems to be a password protection.
>

So sorry, there were per-IP rules that mislead my verification. Fixed now.


Jean-François Gigand - Geonef
Paris, France - http://geonef.fr/


> --
> Daniel Morissette
> http://www.mapgears.com/
> Provider of Professional MapServer Support since 2000
>
> ___
> gdal-dev mailing list
> gdal-dev@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] New PHP bindings - php5-gdal

2011-08-09 Thread Jean-François Gigand
Hi Thomas,

I actually noticed that initiative 2 days ago by searching the ML,
posts dated from around March.
If I had seen them on that time, I would have shared my code earlier.

I never used SWIG. When I wondered in last December if I should
leverage SWIG or write a C++ PHP extension, I chose the latter when I
noticed that the PHP SWIG bindings in GDAL were very old. I was also
encouraged when I noticed that for MapServer, the PHP MapScript
extension is written in core C, although they use SWIG for some other
languages like Python.

Mike Leahy, have you got anything working with the SWIG bindings?
Since you know SWIG, what do you think about this choice?


Jean-François Gigand - Geonef
Paris, France - http://geonef.fr/



2011/8/9 Tamas Szekeres :
>
>
> 2011/8/9 Jean-François Gigand 
>>
>> I decided to write this library when I got limited at using OGR/PHP
>> (segfault crash) and noticed the latter has not been maintained for
>> years.
>> After trying to compile the SWIG bindings with no success, I thought a
>> good robust C++ code would be the best deal for providing OOP
>> interfaces to PHP.
>>
>
>
> Hi Jean,
>
> I just wanted to mention, there have been some efforts recently by Mike
> Leahy to resurrect the php bindings, the corresponding ticket can be found
> here:
> http://trac.osgeo.org/gdal/ticket/3984
>
> However I'm not sure about the current status of this work and how the
> bindings work with the attached patches. Do you have experiences?
>
> Best regards,
>
> Tamas
>
>
>
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] tiled vector rendering

2011-08-10 Thread Jean-François Gigand
Hi Rashad,

There is MapServer, http://mapserver.org/
It supports GDAL and OGR sources as input.

It's not the only one but one of the most famous.

Best regards,

Jean-François Gigand - Geonef
Paris, France - http://geonef.fr/



2011/8/10 Mohammed Rashad :
> Is there any library which provide tiled vector rendering using GDAL/OGR ?
> how to build a tiled vector renderer.?? (big question expect any answer)
> Anyone please throw some light
>
>
> --
> Thanks && Regards
> Rashad
>
> ___
> gdal-dev mailing list
> gdal-dev@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] tiled vector rendering

2011-08-10 Thread Jean-François Gigand
There is QuantumGIS : http://www.qgis.org/

Again, not the only one. GRASS can also read GDAL/OGR datasources.

Not sure if gvSIG uses the GDAL library, but it supports many formats.

Bets regards;

Jean-François Gigand - Geonef
Paris, France - http://geonef.fr/



2011/8/10 Mohammed Rashad :
> Thanks, I need a desktop library. can you point me to one
>
> On Wed, Aug 10, 2011 at 9:03 PM, Jean-François Gigand  wrote:
>>
>> Hi Rashad,
>>
>> There is MapServer, http://mapserver.org/
>> It supports GDAL and OGR sources as input.
>>
>> It's not the only one but one of the most famous.
>>
>> Best regards,
>>
>> Jean-François Gigand - Geonef
>> Paris, France - http://geonef.fr/
>>
>>
>>
>> 2011/8/10 Mohammed Rashad :
>> > Is there any library which provide tiled vector rendering using GDAL/OGR
>> > ?
>> > how to build a tiled vector renderer.?? (big question expect any answer)
>> > Anyone please throw some light
>> >
>> >
>> > --
>> > Thanks && Regards
>> > Rashad
>> >
>> > ___
>> > gdal-dev mailing list
>> > gdal-dev@lists.osgeo.org
>> > http://lists.osgeo.org/mailman/listinfo/gdal-dev
>> >
>
>
>
> --
> Thanks && Regards
> Rashad
>
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] tiled vector rendering

2011-08-10 Thread Jean-François Gigand
I don't know OSSIM, and I don't understand what you really need to do.
You should understand the concepts first, then express what component
you need, for given inputs and outputs.

"tiled vector rendering engine": does that mean rendering vectors to
an image given style rules, or split large vectors into geographical
square tiles of vectors ?


Jean-François Gigand - Geonef
Paris, France - http://geonef.fr/




2011/8/10 Mohammed Rashad :
> now i will tell my requirement for more results from you
> I need a library based on OGR for OSSIM it should be a tiled vector
> rendering engine
> is there any library that I can get to inegrate with OSSIM + GDAL/OGR
>
> On Wed, Aug 10, 2011 at 9:20 PM, Jean-François Gigand  wrote:
>>
>> There is QuantumGIS : http://www.qgis.org/
>>
>> Again, not the only one. GRASS can also read GDAL/OGR datasources.
>>
>> Not sure if gvSIG uses the GDAL library, but it supports many formats.
>>
>> Bets regards;
>>
>> Jean-François Gigand - Geonef
>> Paris, France - http://geonef.fr/
>>
>>
>>
>> 2011/8/10 Mohammed Rashad :
>> > Thanks, I need a desktop library. can you point me to one
>> >
>> > On Wed, Aug 10, 2011 at 9:03 PM, Jean-François Gigand 
>> > wrote:
>> >>
>> >> Hi Rashad,
>> >>
>> >> There is MapServer, http://mapserver.org/
>> >> It supports GDAL and OGR sources as input.
>> >>
>> >> It's not the only one but one of the most famous.
>> >>
>> >> Best regards,
>> >>
>> >> Jean-François Gigand - Geonef
>> >> Paris, France - http://geonef.fr/
>> >>
>> >>
>> >>
>> >> 2011/8/10 Mohammed Rashad :
>> >> > Is there any library which provide tiled vector rendering using
>> >> > GDAL/OGR
>> >> > ?
>> >> > how to build a tiled vector renderer.?? (big question expect any
>> >> > answer)
>> >> > Anyone please throw some light
>> >> >
>> >> >
>> >> > --
>> >> > Thanks && Regards
>> >> > Rashad
>> >> >
>> >> > ___
>> >> > gdal-dev mailing list
>> >> > gdal-dev@lists.osgeo.org
>> >> > http://lists.osgeo.org/mailman/listinfo/gdal-dev
>> >> >
>> >
>> >
>> >
>> > --
>> > Thanks && Regards
>> > Rashad
>> >
>
>
>
> --
> Thanks && Regards
> Rashad
>
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] New PHP bindings - php5-gdal

2011-09-06 Thread Jean-François Gigand
Hi,

I have update the license of php5-gdal to the same as GDAL (I copied
the license block).
The project website is: http://projects.geonef.fr/projects/php5-gdal/wiki

If you want to add a link to
http://trac.osgeo.org/gdal/#GDALOGRInOtherLanguages, the project is
ready for it.

Regards,

Jean-François Gigand - Geonef
Paris, France - http://geonef.fr/



2011/8/9 Jean-François Gigand :
> Hi Thomas,
>
> I actually noticed that initiative 2 days ago by searching the ML,
> posts dated from around March.
> If I had seen them on that time, I would have shared my code earlier.
>
> I never used SWIG. When I wondered in last December if I should
> leverage SWIG or write a C++ PHP extension, I chose the latter when I
> noticed that the PHP SWIG bindings in GDAL were very old. I was also
> encouraged when I noticed that for MapServer, the PHP MapScript
> extension is written in core C, although they use SWIG for some other
> languages like Python.
>
> Mike Leahy, have you got anything working with the SWIG bindings?
> Since you know SWIG, what do you think about this choice?
>
>
> Jean-François Gigand - Geonef
> Paris, France - http://geonef.fr/
>
>
>
> 2011/8/9 Tamas Szekeres :
>>
>>
>> 2011/8/9 Jean-François Gigand 
>>>
>>> I decided to write this library when I got limited at using OGR/PHP
>>> (segfault crash) and noticed the latter has not been maintained for
>>> years.
>>> After trying to compile the SWIG bindings with no success, I thought a
>>> good robust C++ code would be the best deal for providing OOP
>>> interfaces to PHP.
>>>
>>
>>
>> Hi Jean,
>>
>> I just wanted to mention, there have been some efforts recently by Mike
>> Leahy to resurrect the php bindings, the corresponding ticket can be found
>> here:
>> http://trac.osgeo.org/gdal/ticket/3984
>>
>> However I'm not sure about the current status of this work and how the
>> bindings work with the attached patches. Do you have experiences?
>>
>> Best regards,
>>
>> Tamas
>>
>>
>>
>
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev