Skip to content

Commit

Permalink
Transform::Proj4 add NoPthread as using non-thread-safe API
Browse files Browse the repository at this point in the history
  • Loading branch information
mohawk2 committed Oct 3, 2024
1 parent 1038d63 commit 23fdf9f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
1 change: 1 addition & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
- split Graphics/IIS out to separate PDL::Graphics::IIS distro
- split Libtmp/Minuit out to separate PDL::Minuit distro
- Transform::Proj4 add NoPthread as using non-thread-safe API

2.093 2024-09-29
- PDL.set_datatype now doesn't physicalise input, PDL.convert_type does
Expand Down
22 changes: 13 additions & 9 deletions Libtmp/Transform/Proj4/proj4.pd
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ EOF

pp_def( 'fwd_transform',
Pars => 'lonlat(n=2); [o] xy(n);',
NoPthread => 1,
Doc => <<'EOF',
=for ref
Expand All @@ -105,6 +106,7 @@ EOF

pp_def( 'inv_transform',
Pars => 'xy(n=2); [o] lonlat(n);',
NoPthread => 1,
Doc => <<'EOF',
=for ref
Expand Down Expand Up @@ -224,22 +226,24 @@ PDL::Transform::Proj4 - PDL::Transform interface to the Proj4 projection library
use PDL::Transform::Cartography;
use PDL::Transform::Proj4;
use PDL::Graphics::Simple;
$x = earth_coast();
$x = graticule(10,2)->glue(1,$x);
$t = t_proj( proj_params => "+proj=ortho +ellps=WGS84 +lon_0=-90 +lat_0=40" );
$e = earth_image('day');
($c, $pen) = graticule(10,2)->glue(1,earth_coast())->clean_lines;
$t = t_proj(proj_params => "+proj=ortho +ellps=WGS84 +lon_0=0 +lat_0=40");
$w = pgswin();
$w->plot(with=>'polylines', $t->apply($x)->clean_lines);
$w->plot(with=>'fits', $e->map($t),
with=>'polylines', clean_lines($c->apply($t), $pen), {j=>1});
# Using the aliased functions:
# Make an orthographic map of Earth
use PDL::Transform::Cartography;
use PDL::Transform::Proj4;
use PDL::Graphics::Simple;
$x = earth_coast();
$x = graticule(10,2)->glue(1,$x);
$t = t_proj_ortho( ellps => 'WGS84', lon_0 => -90, lat_0 => 40 )
$e = earth_image('day');
($c, $pen) = graticule(10,2)->glue(1,earth_coast())->clean_lines;
$t = t_proj_ortho( ellps => 'WGS84', lon_0=>0, lat_0=>40 );
$w = pgswin();
$w->plot(with=>'polylines', $t->apply($x)->clean_lines);
$w->plot(with=>'fits', $e->map($t),
with=>'polylines', clean_lines($c->apply($t), $pen), {j=>1});
=head1 DESCRIPTION
Expand Down Expand Up @@ -350,7 +354,7 @@ Arithmetic mean of the major and minor axis, Ra = (a + b)/2.
=head3 R_g
Geometric mean of the major and minor axis, Rg = (ab)1/2.
Geometric mean of the major and minor axis, Rg = (ab)/2.
=head3 R_h
Expand Down

0 comments on commit 23fdf9f

Please sign in to comment.