Changes between Version 17 and Version 18 of FAQ


Ignore:
Timestamp:
Apr 22, 2007, 10:50:05 AM (17 years ago)
Author:
Mateusz Łoskot
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • FAQ

    v17 v18  
    77 5. [wiki:FAQCoordinateSystemsAndProjections Coordinate Systems and Projections]
    88 6. [wiki:FAQMiscellaneous Miscellaneous]
    9 
    10 == Miscellaneous ==
    11 
    12 === Is the GDAL library thread-safe? ===
    13 
    14 No. GDAL is not completely thread safe.
    15 
    16 However for GDAL 1.3.0 much work has been done on making some common scenarios thread safe. In particular for the situation where many threads are reading from GDAL datasets at once should work as long as no two threads access the same [http://www.gdal.org/classGDALDataset.html GDALDataset] object at the same time. However, in this scenario, no threads can be writing to GDAL while others are reading or chaos may ensue.
    17 
    18 Also, while the GDAL core infrastructure is now thread-safe for this specific case, only a few drivers have been vetted to be thread safe.
    19 
    20 It is intended that work will continue on improving GDAL's thread safety in future versions.
    21 
    22 === Does GDAL work in different international numeric locales? ===
    23 
    24 No. GDAL makes extensive use of ''sprintf()'' and ''atof()'' internally to translate numeric values. If a locale is in effect that modifies formatting of numbers, altering the role of commas and periods in numbers, then PROJ.4 will not work. This problem is common in some European locales.
    25 
    26 On Unix-like platforms, this problem can be avoided by forcing the use of the default numeric locale by setting the ''LC_NUMERIC'' environment variable to ''C'', e.g.
    27 
    28 {{{
    29 $ export LC_NUMERIC=C
    30 $ gdalinfo abc.tif
    31 }}}
    32 
    33 === How do I debug GDAL? ===
    34 
    35 Various helpful debugging information will be produced by GDAL and OGR if the ''CPL_DEBUG'' environment variable is set to the value ''ON''. Review the documentation for the [http://www.gdal.org/ogr/cpl__error_8h.html CPLDebug()] function for more information on built-in debugging messages.
    36 
    37 On Unix operating systems GDAL can be built with the ''CFG'' environment variable set to ''debug'' to enable debugger support with the ''-g'' compiler switch.
    38 
    39 On Windows edit the nmake.opt and ensure ''/Zi'' appears in the ''OPTFLAGS'' variable.
    40 
    41 === How should I deallocate resources acquainted from GDAL on Windows? ===
    42 
    43 The safest way to release resources allocated and returned (with ownership transfered to caller) from GDAL library is to use dedicated deallocator function. Deallocators promise to release resources on the right module side, without crossing modules boundaries what usually causes memory access violation errors.
    44 
    45  * Example of correct resource deallocation:
    46 
    47 {{{
    48 OGRDataSource* poDS = NULL;
    49 
    50 // OGRDataSource aquisition made on side of the GDAL module
    51 poDS = OGRSFDriverRegistrar::Open( "point.shp", FALSE );
    52 
    53 // ...
    54 
    55 // Properly resource release using deallocator function
    56 OGRDataSource::DestroyDataSource( poDS );
    57 }}}
    58 
    59 * Example of incorrect resource deallocation:
    60 
    61 {{{
    62 OGRDataSource* poDS = NULL;
    63 
    64 // OGRDataSource aquisition made on side of the GDAL module
    65 poDS = OGRSFDriverRegistrar::Open( "point.shp", FALSE );
    66 
    67 // ...
    68 
    69 // Deallocation across modules boundaries.
    70 // Here, the deallocation crosses GDAL DLL library and client's module (ie. executable module)
    71 delete poDS;
    72 }}}
    73 
    74 More detailed explanation of the problem can be found in the [http://blogs.msdn.com/oldnewthing/archive/2006/09/15/755966.aspx Allocating and freeing memory across module boundaries] article.