Skip to content
Snippets Groups Projects
Verified Commit 8b147138 authored by sunpoet's avatar sunpoet
Browse files

math/p5-PDL-Transform-Proj4: Add p5-PDL-Transform-Proj4 2.097

PDL::Transform::Proj4 works like PDL::Transform::Cartography, but using the proj
library in the background.

The main object here is the PDL::Transform::Proj4 object, aliased to the
t_proj() function.

This object accepts all of the standard options described below, but mainly is
there to be called with just the proj_params option defined.

When options are used, they must be used with a '+' before them when placed in
the proj_params string, but that is not required otherwise. See the SYNOPSIS
above.

Please note that unlike PROJ, all angles in these operations are in degrees.
This is correctly (as of PDL 2.094) reflected in the PDL::Transform subclass
objects.

Other than t_proj(), all of the other transforms below have been autogenerated,
and may not work properly. The main problem is determining the parameters a
projection requires from the proj library itself.

Due to the difficulties in doing this, there may be times when the proj docs
specify a parameter for a projection that won't work using the anon-hash type
specification. In that case, just throw that parameter in the proj_params
string, and everything should work fine.
parent ba7c80a4
No related branches found
No related tags found
No related merge requests found
......@@ -833,6 +833,7 @@
SUBDIR += p5-PDL-Minuit
SUBDIR += p5-PDL-Opt-Simplex
SUBDIR += p5-PDL-Perldl2
SUBDIR += p5-PDL-Transform-Proj4
SUBDIR += p5-Parse-Range
SUBDIR += p5-Roman
SUBDIR += p5-Set-IntSpan
......
PORTNAME= PDL-Transform-Proj4
PORTVERSION= 2.097
CATEGORIES= math perl5
MASTER_SITES= CPAN
PKGNAMEPREFIX= p5-
MAINTAINER= sunpoet@FreeBSD.org
COMMENT= PDL::Transform interface to the Proj4 projection library
WWW= https://metacpan.org/dist/PDL-Transform-Proj4
LICENSE= ART10 GPLv1+
LICENSE_COMB= dual
BUILD_DEPENDS= p5-Capture-Tiny>=0:devel/p5-Capture-Tiny \
${RUN_DEPENDS}
LIB_DEPENDS= libproj.so:graphics/proj
RUN_DEPENDS= p5-PDL>=2.096:math/p5-PDL
USES= localbase perl5
USE_PERL5= configure
post-install:
${STRIP_CMD} ${STAGEDIR}${PREFIX}/${SITE_ARCH_REL}/auto/PDL/Transform/Proj4/Proj4.so
.include <bsd.port.mk>
TIMESTAMP = 1736671161
SHA256 (PDL-Transform-Proj4-2.097.tar.gz) = 9d429c69d9ba20bad7373b08631f491eabec4fbb6461424884fd4ceb794cbf2d
SIZE (PDL-Transform-Proj4-2.097.tar.gz) = 26981
--- lib/PDL/Transform/Proj4.pd.orig 2025-01-03 22:39:08 UTC
+++ lib/PDL/Transform/Proj4.pd
@@ -5,8 +5,8 @@ use warnings;
use strict;
use warnings;
+use Capture::Tiny ':all';
use File::Spec;
-use Alien::proj;
our $VERSION = "2.097";
pp_setversion($VERSION);
@@ -104,7 +104,7 @@ sub load_projection_information {
fixed Earth For CH1903
);
sub load_projection_information {
- my ($text, $stderr, $exit_code) = Alien::proj->run_utility ("proj", "-lP");
+ my ($text, $stderr, $exit_code) = capture{system "proj", "-lP"};
warn $stderr if $stderr;
die "proj -lP error $exit_code. See above for error text." if $exit_code;
my @chunks = $text =~ /(.+?)(?=(?:^\S|\z))/gms;
@@ -175,7 +175,6 @@ use PDL::Transform;
use warnings;
use PDL::LiteF;
use PDL::Transform;
-use Alien::proj;
=head1 NAME
--- Makefile.PL.orig 2025-01-03 22:41:17 UTC
+++ Makefile.PL
@@ -2,7 +2,6 @@ use PDL::Core::Dev;
use warnings;
use ExtUtils::MakeMaker;
use PDL::Core::Dev;
-use Alien::proj;
my @pd_srcs;
undef &MY::init_PM; # suppress warning
@@ -22,7 +21,6 @@ WriteMakefile(
CONFIGURE_REQUIRES => {
'ExtUtils::MakeMaker' => 0,
'PDL' => '2.096',
- 'Alien::proj' => '1.29', # guarantee minimum PROJ 7.1 as need degree_output
},
PREREQ_PM => {
'PDL' => '2.096',
@@ -30,8 +28,7 @@ WriteMakefile(
TEST_REQUIRES => {
'Test::More' => '0.88',
},
- INC => Alien::proj->cflags,
- LIBS => [Alien::proj->libs],
+ LIBS => ['-lproj'],
clean => { FILES => join ' ', qw(MANIFEST.bak) },
NO_MYMETA => 1,
);
--- t/gis_proj.t.orig 2024-12-03 06:57:09 UTC
+++ t/gis_proj.t
@@ -9,8 +9,6 @@ use PDL::Transform::Proj4;
LC_RUN_PATH);
}
use PDL::Transform::Proj4;
-use Alien::proj;
-diag "Alien::proj version $Alien::proj::VERSION";
my @version = eval { PDL::Transform::Proj4::proj_version() };
is $@, '', 'proj_version no die';
PDL::Transform::Proj4 works like PDL::Transform::Cartography, but using the proj
library in the background.
The main object here is the PDL::Transform::Proj4 object, aliased to the
t_proj() function.
This object accepts all of the standard options described below, but mainly is
there to be called with just the proj_params option defined.
When options are used, they must be used with a '+' before them when placed in
the proj_params string, but that is not required otherwise. See the SYNOPSIS
above.
Please note that unlike PROJ, all angles in these operations are in degrees.
This is correctly (as of PDL 2.094) reflected in the PDL::Transform subclass
objects.
Other than t_proj(), all of the other transforms below have been autogenerated,
and may not work properly. The main problem is determining the parameters a
projection requires from the proj library itself.
Due to the difficulties in doing this, there may be times when the proj docs
specify a parameter for a projection that won't work using the anon-hash type
specification. In that case, just throw that parameter in the proj_params
string, and everything should work fine.
%%SITE_ARCH%%/PDL/Demos/Proj4_demo.pm
%%SITE_ARCH%%/PDL/Transform/Proj4.pm
%%SITE_ARCH%%/auto/PDL/Transform/Proj4/Proj4.so
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment