Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type of the function argument(s) incorrect for GDALInvGeoTransform and GDALApplyGeoTransform #53

Closed
yelnats opened this issue Sep 1, 2023 · 3 comments

Comments

@yelnats
Copy link

yelnats commented Sep 1, 2023

The type of the function argument(s) is incorrect which is a pointer to a scaler, but requires an array”

< $ffi->attach('GDALInvGeoTransform' => [qw/double[] double[]/] => 'int');
< $ffi->attach('GDALApplyGeoTransform' => [qw/double[] double double double* double*/] => 'void');

$ffi->attach('GDALInvGeoTransform' => [qw/double* double*/] => 'int');
$ffi->attach('GDALApplyGeoTransform' => [qw/double* double double double* double*/] => 'void');

@fpl
Copy link
Contributor

fpl commented Sep 10, 2023

The same issue appears even for CT* functions, where prototypes should be as follows:

 $ffi->attach('OCTTransform' => [qw/opaque int double[] double[] double[]/] => 'int');
 $ffi->attach('OCTTransformEx' => [qw/opaque int double[] double[] double[] int[]/] => 'int');
 $ffi->attach('OCTTransform4D' => [qw/opaque int double[] double[] double[] double[] int[]/] => 'int');
 $ffi->attach('OCTTransform4DWithErrorCodes' => [qw/opaque int double[] double[] double[] double[] int[]/] => 'int');
 $ffi->attach('OCTTransformBounds' => [qw/opaque double double double double double[] double[] double[] double[] int/] => 'int');

This isn't very pleasant because it renders the whole coordinate transformation unusable.

@shawnlaffan
Copy link
Collaborator

A PR would help clarify the changes needed.

The underlying issue might be in the header processing script, though, so it is perhaps best fixed there. That might best be done by Ari.
https://github.com/ajolma/Geo-GDAL-FFI/blob/master/build-tools/parse_h.pl

@fpl
Copy link
Contributor

fpl commented Sep 14, 2023

About parse_h.pl apparently it has a little issue with the parsing, because the double* should not be overridden for all args as in its sub parse_type with %use_array, else the fix would be quite trivial.
EDIT: I mean the whole logic of parse_type should change using some trick such as using an additional argument counter.

fpl added a commit to fpl/Geo-GDAL-FFI that referenced this issue Nov 15, 2023
fpl added a commit to fpl/Geo-GDAL-FFI that referenced this issue Nov 15, 2023
fpl added a commit to fpl/Geo-GDAL-FFI that referenced this issue Nov 18, 2023
fpl added a commit to fpl/Geo-GDAL-FFI that referenced this issue Dec 20, 2023
fpl added a commit to fpl/Geo-GDAL-FFI that referenced this issue Jun 11, 2024
… disabling GDAL error hanlding before creating new threads and re-enabling in each thread after.

No change is required in exisiting code. Just in case of multi-threading
the main thread needs to issue a SetErrorHandling() once after creating
all required threads just before using GDAL again.
shawnlaffan added a commit that referenced this issue Jun 12, 2024
Closes #53 with simple tests (this obsoletes PR #57 and PR #65)
fpl added a commit to fpl/Geo-GDAL-FFI that referenced this issue Jun 12, 2024
… disabling GDAL error hanlding before creating new threads and re-enabling in each thread after.

No change is required in exisiting code. Just in case of multi-threading
the main thread needs to issue a SetErrorHandling() once after creating
all required threads just before using GDAL again.
fpl added a commit to fpl/Geo-GDAL-FFI that referenced this issue Jun 12, 2024
… disabling GDAL error hanlding before creating new threads and re-enabling in each thread after.

No change is required in exisiting code. Just in case of multi-threading
the main thread needs to issue a SetErrorHandling() once after creating
all required threads just before using GDAL again.
fpl added a commit to fpl/Geo-GDAL-FFI that referenced this issue Jun 12, 2024
fpl added a commit to fpl/Geo-GDAL-FFI that referenced this issue Jun 12, 2024
… disabling GDAL error hanlding before creating new threads and re-enabling in each thread after.

No change is required in exisiting code. Just in case of multi-threading
the main thread needs to issue a SetErrorHandling() once after creating
all required threads just before using GDAL again.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants