[Liblas-devel] Why las2ogr based on OGR C API?

Mateusz Loskot mateusz at loskot.net
Sat May 17 08:25:29 EDT 2008


On May 17, 2008, at 12:40 AM, martin User wrote:
>> In case we want to link libLAS to GDAL, we need to use GDAL's
>> portable
>> option, means C API.
>>
>> [1] http://www.mozilla.org/hacking/best-cpp-practices.html
>
> I only wanted to say that it use C++ in not more modern than use C.  
> they
> are both valid hehe.


Understood.


> - C is the most portable language in the world.

I'd not be that extreme and not use "most" here.
See C89 vs C99 and POSIX vs non-POSIX. The major compiler on Microsoft  
platforms does not support C99, officially.

> - When you need make c++ bindings to other languages you need reinvent
> the wheel with swig or native APIs.

Personally, I don't like SWIG and I try to avoid it whenever I can.
Instead, I use boost-based technologies:
- Boost.Python
- Lua (http://www.rasterbar.com/products/luabind.html)
- C++/Tcl (http://cpptcl.sourceforge.net/)


> Finally VALA in the new language that compiles c# code to machine code
> using C/gobject like an intermediate language. This is really a modern
> programming language and work in all platforms.
> http://live.gnome.org/Vala

I know VALA and even if it looks promising,it's a very new thing and  
without any industry background. Let's wait a few years...

> There many new *modern* devices with only C/gobject support by now:

GObject is a non-standard (it's not an ANSI/ISO library) and platform- 
specific solution (GNOME and its frameworks is a platform I'm  
referring here). I respect you are a fun of it, however, I'd never go  
with it in a portable and platform-independent project.


Anyway, this kind of discussion belongs more to some advocacy forums  
about programming languages and platforms. So, I'm inclined to not to  
continue this topic here.

The facts are:
- libLAS is a multi-platform library written in ANSI C++ language with  
use of C++ Standard Library, layer of ANSI C API is also provided
- libLAS builds using wide range of toolsets [1], however some old  
compilers released near 1998/1999/2000, like Microsoft Visual C++ 6.0  
and GCC 2.95, may fail.

[1] We are sure that libLAS successfully builds with the same
range of toolsets as does Boost (means, it is multi-platform library):

http://www.boost.org/doc/libs/1_35_0/doc/html/jam/building.html

I believe there is no room for core changes like migration to GObjects  
or any other frameworks than standard implementation of C/C++  
Programming Languages and C/C++ Standard Libraries.


-- 
Mateusz Loskot, http://mateusz.loskot.net
Charter Member of OSGeo, http://osgeo.org







More information about the Liblas-devel mailing list