Comments (7)
It's in Geo::GDAL::FFI::new since those are semi-automatic, to wrap it into Layer class is manual work. There's no Extent class and I'm not sure one is needed. This can be used as it is now by creating the extent as $e = [0,0,0,0] before the call and giving $t as a parameter.
from geo-gdal-ffi.
What about to get the extent for an existing layer?
from geo-gdal-ffi.
OK, I figured it out.
my $int = 1;
my $extent = [0,0,0,0];
my $e = Geo::GDAL::FFI::OGR_L_GetExtent ($$layer, $extent, \$int);
print 'Gives: ' . join ' ', @$extent;
# Gives: 0 100000 0 100000
Is this in the docs somewhere? Or a pointer to the calling convention?
from geo-gdal-ffi.
I usually add it to the docs when I wrap it. Calling it from the root class is left as an exercise to the user, it's a combination of looking at the GDAL docs and similar cases here. Note that the raw API may be incorrect since it is there by the header file parser.
from geo-gdal-ffi.
There might be some possibility to generate the methods using a factory approach if there are similarities in how they are handled. For example the Identity, Union etc methods for layers all look like they differ only in the Geo::GDAL::FFI::OGR_L_* call. Same for CreateField and CreateGeomField.
A quick check of argument sets is below.
grep 'attach' FFI.pm | gawk -vFS='/' '{print $2}' | sort | uniq -c | sort -n | sed 's/^[ ]*//' | gawk -vFS=' ' '$1 > 4'
5 opaque double double double double double double
5 opaque int opaque
5 opaque string double
6 int
7 opaque int int*
7 opaque opaque opaque opaque GDALProgressFunc opaque
8 opaque GDALProgressFunc opaque
8 opaque string string
9 opaque double
10 opaque double double double
10 opaque int int
11 opaque double double double double double
11 opaque int*
13 opaque string_pointer
13 string
18 opaque double double double double
44 opaque string
57 opaque int
71 opaque opaque
103
219 opaque
from geo-gdal-ffi.
PR for factory creation of overlay methods is in #10. Let me know if there are other obvious candidates
I'll submit PRs for other methods as I wrap them for my own code.
from geo-gdal-ffi.
Issue fixed by PR #11
from geo-gdal-ffi.
Related Issues (20)
- CreateLayer fails if SpatialReference arg exists but is invalid (undef or blank) HOT 3
- Test failure with GDAL 3.01 and Proj 6.2 HOT 1
- FFI::Platypus::Declare is now a separate distribution, needs to be added to Makefile.PL HOT 1
- Can't locate FFI/Platypus/Declare.pm in @INC HOT 2
- Drive by comment: consider ignore_not_found HOT 1
- Add recent OGRGeometry functions HOT 6
- ubuntu 20.04 unable to install using cpan or cpanm HOT 10
- How to do coordinate transformations in Geo::GDAL::FFI HOT 2
- Is the data dir check needed for GDAL >= 2.3.1? HOT 1
- Should Geo::GDAL::FFI::Band inherit from Geo::GDAL::FFI::Object? HOT 1
- Tests fail on FreeBSD as NITF is not found HOT 17
- warning received during loading $FFI::Platypus 'used only once' HOT 1
- Type of the function argument(s) incorrect for GDALInvGeoTransform and GDALApplyGeoTransform HOT 3
- Typo in Geometry.pm
- Thread safety issue. HOT 23
- Add Geo::GDAL::FFI::Layer::GetFeatureCount method
- Tests: use Test::TempDir::Tiny
- test failures in t/00.t
- Fails to build with GDAL 3.8.0 HOT 13
- Release version 0.11 to CPAN HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from geo-gdal-ffi.