libgeo-shapelib-perl-0.22/0000755000175000017500000000000013221543744015250 5ustar frankiefrankielibgeo-shapelib-perl-0.22/typemap0000644000175000017500000000010613042422412016634 0ustar frankiefrankieTYPEMAP SHPHandle T_PTROBJ DBFHandle T_PTROBJ SHPObject * T_PTROBJ libgeo-shapelib-perl-0.22/Makefile.PL0000644000175000017500000000540113042426001017205 0ustar frankiefrankieuse strict; use ExtUtils::MakeMaker; use File::Basename qw(fileparse); # The location of shapelib (libshp) can be given as a command line # param or as an env var. my %ARGV; for (@ARGV) { $ARGV{$1} = $2 if /^--(.*?)\=(.*)/; $_ = '' if /^--shapelib/; } $ARGV{shapelib} = $ENV{PERL_SHAPELIB} unless defined $ARGV{shapelib}; # If not given, search. unless (defined $ARGV{shapelib}) { # scan known possible locations in the order of preference: my @locs; for (qw(/usr/lib /usr/lib64 /usr/lib/x86_64-linux-gnu /usr/local/lib /usr/local/lib64)) { # prefer a shared lib my $lib = $_ . '/libshp.so'; $lib = $_ . '/libshp.a' unless -e $lib; push @locs, $lib if -e $lib; } if (@locs) { print "Found shapelib(s): '",join("', '", @locs),"'.\n"; $ARGV{shapelib} = $locs[0]; print "Will use '$ARGV{shapelib}'.\n"; } } die "Can't find shapelib.\n". "Please install a development version of shapelib or\n". "specify the location of libshp.a or libshp.so with\n". "command line parameter --shapelib= or with environment\n". "variable PERL_SHAPELIB.\n". "You can get shapelib from http://download.osgeo.org/shapelib/." unless -e $ARGV{shapelib}; # Does the shapelib define SHPSearchDiskTree? my $HAS_SEARCH_DISK_TREE; if ($ARGV{shapelib} =~ /\.a$/) { my @ret = `nm $ARGV{shapelib} | grep SHPSearchDiskTree`; $HAS_SEARCH_DISK_TREE = $ret[0] ne ''; } else { my @ret = `readelf -Ws $ARGV{shapelib} | grep SHPSearchDiskTree`; $HAS_SEARCH_DISK_TREE = $ret[0] ne ''; } warn "Warning: Shapelib is old version. You will not be able to save quadtree index." unless $HAS_SEARCH_DISK_TREE; my ($file, $path, $suffix) = fileparse($ARGV{shapelib}); my $libs; my $inc; my $define; if ($HAS_SEARCH_DISK_TREE) { $libs = ["-L$path -lshp"]; $inc = "-I$path"; $define = '-DHAS_SEARCH_DISK_TREE'; } else { $libs = ["-L$path -lshp"]; $inc = "-I$path"; $define = undef; } WriteMakefile( NAME => 'Geo::Shapelib', VERSION_FROM => 'lib/Geo/Shapelib.pm', PREREQ_PM => {'Tree::R' => 0.01}, # e.g., Module::Name => 1.1 ABSTRACT_FROM => 'lib/Geo/Shapelib.pm', LIBS => $libs, DEFINE => $define, INC => $inc, clean => {'FILES' => 'stations.* example/test.*'}, AUTHOR => 'Ari Jolma ', LICENSE => 'perl_5', META_MERGE => { 'meta-spec' => { version => 2 }, resources => { repository => { type => 'git', web => 'https://github.com/ajolma/Geo-Shapelib', url => 'https://github.com/ajolma/Geo-Shapelib.git', }, }, } ); libgeo-shapelib-perl-0.22/META.yml0000644000175000017500000000124013042430442016505 0ustar frankiefrankie--- abstract: 'Perl extension for reading and writing shapefiles as defined by ESRI(r)' author: - 'Ari Jolma ' build_requires: ExtUtils::MakeMaker: '0' configure_requires: ExtUtils::MakeMaker: '0' dynamic_config: 1 generated_by: 'ExtUtils::MakeMaker version 7.24, CPAN::Meta::Converter version 2.150005' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: Geo-Shapelib no_index: directory: - t - inc requires: Tree::R: '0.01' resources: repository: https://github.com/ajolma/Geo-Shapelib.git version: '0.22' x_serialization_backend: 'CPAN::Meta::YAML version 0.018' libgeo-shapelib-perl-0.22/example/0000755000175000017500000000000013042430442016672 5ustar frankiefrankielibgeo-shapelib-perl-0.22/example/xyz.shp0000755000175000017500000023425013042422412020247 0ustar frankiefrankie' T AGZ'PAGz3zA3PA QG%A ף (PA = ף%Aףp (PA 'A(l(PA (Aq= (PA Q$A-(PA GX(A(PA #A\F(PA Q%Aq= <(PA ffff#A\u^(PA G$Aq= ^(PA Q'Az\(PA G#A= k(PA #AQHt(PA p= &A_(PA Hz"AQ(PA Qf%AfffV(PA \%Afffv(PA \!AG᪨(PA Qc#A ף`(PA $A{7(PA (\!AQ(PA Hz$Afffv(PA z A(PA z Aq= W(PA %#Ap=(PA (\#AR(PA 3333 A(PA G!Aףpm(PA z A)PA (\#"A ף)PA ("AQ~)PA HzAz)PA!  ףp"A)PA" ̈A3)PA# )\ AQ*)PA$ z/!A(=)PA%  ףpA\uP)PA& AHztD)PA' p= A333CW)PA( )\A= q)PA) (1 AQk)PA* A()PA+ (\A̼)PA, {GAGᚠ)PA-  AfffV)PA. QvAR)PA/ QA)PA0 \Az)PA1 )\xA)\)PA2 3333A)PA3 HzIA\)PA4 jAG)PA5 RAk)PA6 q= aAz)PA7 (\AQ^)PA8 (\AA*PA9 GzeAp=Z*PA: (\Aq= *PA; 3333A{#*PA< -AQX"*PA= p= Aףp6*PA> )\¥A)\P*PA? {GJAREI*PA@ (\CAffffh*PAA  ףpUAX*PAB )\‹Afff*PAC ףp=AQ*PAD G|Ai*PAE ffffAG*PAF QQA{7*PAG \A(\*PAH Aq= *PAI {GRAQ*PAJ = ף0A0*PAK = ףzAG*PAL A<*PAM (\Az*PAN IA+PAO ףp=Aףp3+PAP \%A= c$+PAQ ףp=oAG1F+PAR Gz+A(\4+PAS AQe+PAT QA ף`W+PAU HzA\z+PAV A\+PAW (\A\5+PAX ףp=^Ay+PAY GzAHzt+PAZ = ף:AQ+PA[ z Afff+PA\ p= A+PA] QA(\o+PA^ (\ A\e+PA_ zAA)\+PA` Q AGz+PAa Q+ A ,PAb Hz[ A ף*,PAc \ A(,PAd (\)AHz+,PAe p= G A\4,PAf } A(X,PAg {G Aq= O,PAh z A ף u,PAi q= F A\%q,PAj z Aq= ,PAk (\d Aףp ,PAl Gz@ A(\?,PAm Hz> Ay,PAn  AQȹ,PAo 7 A,PAp  AQ,PAq GAfff,PAr GG Afff6,PAs \%A -PAt Q%A('-PAu GzlAz."-PAv ףp=I AG#-PAw zA{W@-PAx \A@-PAy {GAXN-PAz  ףpsAGr-PA{ (_AQxg-PA| 3333AQ-PA} GARy-PA~ q= ׏A ף0-PA = ףA-PA HzAQ-PA q= A\e-PA  A)\R-PA p= lA.PA ףp=`A".PA p= A:.PA 3333@A333%.PA QA(\O6.PA QAq= E.PA \uAQR.PA zA@T.PA )\XA(U.PA (\Ap=:.PA )\Ap=.PA &AG(PA )AfffV&(PA  ףp%AG:9(PA ףp=)Aq= B(PA R~#AGq(PA Gz'AHzd(PA Hzi'A|(PA Hz"A\…(PA z%Az(PA z"A333(PA Hz$A(\(PA )\N AHz&)PA z"Ap=Z6)PA "AQ^Q)PA QAHzp)PA {G AG)PA QAGJ)PA (\AQ)PA zA\5)PA ffffARU)PA q= A;)PA {G|A\ *PA Aףp8*PA (\AHzY*PA p= AG!y*PA GAfffֵ*PA ףp={Ap=*PA 3333A)\R*PA p= AHz*PA QA{*PA QA{g+PA \UA(\O+PA zA)\$+PA 7A7+PA HzxA\…T+PA ffffAp=z+PA HzAףp-+PA )\A+PA )\EAHzt,PA Q A=,PA ףp= A(\?m,PA GZ A\u,PA = ףh A,PA  AQX,PA G" A( ,PA )\' Ap= -PA AYO-PA zAHzj-PA  A= ף-PA (\AHzt-PA QA)\§-PA QXAG-PA QAz-PA )\bA333C-PA )\A ף@.PA q= Azn.PA GAl.PA RA(|.PA  ףp+A(\_)(PA (\'Afffv/(PA )\¿&A!_(PA Q`)AU(PA ףp=)A ףx(PA (%AQة(PA $AQH )PA (\j"A ף!)PA Q%Afff)PA GO!AW)PA !A\¥o)PA p= #Aq= j)PA q= ; A\)PA Hz A= )PA 3333AK)PA ffffA333)PA = ףA)PA 3333A`)PA ףp=A{GI*PA QQAM*PA GuAp= h*PA (\FAPu*PA RJA ף*PA {GAq= W*PA ffffNAHzԯ*PA Ak*PA XA1+PA ףp=VAp=*@+PA ̒A3338+PA ffffAHz`+PA ffff,Ab+PA \AG~+PA GzAG~+PA /A ף0+PA Gz A+PA (\AQ(+PA ffffAQ+PA 8A+PA G#AQ+PA QA(+PA QaA ף ,PA HzAGA#,PA RAG,PA GgAG<,PA ({A= 3,PA RaAGG,PA QlA,q,PA {GAQ(t,PA zc A(\,PA Q AHz,PA \g A{',PA ( AR%,PA HzAk,PA Q A ף ,PA ףp= A|-PA  A= ׃-PA G A!-PA Q' A̬?-PA Q A3-PA QA(\?U-PA \ AGK-PA (' Al-PA (< A\v-PA AȔ-PA ףp=D A롢-PA 3333uA ף-PA )\AQ-PA GzAG!-PA zAp=.PA  ףp A{-PA AG:.PA  Aףp .PA GzsA{/.PA ffff&A{'.PA Q AG1J.PA zǍ=.PA ARՖ.PA ףp=AR.PA (\A.PA )\ A= s.PA AQ.PA A.PA GS,AG:(PA {G(AGu(PA p)AG*(PA (\%Ap=(PA (K(Afff(PA p= `(Afff(PA (\E$A( )PA! = ףo&AQ^?)PA" \$A )PA# 3333E"AQ)PA$  ףp!Ap=*)PA% ffffA)PA& (\""AR%)PA' (A\u*PA( = ף AG*PA) {G AR,*PA* u AQn**PA+ (\AS*PA, A= ]*PA- RA\•f*PA. 3333 A(\_*PA/ AHr*PA0 RA{W*PA1 (\XA)\*PA2 A*PA3 )\tA(\?*PA4 3333A)\+PA5 QAR+PA6 q= DA( +PA7 ףp=Aq= .+PA8 GzA)\R,+PA9 PAGi+PA:  ףp]AQH+PA; Q4AQn+PA< QAQ.+PA= (\Az^+PA> A\+PA? p= 9Afff+PA@ q= צA= ,PAA AGA,PAB QAAU,PAC = ף+A(\ot,PAD mAz^,PAE  ףpOA333,PAF {G A@,PAG )\‡Az,PAH QAQ,PAI p= \ A(-PAJ = ףX A8-PAK z[ A ף L-PAL  ףp AHf-PAM Hz} A= c-PAN ze A|-PAO z7 AQ-PAP = ףA{G-PAQ \@ A= -PAR 3333) AY-PAS zA0-PAT GA ףP.PAU QAR:.PAV (\APO.PAW 33335Ap=*j.PAX \6As.PAY ('A.PAZ ffffAp=.PA[ \tAG.PA\ (\+A(PA] )\9-A)\(PA^ (.A(PA_ (\e+Ap=<(PA` 3333}+A(^(PAa )\‹*A(PAb Qa(A= c(PAc z9&Ap=(PAd z)A= s(PAe C&Ap= )PAf z'Aq= )PAg ( %A= ;)PAh {G (Aףp]9)PAi QO$A\eX)PAj Q&A(\X)PAk = ף#Ab)PAl GzN#AfffF)PAm zt#Ap= )PAn Q"ARe)PAo ̯!Ap=)PAp  ףp"A\e)PAq ̚!A()PAr ףp=!AG,*PAs Q AQK*PAt (\AGy*PAu \A(\o*PAv QA(̈*PAw HzAAףp*PAx R:A*PAy GzA*PAz A ףp*PA{ QA+PA| 3333^AGJJ+PA} Hz|A(l_+PA~ (\yAG*U+PA = ףAHz|+PA  ףpUAGf+PA 3333AR+PA \YAHzԠ+PA = ףAG+PA G)AG+PA RAa+PA (Ap=Z+PA .A(\ ,PA AG,PA 3333A333.,PA 7Aa>,PA p= A\6,PA q= ץAhZ,PA \0AfffF],PA (\Ap=Z,PA Q[Al,PA p= Az,PA Aa,PA GA,PA zzA,PA  A(\/ -PA ffffA ף -PA (z A= '-PA R A(\_?-PA \1 AQ(W-PA Gz A)\"q-PA ffff Aףp-PA Hz ARU-PA 3333 AR%-PA {GI Ap=ڼ-PA Q A-PA  ףp Ap=.PA  Ap=!.PA G9 A1.PA (AR.PA {G#AQj.PA zAp=l.PA ףp=A ף@m.PA (\A= cy.PA ףp=A\E.PA  ףpA,.PA ̇A ף.PA q= Afff.PA {G-A ף%(PA z0AGZ"(PA {G/AE(PA Gz^/A^(PA Q*A ףpu(PA Qu.A= ׳v(PA Q,AG(PA HzR.AG(PA q= ׭)A8(PA {G+A(\(PA {Gn)A= ׃(PA Q*A{(PA q= ׻'AI!)PA (\)AQ4)PA p= 'A ףU)PA Qm%Aq= 7p)PA (\%AGa)PA Q$A()PA p= $A{ץ)PA 3333B$A)PA fffft#AP)PA (\A#A)PA (!AGq*PA 6#AHz*PA GzD"AHzM*PA (\C A= #f*PA ףp="A1c*PA Z AR5q*PA GzA)\R*PA 3333_A ף@*PA z}AQ*PA QAQ*PA (\AfffF*PA zkA ף+PA zA(.+PA {G,AC+PA {G A(U+PA )\yA+PA GzGAG+PA )\A(+PA GzOAR+PA HzAp=J+PA AHz4,PA G A ף+PA (\A(,PA QAg,PA ףp=A̬l,PA R%Aףp],PA )\?Az,PA z1A ף,PA )\A\,PA QA)\B,PA HzAA,PA GA,PA zA!-PA Q|A%-PA ffffA ף @-PA  ףpAp=ZI-PA ( AQ>r-PA )\a AHz-PA ףp=K Ax-PA  A= -PA  A.PA z A.PA \D AGQ.PA QH AHzdi.PA Az.PA {GAQX.PA p= Ap= .PA = ףzAq= .PA (\Aq= G/PA QARu!/PA HzX0A(PA ףp=.AQ'(PA QY0Aq= -(PA {G.A333F(PA ,A(\/T(PA zM-A)\\(PA ffff@,ARw(PA R-AQ(PA z?+AX(PA 3333*Az(PA )\+A(PA (\-AGz(PA Hz,Aףp](PA \O)Az )PA  ףpN+AR )PA \`)A#)PA \*AQP)PA ffff#'AGZj)PA ףp=8'AHz)PA q= &AHzԠ)PA Q(Ap)PA G%Aq= W)PA  ףp'A{)PA zq%Afff6)PA ($AQ)PA z&AG)PA ̈$A ףp*PA 3333M$A)\*PA Q|%AQ*PA Hz#AQX9*PA ףp=#Ap=zH*PA p= !A@*PA Q Aq= *PA (\C"A333c*PA QAq= W*PA (\} AG*PA \| A*PA &AG*PA &A ף`+PA (\AQ1+PA Q|A3+PA  ףp{A)B+PA  ףpAq= G]+PA QA)\Bk+PA (1AQh+PA QhAHz$+PA! wA+PA" q= AR+PA# ףp=yǍ+PA$ GzA\E+PA% AQ+PA& QLAY ,PA' (\ARE!,PA( NA4,PA) QA= X,PA* (\WAQ(Z,PA+ (YAd,PA, Gz/A ,PA- Gz7AG,PA. QA333,PA/ 5A(,PA0 (\A{-PA1 3333 A1'-PA2 (\Aףpm-PA3 {G|AR%;-PA4  A= Z-PA5 ffffgAQr-PA6 (Al-PA7 |AQ-PA8 )\ A|-PA9 \Aףp-PA: Gz A-PA; (\A롳-PA< ( AHzT-PA= (g A= ׃-PA> \ AP-PA? )\U Az.PA@ = ף AHz-PAA QR A(\O.PAB Q A9.PAC ? A{;.PAD ̴ AQS.PAE p= A(\`.PAF (G AG}.PAG z Az.PAH = ףAHz.PAI  A(.PAJ  ףpA= #.PAK RA.PAL (\AQ/PAM QAG .PAN = ף/A(/PAO HzA/PAP )\1Ax'PAQ zl3A{'PAR Q.AQr(PAS (\0A)\b(PAT \0AHz(PAU = ף,Afff(PAV Q<-Az(PAW HzR,A(\?(PAX Hz.Aףp)PAY \*A{)PAZ (B*A{w;)PA[ (\ *A{S)PA\ p= [)AQ~)PA] (\(AfffF)PA^ )\ 'Az~)PA_ 3333_'AG)PA` &Azn*PAa Hze'AG*PAb {G%AQn**PAc Q&AHz+*PAd (<$A,P*PAe (#Ai*PAf Q\#Aznr*PAg = ףw#A*PAh 3333!AQ.*PAi (\D"AHz*PAj z!Aq= *PAk Hz A= S*PAl A+PAm Hz!A= ףB+PAn {G3 Ap=J6+PAo Hz*A{WY+PAp ]A+PAq {GA(\+PAr q= דAQ+PAs ARe+PAt {GzA,PAu )Ap=*,PAv ףp=A(|D,PAw (\kAq= '2,PAx HzA{S,PAy At,PAz Gz;A ,PA{ (\Aףp},PA| QAQ^,PA} = ףQA,PA~ RAq,PA (\6Aףp -PA (A)\8-PA QA)\"?-PA HzAQW-PA ffffA-PA ffffAQ-PA  ףpAp=-PA (\{A(\-PA ףp=A ף-PA (\ A)\!.PA ףp= A ףR.PA (\\ Afffd.PA (\ A333s.PA ffff A.PA  A)\B.PA 1 A333.PA Q Ap=.PA F A ף.PA {G Az.PA z1AG(PA y3A= ,(PA 1A333B(PA q= 0Aq^(PA R9.AGѩ(PA q= .Aףp(PA q= ד-A(PA )\.,A ף )PA \t,Afff7)PA Z.AQ9)PA \)AHzdo)PA )\a*Azm)PA p= D+A(\O)PA  ףp+AGQ)PA Hz)A{)PA (\'Aq= M*PA O%A|k*PA HzL%Azy*PA (\%Aat*PA Q#AGʶ*PA Q#A( *PA q= "Aףp *PA RG"A+PA p= Aq= w++PA ̹ A S+PA 3333 A\UR+PA Aq+PA HzAG1+PA QA9+PA G AR+PA A",PA QQA ף@^,PA = ףA333u,PA A ף,PA G$AQޢ,PA  ףp,Afff,PA QAp=-PA R-A($-PA +AGP-PA )\yA333#h-PA ZAz>-PA q= AGj-PA zA.PA QA!".PA Q Az..PA {G AQJ.PA Qi A= .PA (\w Aףp.PA \i A.PA q= < AX.PA Gh ARu.PA {G A.PA A#/PA ffff_3AQx(PA ףp=6A+(PA q= 4Aq= D(PA Q4A\(PA (\p4AGZt(PA \.AQ>(PA Q-A{ )PA Gz@,AfffH)PA q= +AQ_)PA *A\)PA )A)\)PA R1)A= s)PA GzP+Aףpm)PA  ףpm+A)PA I(A\E*PA q= *AQn)PA p= )A= ׃ *PA 'A̜6*PA (&AGaR*PA &AQl*PA $%AHz*PA R%Afff*PA G$AHz*PA Gz#A*PA (\#A{*PA @"Afff6.+PA {G~ Azt+PA 3333b A+PA (\AH+PA UA+PA GzA+PA (\Aq= +PA A+PA QA333,PA Aףp},PA A(\h,PA ffff_A333Cy,PA GzAp=,PA (\A ף,PA A= ,PA \A,PA QAz>,PA Q>AQN,PA q= קAR"-PA \5Ay&-PA \AGZ0-PA QsAq= Q-PA 33331AG1m-PA  ףpA-PA QAz.-PA q= A-PA QzAGq-PA 3333Ap=-PA ffff AQ-PA (\ A)\"-PA 3333 AQ~.PA ףp=A.PA GzAQn+.PA q= ~Aףp@.PA \ AGJk.PA {G AQȟ.PA Hz[ A)\.PA h A;.PA  A.PA  A(L.PA  Afff6/PA  A(\_/PA Gz5AGj'PA (\6Afff'PA \4A8 (PA (8A(PA 4A (PA (\7A!(PA )\.3A?(PA 3333|6A(,E(PA \2AGJ(PA z'6AR%\(PA p= 1A)\Rv(PA (2ARk(PA 33331A(PA ffff|2AHz$(PA fffft4Afff(PA {G0A (PA )\d3Aq= (PA R71Afffv(PA ́0A(PA )\'3A(PA G3/AR%(PA Q.A )PA (\.Aq= ')PA! {G.A)\%)PA" p= f0Az)PA# 0AW)PA$ {G2.A\%r)PA% ,Afffv)PA& -A{)PA' ffff+AfffF)PA( )\+Aq= )PA) q= =-AQ)PA* +AQ)PA+ *AQ)PA, +A{g*PA- Q)Az)*PA. 'Ap=j*PA/ QP(AQ*PA0 G&AG*PA1 {G&A(\*PA2  ףpN%Az*PA3 \%A333*PA4 GN%A(\*PA5 \#AQ~+PA6 {G#AGj +PA7 \F"AC+PA8 )\!A(\{+PA9 = ף A+PA: G Aq= +PA; (\'A)\"+PA< {GAQ-,PA= (\A333F,PA> lA<,PA? ffffA333P,PA@ q= wA= sG,PAA EA``,PAB \A)\,PAC q= sA{,PAD A333,PAE (\8Afffv -PAF GzAGA-PAG QAGm-PAH QAfffƣ-PAI Gz9AQ-PAJ = ףA(-PAK QAfff.PAL HzA\¥1.PAM QA(\H.PAN QhAj.PAO = ף(A o.PAP = ף{A)\.PAQ f AHzT.PAR ( A.PAS GL Aףpm.PAT ףp=+6Az(PAU Ra6Ao(PAV = ף&2AR(PAW 33334Aq= (PAX q= 4Aףp=(PAY (2A)\B#)PAZ p= 1AQ8)PA[ 1Aq= @)PA\ = ף.Aq= U)PA] {G/A333Cq)PA^ ףp=D-A( )PA_ (\+AfffV)PA` Hz8.A()PAa G-A)PAb Q+AG6*PAc (A)\R*PAd G'A\u*PAe )\(AQ*PAf QL'Aе*PAg z&A\u*PAh (\!'A ף*PAi QL%AGq+PAj = ףD%A ףP1+PAk (\#A!<+PAl p= #A\¥M+PAm !A+PAn h!A(+PAo {GZ A)+PAp = ף A,PAq (\A(+PAr zA= 3,PAs HzAp3,PAt LAz..,PAu 33335Aq= GG,PAv GAfffv,PAw zMARe,PAx AQ,PAy QkAףp,PAz = ףnA(,PA{ p= A((-PA| ףp=HA ףY-PA} 3333A(\?\-PA~ \AG*-PA YAQ~y-PA QA(\-PA (A= -PA ffffA .PA \cAQN(.PA z{A(lC.PA A(_.PA A~.PA \A(\.PA ףp=RAfff6.PA {G* AQn/PA \ A&/PA z7A(\'PA R9A333#-(PA 7A)\D(PA Q6AzY(PA )\1AG(PA \h2A(PA ףp=1AG)PA ̰3AHz)PA (\B0AfffV1)PA Hz]1AT)PA \.A(\)PA p= -A333S*PA  ףpE-A\*PA Qe,A= 3*PA Gz}*ARR*PA  ףp)A{c*PA ףp=)AQn{*PA 5*AQ|*PA Q'A( *PA (&AQ*PA Gz'AQ*PA p= 3&A)\+PA ffffC&Afff!+PA HzP%A)\b9+PA Q%AL;+PA R#AGj~+PA #Afff6+PA Hz&#A(L+PA !A(\o+PA QJ"AHz+PA  Az+PA Gz AR,PA (\A\,PA }A|,PA RA= ,PA QAz,PA QuA333&-PA ףp=Ak6-PA = ףAQK-PA GǍn-PA Gz@A뱘-PA ףp=A333ӽ-PA {GAHzT-PA zA)\-PA Q6Ah.PA = ף6AR .PA ףp=AףpMO.PA Gz+AzV.PA q= פAp=ڀ.PA (\A.PA 3333 ARu.PA (\AG*.PA = ףAHzt.PA ףp=LA)\r.PA Q{Ap=.PA ףp=UAz..PA (\ A{W/PA  ףpb9A{W'PA (\S<AHz(PA :A*(PA (\w9A= t(PA q= ׸8A(PA ףp=5AG(PA (\8A(ܧ(PA 8A)\r(PA p= 6A{(PA G2A)\2)PA \16AG )PA {GJ4A\7)PA 3Afffj)PA /A(L)PA )\C1A)PA q= /A)\)PA Hz 0AR)PA Hz,AHz48*PA  ףpB-Aq= WN*PA ?+Ak*PA  ףp)A)\"*PA Q *AGᚪ*PA \v)Ax*PA Q(Al*PA Q~'A( +PA (\b%AHzd+PA RW%A= w+PA Ri%A)\B+PA ~#Az+PA ffffH"A+PA )\q#AR+PA GzH"A(, ,PA Q+"AG,PA \AHzu,PA Gz A(x,PA q= A ף,PA Q(Aףp,PA AQ,PA ̃AL,PA ףp=A{,PA \A,PA QRA|9-PA QQARY-PA QAp=|-PA GzA+-PA ףp=VA{-PA YA(\/-PA (\eA.PA q= ׼Aq= W!.PA Hz(AL1.PA (\AHz6.PA Gz5A{W.PA Q-Aap.PA AQ.PA = ףA̜/PA \IAR5/PA  ףpAQ/PA QA@C/PA  ףp:A(\'PA \ :Aףp'PA zk9A{g(PA Q<A8#(PA 33339Aףp^(PA (\b7AQm(PA G6AQx(PA (\6Ap=ډ(PA G;6A)\(PA +6Aףp](PA 8A۾(PA = ף5A333(PA Q=4A(PA 8AG!(PA  ףp4AQ)PA \s7AHz(PA \5A )PA  ףp2AףpS)PA {G5A(\O)PA Q1AQo)PA ffff2A`m)PA (\0Afff)PA QB2A̬~)PA QU0AG)PA  ףp1A= ׳)PA p= .A)\2 *PA RR-AQ8*PA ffff,AL*PA )\Ž,A)\_*PA Q-A333k*PA Gz,A= ף*PA GK-A{gz*PA q= ׆+AR*PA = ף+AGJ*PA (O+A\%*PA! )A)\R+PA" {G(AHz +PA# (\i(A$+PA$ {G4(AE+PA% Gz&AAHz4(PAF R9AF(PAG ;A{E(PAH A;A(\W(PAI ףp=I;A333(PAJ Q7AR(PAK R3A(Y)PAL Q6A= דh)PAM G4AQn)PAN ףp=2A(L)PAO ffffm1Aףp)PAP G3Aףp)PAQ Q/A{*PAR Q0A)\4*PAS ףp=<-A(L*PAT ;,Aq= W*PAU Hz*AHz*PAV q= +AHz*PAW Hz|*A)\*PAX )\„*A+PAY  ףp)A= S.+PAZ Gz)A\>+PA[ GzX(A{S+PA\ Q4(AP~+PA] \&A(+PA^ Q&A+PA_ ̰&A333+PA` )\(%A(+PAa G#AG,,PAb R"AHz$`,PAc H"AQy,PAd z A9,PAe p= x A333,PAf Aףp,PAg OA(&-PAh QAQ>8-PAi ( A= o-PAj  ףp+A{-PAk A= 3-PAl HzyA333-PAm Hz@A{' .PAn 3333yA333c.PAo p= Ap=J.PAp QAףp͟.PAq A.PAr zA.PAs q= hAףp-.PAt 3333A@.PAu rAp=*/PAv {GAa/PAw ffff=AR%X(PAx = ף;AQ^v(PAy <A`(PAz z<AQ(PA{ ̪8AG(PA| Gz:Ap=(PA} \9Al )PA~ \8AGz%)PA  ףp(5A+<)PA G7AfffQ)PA = ף?7A])PA z3Ap=)PA {G5AQ)PA = ף2A(\o)PA 4A\u)PA 1A\)PA ףp=J0A ף0 *PA /A,*PA ףp=/Ǎ=*PA  ףp0AzY*PA  ףp-Aq= '*PA (a-A333*PA {G*AKe+PA &Ap=+PA (\&A\¥+PA h%A,PA (\ #A{x,PA ffff&"ARe,PA (\ AHz,PA (\AAyo-PA ffffAR5-PA Q=AR%'PA \S?A)\'PA q<A= E(PA Hzd>Ǎ=(PA (\<A)\Y(PA ףp=<A{(PA  ףp9AQ(PA Q:A{(PA Q+;A(\)PA (\9A=)PA z 9A= X)PA \85AHzz)PA ףp=7A ף@)PA = ףV6A{Ǹ)PA = ף5Aq= )PA (\3AR5)PA {G@5Aq= W)PA G1Ap=J *PA )\z3A)\R#*PA q= /Aaj*PA Q=0A\*PA R,AQ%+PA Hz,A(M+PA Q+Ap=a+PA q= n(AQ+PA  ףp&A= ף ,PA Q&AQ#,PA (\e%AF,PA #Ap= ,PA #AHzt,PA \I Ap=@-PA (\ARr-PA 3333|Aq-PA Afffw-PA AG-PA GAR-PA (\AQȽ-PA GzA= S-PA ARť-PA  ףpiA{g-PA Q A-PA (AףpM-PA ffffmA̜-PA GqAAQ~'PA p= AA{g'PA (\?AHzd(PA G?@A= (PA (\BAq= (PA ̘=A{((PA ?Aq)(PA 3333W@AR,(PA (\AA(PA Q?A\D(PA @A(\B(PA = ף?AG[(PA z@AK(PA = ף==AGx(PA ?A)\f(PA Gz?AR_(PA HzZ>Aףp (PA (\>AQ(PA QB;AQ(PA (\<A)\b(PA ;>AG᚞(PA 3333>Afff(PA Q >A둮(PA G:A((PA ffffE<A<(PA QW=AHz(PA G69AQ(PA G<A{(PA Q<A\µ(PA ;Aq= 7 )PA p= 8Ap=)PA G;Aq= )PA 3333n;Az)PA G7A<)PA (\ ;A 6)PA QW;AHzt,)PA (\R:A{Q)PA 9Ap)PA ףp=9Ap=z`)PA R8AQ8|)PA 8Az.)PA  ףpL8Ǎ)PA  ףp/7Ap=j)PA )\28A!)PA B4AQ)PA \6Ap=)PA z6A()PA G3AQN)PA (5A0)PA ףp=w2A.*PA 33331A)\N*PA q= ׊1A(|*PA z0A= ׃*PA  ףp.Aףp*PA p= .Aףp=+PA (\+A\e+PA )\a+A {+PA GQ+A)\b+PA Q *AQ+PA {G)AHz+PA (u(A+PA 3333(A̼+PA Ri(A{+PA {G(Ap=+PA (\(A(\,PA &A(|@,PA (\L'A)\r9,PA {G&Ap=J,PA )\''A{GH,PA GL%Aףp}r,PA \u&Ab,PA ףp=j%AR5,PA (\l%A(̐,PA (\$A!,PA q= o%AG,PA Q#Aףp,PA ̉$A(\,PA G#A ,PA  ףp$AL,PA  ףp"AQn,PA G #Aq= ,PA Q!Aq= ' -PA  ףpr"A(\ -PA \{!Aףp -PA Gz]"A9-PA \=!A)\?-PA R AfffQ-PA 3333 Ap= O-PA  ףpA ףi-PA J2AG)PA ffff1Az*PA 3333I3A(\ *PA )\¤3Aףp*PA ףp=1AGJ*PA q= .AR*PA Q4.A= *PA! G.AG*PA" R-A\…*PA# Q-AQ(+PA$ G)-Aףp+PA% ףp=e+A ף.+PA& p= )A= ׳~+PA' Gz *A(<+PA( ףp=e(A+PA) (\)(Ax+PA* Rg%AG',PA+ f%A{P,PA, -"AGQ,PA- 3333"A{,PA. { Aq= W -PA/ (\X A= -PA0 )A?-PA1 A)\"Z-PA2 RAA ףi.PA3 ffff>Aq= .PA4 zA.PA5 (\JAG*r.PA6 Gz5Ap=Z.PA7 = ף!A@.PA8  AfffV.PA9 3333NAףp.PA: {GmAQ.PA; QA\/PA< sAfff.PA= AQ.PA> GAfff /PA? QPAףp/PA@ zA)\/PAA (\YA ף@2/PAB ffffAףp8/PAC GAGJS/PAD GpA)\r/PAE A ףp/PAF A/PAG (A ף/PAH ̍ARŷ/PAI A /PAJ QsA9/PAK {GA333S0PAL p= A-0PAM (\}A333.0PAN \A ף/0PAO Q A=0PAP QAG1H0PAQ A@H0PAR HzVA ף0a0PAS (\A@0PAT (\'AG0PAU Aףp0PAV = ףA{g0PAW {GA333#0PAX zA ף0PAY ̧Ǎ0PAZ GzAGq0PA[ QA(\1PA\ XA{g,1PA]  ףpA|N1PA^ (\H Ar1PA_ ffffG AGat1PA` G A(L1PAa Q A)\1PAb J A\E1PAc Hz^ Aپ1PAd = ף A)\1PAe (\d Ap=j1PAf )\ AHzd1PAg 3333j AQX2PAh Gz_ A(,2PAi \h A02PAj {G AQ;2PAk ze A<2PAl p= A)\2<2PAm = ף A{e2PAn Q A\u2PAo R Az2PAp ףp=A2PAq = ף AHz2PAr HzAQέ2PAs A2PAt AK2PAu QAQ3PAv p= A ף3PAw q= Ap=3PAx q= A`33PAy (AzM3PAz (AGb3PA{ (\A{w3PA| (A뱘3PA} ̧Az3PA~ ~Aףp]3PA \A\E3PA q= A)\2=/PA ̗Ap=z6/PA QAfffd/PA 3333A= c{/PA AQ8/PA ffff&AQ/PA \Ap=/PA Hz*A= #0PA {GpA{0PA (\Ap=*H0PA q= ׅAR%z0PA ףp=A333Î0PA QUA(\0PA Q A333s0PA C Afff0PA q= @ A)\0PA Hz AQ1PA Q A{M1PA R3 A{V1PA \ Aq1PA q= e A)\j1PA Y A;1PA 3333 A{1PA (i A3331PA  A|2PA ̈AG᪀2PA p= Aq= 2PA 3333Az2PA zAz2PA  ףpAq= 3PA q= ׏AG3PA zA(\N3PA ̣AQd3PA QAHz3PA Hz8A3PA (\ Ak3PA A3PA Q:A3PA ̋A3PA mA.PA QAQ/PA ffffAL/PA = ףAGf/PA (AA`/PA AQ/PA z_AL/PA QAGѱ/PA A/PA ffff'Afff/PA HzARe0PA 3333cA333s60PA q= *Afff00PA = ףAz0PA Q AHz$z0PA 3333 A 0PA zG Aףpm0PA  A{0PA ףp= A0PA 3333l A0PA  Aq= 0PA Q A0PA p= AG1PA Q AG*31PA G A{)1PA G A1PA (j AGQ1PA 3333 AzΟ1PA (\ AQx1PA {G AR1PA ReA3331PA p= AX2PA QAףp1PA (\A #2PA A92PA 3333sAGJ2PA GvAfffg2PA {GAףp݀2PA A)\š2PA (\AHz42PA ̡A ף 3PA HzA53PA )\7AHzg3PA 9A\|3PA Q4A)\3PA ffff*Az3PA ffffAQ>/PA = ף-AR)/PA ~A(\z/PA {GA@}/PA R&A)\B/PA ̹AG1/PA RAHzԹ/PA )\«A{7/PA p= A/PA HzA/PA ףp=nAp=j/PA q=  A(\?0PA ףp=zA(\0PA  Aq= 7J0PA Hz A ף`0PA  ףp AQ0PA ( A333s0PA k Az0PA (\l A\E0PA ffffl AR51PA ffff A ף ,1PA = ף Afff92PA ffffAD2PA RAGi2PA ffffA(\2PA (AfffF2PA (7AG3PA Q9Aq= G53PA QARK3PA ףp=A)\f3PA = ףAQ(3PA zAq= 3PA QAq= w3PA 3333AR3PA GzAp=K/PA QAQޒ/PA 3333? A ף`/PA ףp=J A/PA (\ A0PA Gzx Ap=*0PA Ri Ap=x0PA (\A AHzT0PA Gf AQ0PA = ף` Ap= 0PA p= Aףpݿ0PA  A\0PA q= A[1PA (\A(U1PA Q AHzc1PA GAR1PA q= ׆Afff1PA GzWARu1PA (\Aq= G1PA  A ף@1PA AQ1PA ףp=AQ1PA = ףA)\r2PA  ףpA U2PA QAQXl2PA A{2PA {GAQ2PA 9A)\22PA 3333:A{2PA \6A̼2PA (\8Aq= w3PA A(,3PA {GA)\63PA GAO3PA (\A)\c3PA ףp=Ap=*s3PA <AQNj3PA (AHzd5/PA 33339 AQM/PA ARe/PA (\A(\b/PA (\ A\5~/PA!  A,/PA" (\ A/PA# {G ARu/PA$ p= AQ/PA% Q A{/PA& {GB A\•/PA' = ף Afff/0PA( (\ A)\20PA) (& A(ܒ0PA* (\_ Ap=0PA+ p= Aa0PA,  AQN0PA- \AG>1PA. QA\5X1PA/ (\~Az.g1PA0 q= A1PA1 ARu1PA2 AHz1PA3 QA)\2PA4 \A(\-2PA5 Q'AQ8:2PA6 p= 9A(~2PA7 (\1AY2PA8 RAq= 2PA9 {GA2PA: RA)2PA; 3333XAG43PA< 3333 Af/PA= z Ap=~/PA> (\ Ap=*/PA? ףp=V A\/PA@ z> A\0PAA QK A\… 0PAB Gz A{70PAC QB AGM0PAD Gz AGy0PAE QA333Sy0PAF Aףp0PAG QA10PAH ףp=Ap=0PAI HzAG!1PAJ {GpAG#1PAK GA(@1PAL QA\e1PAM QAav1PAN A(L1PAO RAfffִ1PAP A)\21PAQ (\3AQ1PAR 9A)!2PAS ףp=9A!P2PAT R4ARua2PAU GAQ2PAV RAq= '2PAW {GAfff2PAX QQA2PAY TAQ2PAZ HzZA(\O3PA[ SAR3PA\ (ZAN3PA] = ףAG:G3PA^ ףp=AzS3PA_ v Afff&5/PA` Q AK/PAa ( A333b/PAb 5 A1/PAc QP AHzԪ/PAd 3333 Aq= g/PAe z A)\ 0PAf Hz A= S0PAg  Azn`0PAh GzNA3330PAi (\AQ0PAj QA= 0PAk ffffAQ0PAl QfAףp0PAm QAz1PAn A'1PAo q= שA\m1PAp ףp=A ף@}1PAq QA\E1PAr $A ף@1PAs 9A)1PAt (\6A{1PAu = ף2Aףp1PAv Ah32PAw ffffA333O2PAx (\AQ~k2PAy WAHz2PAz {GVA{2PA{ (\A{W3PA| G AQ2/PA}  A333#K/PA~ Q Aqf/PA z Ap=u/PA \ Aܧ/PA (\ AQx/PA ffffDAG/PA  A= /PA A ף/PA Q A /PA QAfff 0PA QvA ף0/0PA AG/0PA QCAQ8^0PA )\A`0PA R Az0PA \A)\"0PA q= A{0PA 3333A)0PA (\A0PA  ףpAG 1PA 3333AQX(1PA GbAfff&1PA p= RA)\+1PA QAq= -1PA = ףAQ.R1PA Gz5Av1PA 3333AG1PA ףp=Az1PA p= AHz1PA q= A= c2PA zA(\2PA GSAQ52PA p= XAI2PA GzXA333sm2PA VAQn2PA GzAѸ2PA  ףpA2PA = ףA)\"2PA (OA= ד2PA ffffTAq= G3PA ffffAzN13PA = ףAz3PA Azn63PA Gzw AQJ/PA Hzn A{/PA \UAG /PA  ףp AGQ/PA R;A= /PA QPA{'/PA `Ap=0PA `A[0PA (\A(\0PA = ףAHz0PA G A1PA QAQ1PA (:AF1PA G1AGa[1PA QAp=g1PA RA{'u1PA \A(,1PA RWA)\2PA q= XAL!2PA ףp=Aq= h2PA \Ap=*2PA q= A= ף2PA q= xAG2PA yA{2PA = ףA)\2PA QA= #3PA QzARE3PA Q A!e/PA Az/PA zAG/PA (A!/PA q= Aףp0PA (A= ף`0PA \Az0PA 3333A!z0PA \A(0PA ףp=A(<0PA 2A0PA (\KA)\B1PA (A ף`)1PA p= A N1PA 3333RAy1PA QYAQ1PA XAHzT1PA WAfff1PA ffffAG!2PA GA"2PA HzA)\82PA q= A333K2PA QoA)\T2PA = ףwAGq2PA q= oAA2PA ףp=ZA= ׳2PA R,Aq= 2PA Hz$A~/PA HzAQh/PA (\AQ~/PA (\3Ap= /PA p= AG/PA (#Az/PA QaA ף/PA (\$Az0PA  ףpAףp0PA (\A{0PA (\AG0PA 3333AkG0PA R<AQ0PA q= A0PA )\EA끓0PA (\AA0PA ffffA0PA QAQ0PA )\TA= S31PA = ףVAE1PA (\ZA= c[1PA  ףpOAс1PA nA|1PA HzA롐1PA 3333A1PA (A롷1PA (\XAz1PA  ףpAG1PA ףp=A\•1PA QA\1PA QAp=z1PA p= [Ap= 2PA ףp=zA)\2PA  ףpAQH"2PA p= zA*2PA (1AG;2PA AR2PA )\?A{'g2PA GzAh2PA QA\%2PA GAq= 2PA  Aq= 2PA 6AQ2PA \AGڲ2PA 9AfffF2PA AQ^2PA (A ף/PA GzAףp/PA p= SA333/PA (\A\0PA = ף9A333^0PA QAQn0PA = ףTAp=0PA ףp=Aףp0PA (\eA(\0PA (XAR!1PA (\Aq= 7/PA p= AfffV/PA QAO/PA (AGg/PA ffffA ף/PA A/PA QAp=/PA A{/PA GDA\/PA q= A{H0PA ףp=AP0PA! Aq= gc0PA" (XAfff0PA# = ףA1PA$ A ף`$1PA% = ףA333-1PA& ףp=A\5U1PA' GzA)\2g1PA( ףp=NA)\_1PA) )\A= ףv1PA* {GA3335/PA+  ףprA(/PA, HzZAq/PA- ]AG*/PA. HzA{/PA/ )\6A= /PA0 QAz.0PA1 zMA(\M0PA2 zVA{ga0PA3 ףp=XAGZz0PA4 (WAp=*0PA5 GAz0PA6 QAG 0PA7 = ףpAQ$1PA8 p= yA= ף91PA9 HzxA(H1PA: Gz)A(\ /PA; 9Ap=/PA< 8A\•8/PA= Q9AHzO/PA> (\8A8h/PA? p= AGz/PA@ q= 4Aq= '/PAA q= RA 0PAB ffffRA ף/0PAC q= XAz><0PAD ףp=A{'b0PAE QAQNz0PAF q= Afffv0PAG QuA(\0PAH QuAR%0PAI {GxA3330PAJ (\zA1PAK AP(1PAL GzA71PAM )\%AHz$B1PAN 3333Aq= GE1PAO 6AףpE1PAP A(\_c1PAQ QoA= S`1PAR 9Aq.PAS HzAGz.PAT ףp=AP/PAU ףp=A ף0h/PAV  ףpA\5/PAW q= GA)\/PAX A0PAY RAQ/0PAZ ףp=AR;0PA[ QAfffY0PA\ QvA{G{0PA] QxA0PA^ QA= 0PA_ A̼0PA` (\AHzD.PAa Ap=/PAb (\Affff/PAc A)5/PAd 3333WARN/PAe p= XAj/PAf zVA\E/PAg q= A{׹/PAh (\A/PAi ffffAq= /PAj ffffxAQ0PAk (\yAG0PAl AzG0PAm zvA333I0PAn QoAHzD`0PAo ףp=zAGa0PAp GzsAG*a0PAq 3333A{ׂ0PAr q= +A333ӑ0PAs \ Al0PAt zvA(\0PAu q= AfffF0PAv  ףpAQX0PAw )\AQ0PAx \ Aq= 0PAy (`AQx0PAz  ףpXAp=0PA{ RA ף.PA| zA{ǜ.PA} p= Aףp͟.PA~ 3333A3333.PA Aܸ.PA q= 3Aq= G.PA (VA(/PA (YA1/PA QMA{/PA q= Az6/PA RAQHP/PA zA(g/PA \A0/PA ffffA{/PA fA\/PA RxAGA/PA p= zA)\/PA (mAQx#0PA {GAfff0PA q= A.PA Q\A\.PA q= RAR.PA )\²A/PA A, /PA p= A{/PA Aףp]/PA  A333/PA \Az>5/PA ztAQ7/PA QA\eP/PA AQNg/PA GzA|/PA HzyAz~/PA HzAG/PA GzxAQX/PA \AY/PA RA/PA = ףA(/PA (Az^/PA (A333C/PA (\cA ף0/PA zA)\0PA wA= C0PA Q2Aq= G*PA Q*Aq= ';+PA (Aףp]+PA (\#A= #G,PA Q#AQG,PA ףp=I"A,PA Q A,PA z Afff-PA \A333#-PA (\AHz$Z-PA (\A{'-PA QA(,-PA Qw5Ap= *PA  ףp 5Ap=9*PA {Ga3A333#l*PA p= 1A{*PA ffffR0A{7*PA (\/A*PA (/A{+PA Q:.AGZ,+PA Q*/A(\+PA b+A +PA F*AQ+PA p= *A ף+PA RA*AG:+PA ffff3AQ(S*PA q= 4APc*PA y3AA*PA Gz3A\…*PA R1Ap=ʜ*PA HzG3AG᪜*PA R3A*PA 1ARE*PA G.AR5L+PA ffff-AGz\+PA ,A(L}+PA ףp==-AG~+PA 2A*PA Q1AR*PA ffff.A)\I+PA Hzi-AHz$+PA  ףpm-AGJ+PA z+AG኱+PA  ףp3A\…*PA Q1AHz*PA G1AHzt+PA \3,A(\ϕ+PA 33335A{'R*PA R5Al*PA 6Az΂*PA z=4Aɶ*PA \g3A8*PA {3AQ*PA z2Aףp+PA Q\2AX+PA (\1A(+PA 0AI+PA q= S0A(e+PA 33338-AR+PA ףp=7A(\j*PA RJ8AQ_*PA Q5Azn*PA Q6AR*PA p= 6AGz*PA 4Aףp]*PA = ף1A{f+PA Q}7AzO*PA = ף9AףpQ*PA Q$6Aq= *PA (\5A*PA p= 54A333*PA 33333A ף +PA GzG3A{1+PA (2A\M+PA HzM0A\~+PA R0AHzDz+PA ףp=A0AQH+PA (h0A{+PA l8Afffƙ*PA 33337Azn*PA Q75A)\*PA \g5A+PA p= 2A ףpn+PA Q8AQ^|*PA {Gx5A ף+PA {G4Az0+PA (\;5Afff3+PA (\?4A= CJ+PA Hz2A\d+PA Gz:AG9*PA (\J;Ak*PA W;A)j*PA  ףp8AQ*PA 6A)\*PA )\®6A+PA Q 4A ףc+PA q= D;A{R*PA (\<AR*PA :A(\*PA R9A *PA 9A(\*PA _9A[*PA 33338A*PA Hzl8AR5*PA {G6AHzD0+PA Q6AQF+PA G}4Afffq+PA 4;A(*PA (:A)\2*PA ףp=:A{*PA G8A *PA 8AףpM+PA \7AF+PA )\+8AfffD+PA (\?AGQF*PA (\/>Ak*PA Q<Az*PA \<A*PA (<Aףp*PA (<A*PA (\;A!+PA )\ž9A0+PA QB>A̬*PA! ?Ap=zw*PA" = ף5>A*PA# Q[>Ap=*PA$ Q:AG+PA% (";Afff-+PA& R*8A= z+PA' (\6@A= u*PA( ffff<A*PA) \=A ף*PA* (L<Afff+PA+ RA;A7+PA, Hz:A{wc+PA- GCA(9*PA. p= ?Afff*PA/ (\A>Aq= G*PA0 Gz<A +PA1 K;A(\z+PA2 \UAAQ^j*PA3 z@A(*PA4 Gz?A\Ŷ*PA5 z?A|*PA6 QS>A ף0*PA7 p= =A{+PA8 (<AG3+PA9 (<A3339+PA: (DAG5*PA; BAO*PA< ףp=CAGd*PA= ?A *PA> =A ף3+PA? )\|>AQ~+PA@ <Aq= V+PAA p= CAp= J*PAB ̀BA(\*PAC = ף|AAq= '*PAD ((AAHz4*PAE Hz?A= 3+PAF Q DA ףh*PAG Q~DA= Ä*PAH q= CAQ(*PAI QBAG᪶*PAJ \YAAfff*PAK ( GA8*PAL (\DAHzTj*PAM GCAzN*PAN )\‰AA*PAO ffff?AHz$+PAP ףp=~DA*PAQ  ףpDA= #*PAR p= CA(\*PAS p= CAz~*PAT {GBAG+PAU RGAףpQ*PAV 3333EAL*PAW EA333*PAX DAx*PAY /AAffff+PAZ 3333BAG:+PA[ (\AA+PA\ (BA)\+PA] *HA(\oi*PA^ )\8FAGằ*PA_ REA(\*PA` {GhDA+PAa QDA= ד*PAb (\DAQH+PAc (\GA(*PAd QVGA\%*PAe Hz*GA(*PAf = ףcIAfff&*PAg GA ף*PAh EA(*PAi G\IA)\*PAj (\GAGq*PAk ?GAGQ*PAl = ףGA*PAm (\IA *PAn ̎GAQ*PAo p= IAp=*PAp (\dIAp=*PAq h=AHzT9+PAr = ףGA`4+PAs Q=AY^+PAt 3333MEAףp}N+PAu q= `>Aq= r+PAv Gz?AQ(+PAw BAHztz+PAx G%CAHzw+PAy 3333i>Aףp=+PAz Q?AR+PA{ 3333-KA\•*PA| \KKA333*PA} JAףp}*PA~  ףpJAp=*PA ףp=IA\•M+PA wHA333c~+PA RZIA}+PA (\7GA)\+PA GA= +PA )\GA)\+PA REA)+PA (;FARE+PA (\DA(\O,PA RKAQ+PA QJA(!+PA (\KARe6+PA ףp=JAz*PA Gz:IA(\*PA HA= #+PA Gz\IA+PA )\:HAףp-+PA = ףGA,M+PA Q>EAHz$+PA (\DAR5+PA \JCAQ ,PA GCAQ,PA QCA)\,PA = ףDAq= g,PA zeIA<#+PA HzKFAHzZ+PA \@FA ףi+PA DA۰+PA HzqCA= +PA Hz{CA= +PA {GFBA{W,PA ףp=DAf+PA (DAףpm+PA p= *CA(\+PA FAG+PA p= 9FA!+PA FAG+PA (\DA(\oL+PA DA9F+PA QEFAףp=4+PA {G[DA ף@W+PA CA۰+PA zAA(\+PA Q]BAq= +PA Q7AA+PA AAzn+PA %AAfff6+PA AA= +PA QDCA[+PA q= AAz+PA Hz4AARU+PA (\AA= C+PA GW?A+PA (@Aףṕ+PA (\=A+PA Q=5A)\"f+PA GA6A |+PA z6A{+PA Q9A{+PA (\6A+PA ףp=;A+PA Gz<A= ף+PA )\I=Aףp+PA = ף=AQ8+PA \m>AG+PA (Y>Az+PA ffffs>A)\b+PA R6Af+PA 9A)\†+PA z38A\•e+PA G?Ap=:+PA )\q;Aq= +PA R;Aq= g+PA G>A +PA (@A,PA = ףrIA6+PA GGA̜+PA p= IHA\U+PA ;FA= +PA \:FAףp-+PA QIAfffR*PA HzZGA(k*PA = ףlA333c'PA GzmAz'PA p= `jA= (PA QhAQ8,(PA \fA= V(PA p= fAzu(PA q= ׼cAp=(PA 3333aAfff(PA z`A(PA )\)_Az(PA GzY]Aq= (PA BWAQ>T)PA RXAzX)PA z~UAQ()PA TARE)PA GRA(\?)PA = ף)QAz)PA ROA333)PA QSLAp=*PA HzpLAp=%*PA ffffbIA)\"!*PA GzGAQ9*PA FAyP*PA {GlA{'PA \mA333'PA ףp=kAq= w'PA (kAHz'PA jAfff(PA = ףfAףp -(PA iA1)(PA \QeAfffE(PA z gAHz4:(PA 3333 hA3(PA cAm(PA Gz bAףp (PA `Az(PA R^AQ~(PA Q]A((PA ffff[AG(PA Q[A333)PA (\YA= %)PA WAףp <)PA ףp=XA:)PA QUAGjQ)PA 3333UA g)PA q= ׬RA\%)PA \SAHz)PA = ףRA\…)PA  )\ŒOARռ)PA  G%QA)PA  OA(\)PA  GzCLAp=)PA  p= NA()PA  3333tLA*PA  (\JA333)PA  GJA(\*PA zGAq= *PA )\[IǍ,*PA kA'PA )jAfff'PA RmhAQ^(PA  cAq= E(PA  p= cAR^(PA  QdA333Y(PA  Q2bA333x(PA  33334`AQ(PA  Q]A(\?(PA  GzzZAHz(PA  ffffXAq= 7 )PA  (YA)\ )PA  HzTXA{W$)PA  = ףUAG<)PA  GzTA)\T)PA  )\´RAz^p)PA   ףp TAqp)PA  QzOAܞ)PA  RQAR)PA   ףp[LAףp)PA  {GNAG)PA \GA= ד*PA ! FAfff*PA " GDAq= 7*PA # GDAp=*PA $ iA'PA % q= זhA(\o'PA & ffffjAHz'PA ' zfA= 'PA ( gA{'PA ) GcA'(PA *  ףpqeA ף*(PA + z`A ף](PA ,  bA{^(PA - "_AR%w(PA . ףp=7`A(u(PA / Q2_AG (PA 0 \A= ׳(PA 1 (\]AGZ(PA 2 R._A ף(PA 3 ףp=ZAz(PA 4 [Aq= (PA 5 QdWA(\o )PA 6 ףp=4WAQ)PA 7 (@TAq= '6)PA 8 (\QAfffq)PA 9 zPA)PA : QsLA(\)PA ; (MAh)PA < HzJAp=)PA = GDIAG)PA > QlFA)\*PA ? cA ף(PA @  ףpeAG!(PA A  ףpLfA\e (PA B )\’`Aq= C(PA C GBbAzC(PA D \_AHz\(PA E = ף]Aw(PA F = ף]AQ(PA G = ף[Aףpݵ(PA H (XA(PA I q= WAq= (PA J xXA(PA K QUAz )PA L SA333')PA M QFUAG#)PA N RA(\:)PA O  ףpRA= R)PA P HzMAQ)PA Q GzOA(\)PA R {GSLA{g)PA S q= MA{)PA T QIAG)PA U QHA )PA V QJA(̼)PA W HzHAG)PA X 3333 FAQ)PA Y (\:FAz^)PA Z = ףDA{*PA [ ףp=xDA333*PA \ QDA(\*PA ] AA{:*PA ^ \AAq= R*PA _ Q?A_*PA ` (fAp'PA a ohAףp'PA b z)PA j QzOAGK)PA k PAV)PA l NAq= o)PA m QOAp=c)PA n JǍ)PA o GSIA)PA p  ףpFA(\)PA q 3333GA)PA r QDA\%*PA s (\>AA)\*PA t QBAp=*PA u ffffdA'PA v HzbA333'PA w {GBfA@'PA x QbA)\R'PA y  ףpldAR'PA z z`AGa'PA { Q5_Ap=(PA | Qy^AG*@(PA } (\[A(\P(PA ~ ףp=EZA(\o(PA  [Akb(PA q= qXAp=ʏ(PA YA\(PA Q%WA\…(PA \CXA (PA GUAz(PA  ףpVA)\B(PA q= ITA333(PA {G%UAQ(PA RVA(PA GzSAG(PA RUA(PA QgRA)PA 3333QA#)PA )\mOA>)PA 3333dLAV)PA Q NAHzY)PA NLA3333[)PA z=LAz)PA q= gIA(h*PA QGAףp *PA )\MoAz'PA  ףpnAp=Z'PA fffflAq= 'PA RnA{W'PA Gz%iAףp9(PA QYhA ףV(PA z^eAQXw(PA  ףpgAh(PA GzcA(PA \4bAz(PA Rd`A\µ(PA \5_A333C(PA ףp=]ARE(PA [A333&)PA YAףp>)PA 3333)WAl)PA QWA(\o)PA p= MA*PA RMA{*PA q= ׸nA`'PA q= )mA(PA \mAffff(PA (\nA(PA q= akAQ,(PA (leA(PA QeA((PA Hz^eAq= ס(PA = ףeA(PA GcAG!(PA QPbAH(PA ffffbAp=(PA Gz^AR5 )PA Gz"`A333(PA G\A333;)PA q= $\AGA;)PA (\ZAq= Y)PA 4[AJ)PA RfWA)PA QUAG:)PA HTA(\ϲ)PA HzRA@)PA ffffQA)PA ףp=OA )PA zWPAףp*PA q= ׷NA ף*PA p= MA3*PA HzxLA(R*PA ףp=GAGj*PA q= ךmAG!*(PA kAG@(PA \iA)\^(PA R`Ap=Z(PA Hz]A)\)PA \_A\)PA \EXAfff)PA !WAG)PA ̽UA{7)PA GSAG)PA qA'PA (\rAG:'PA (qAfff'PA (rA'PA QzpAl(PA q= =mA&(PA p= DmA0C(PA {GkAzR(PA HzkARV(PA 3333WeA(PA RdAG (PA (\bAG (PA ffffbAHz$(PA ףp=aA (PA {G`Ap=)PA \"_A(\o,)PA Gz+\AGzW)PA QZARo)PA ףp=ZA333So)PA (\YAQ)PA zZAGJu)PA q= ׶XAp=ʗ)PA )\ªWAy)PA QTA)PA (\RA)PA (\ TA333)PA RRAףp)PA 3333RA= C)PA (\PA( *PA 3333MAHzTC*PA QOA̬:*PA = ףJAHzi*PA zMA[S*PA ziA333t(PA  ףp?kAQ.d(PA QhhA끐(PA ףp=hA\u(PA (\gARe(PA = ףfAQ(PA p= dAGA(PA QbA{(PA 3333;aA{)PA ]AHzTN)PA (b\Aףp]_)PA \YAؕ)PA QYWA{Dz)PA GVAףpͽ)PA GRAG*PA q= ׉OA= c3*PA zKAfff*PA ́LA*PA  (\sA333'PA  usAp=(PA  (\!oA -(PA  {GmAq= C(PA  HzOnAhP(PA  = ףmA{w`(PA  QhjAGA(PA  q= dfA,(PA \`Ay')PA (\aAHzd')PA q= ק_A1@)PA (]Aq= 7^)PA p= %\Ax)PA  p= ]AGr)PA  MYA)PA   ףpWA333)PA  GzUAY)PA  RUAq= )PA  ?SAq= *PA  QA\¥.*PA  q= !QAfff@*PA  3333opAG*(PA  HznA|D(PA  {pA333:(PA  nAףpF(PA  )\kAIv(PA  QkAy(PA  ffffiA)\(PA  Hz3jA(PA  ףp=gAz^(PA  ףp=hAG(PA \hAR(PA ! G\dA= (PA "  ףpbAG)PA # :_AG*Y)PA $ (\ZA ףP)PA % ZA(\)PA & GzXAfff)PA ' 3333XAq= )PA ( GUUA\*PA ) ףp=UVA{)PA * HzTUAA*PA + GzQA(:*PA , \RA ף`&*PA - GzQA+:*PA . (\OA ף W*PA / p= PAp=U*PA 0 (\uAY (PA 1 \_oA(\k(PA 2 MmA롁(PA 3 kAq= 7(PA 4 z4jAȸ(PA 5 (\hA(PA 6 fAQ(PA 7 RgAq= (PA 8 R{eA( )PA 9 ףp=YdA)PA : = ףzeA{w)PA ; \cAHzD*)PA < dAq= ))PA = (#bA ףP@)PA > )\aAa)PA ? = ףP\ARU)PA @ Gz2\Aq= )PA A GZAR)PA B G6YAG1)PA C 33330VAGz *PA D Hz RAq= 'T*PA E p= LA*PA F (\NA)\r*PA G _KAG᪳*PA H \LAI*PA I (\euAGQ'PA J HzJvA= (PA K sA[(PA L  ףpisAףp6(PA M qA)\](PA N \KmAz~(PA O (\kA(PA P = ף7jAHzd(PA Q ףp=3iAz.(PA R 0jA)\(PA S Q gAQ(PA T {G~eA+')PA U (\jbAףp@)PA V {GO_A333cr)PA W ]Afff)PA X R]Aq= )PA Y zS\AfffF)PA Z \ZA ףp)PA [ {WA{*PA \ QYA{G)PA ] ffffUAP$*PA ^ ( VAG**PA _ ףp=*SAP*PA ` QRA333C\*PA a QuOAGa*PA b QARUp*PA c q= ײQAףpMl*PA d )\ LA= *PA e p= XwA(PA f uA(\!(PA g Q+vA333*(PA h QuA ף3(PA i zYtARP(PA j QoAp(PA k 3333[jAzn(PA l Gz$bA ף)PA m Qf`A)PA n :aAq= )PA o Q)`A )PA p ]A ף@)PA q Q!\A1)PA r GzWAHz*PA s {GkWAL$*PA t (\(PA (\zA)\".(PA (uA ףW(PA wA(LX(PA 3333exA)\RK(PA uAq= ws(PA {G;vA= m(PA zvA(\e(PA GPsAffff~(PA sA333(PA \uAz(PA \pAQ~(PA {GrAp(PA sA8(PA )\‹oAp=(PA (EqA롼(PA ףp=6rAp=ʱ(PA Q]oAfff(PA \pAHz$(PA \anA333(PA \oA(PA = ףlAp )PA zVnA\u(PA {G)jA{G)PA QkA)\%)PA elA()PA = ף$iAp=-)PA \|jAy7)PA )\­hA= SV)PA z?eAq= k)PA = ףfAp)PA ztgAk)PA \cAQȄ)PA meAfff&)PA GfA ף`w)PA q= gA= sr)PA GzcA333)PA EeA̜)PA eAQn)PA p= bAz)PA 33338cAq= Ǫ)PA (\dAףpm)PA 3333aAq= )PA = ףgbA(\)PA = ף`A\%)PA (\`Aq= )PA ףp=]A)PA 3333[^A)\r*PA )\ _Aq= G)PA (\;]AHz*PA R]A)\*PA )\\A(\(*PA ףp=%\AA)*PA = ףYA1@*PA  ףpG[A:*PA QFYA= ׳\*PA \lWApl*PA R"TAR*PA TA{*PA {G\VAq= w*PA  ףp2TAp=J*PA q= VTAp=J*PA ףp=@QAfff*PA zSA<*PA ףp=3RA333*PA QuNAP*PA = ףOA(\*PA (\LA(+PA )\NAR+PA {GLAQ+PA  ףpNAG+PA JAR5T)PA IAq= q)PA (\JA ףh)PA = ףFA ף)PA )\XIAףp)PA q= ךEA )PA = ףHFAQH)PA ffffDA)\R)PA Gz`EAL)PA (CAףp)PA (\DAp=j)PA RDAHzT)PA rAAQ~)PA )\BA)PA Q=CA\)PA Hz?Aq= *PA UAAףp-*PA \BAz)PA HzK>AHz *PA Hz?A= c*PA 3333<A\¥8*PA = ףC>Afffv9*PA (\?AQ8.*PA  Gz?<A(\F*PA  (\cAGZ'PA  eA333'PA  eA('PA  bAp'PA  (\bA= ׳'PA  ffffG`A\…'PA  )\bA('PA R^Az'PA R`AX'PA QbAףpm'PA = ף]Az(PA zZ^AG (PA  G`A)\(PA  ףp=[A(,(PA  (\\\Aq= $(PA  QB_A((PA  3333qZAD(PA  Q\A L Z h v             , : H V d r             ( 6 D R ` n |            $ 2 @ N \ j x             . < J X f t            * 8 F T b p ~  & 4 B P ^ l z   " 0 > L Z h v    , : H V d r  ( 6 D R ` n |   $ 2 @ N \ j x             . < J X f t             * 8 F T b p ~            & 4 B P ^ l z            " 0 > L Z h v             , : H V d r             ( 6 D R ` n |            $ 2 @ N \ j x             . < J X f t             * 8 F T b p ~            & 4 B P ^ l z            " 0 > L Z h v             , : H V d r             ( 6 D R ` n |            $ 2 @ N \ j x             . < J X f t             * 8 F T b p ~            & 4 B P ^ l z            " 0 > L Z h v ! ! ! !, !: !H !V !d !r ! ! ! ! ! ! ! ! ! ! " " "( "6 "D "R "` "n "| " " " " " " " " " # # #$ #2 #@ #N #\ #j #x # # # # # # # # # $ $ $ $. $< $J $X $f $t $ $ $ $ $ $ $ $ $ % % % %* %8 %F %T %b %p %~ % % % % % % % % % & & && &4 &B &P &^ &l &z & & & & & & & & & ' ' '" '0 '> 'L 'Z 'h 'v ' ' ' ' ' ' ' ' ' ( ( ( (, (: (H (V (d (r ( ( ( ( ( ( ( ( ( ( ) ) )( )6 )D )R )` )n )| ) ) ) ) ) ) ) ) ) * * *$ *2 *@ *N *\ *j *x * * * * * * * * * + + + +. +< +J +X +f +t + + + + + + + + + , , , ,* ,8 ,F ,T ,b ,p ,~ , , , , , , , , , - - -& -4 -B -P -^ -l -z - - - - - - - - - . . ." .0 .> .L .Z .h .v . . . . . . . . . / / / /, /: /H /V /d /r / / / / / / / / / / 0 0 0( 06 0D 0R 0` 0n 0| 0 0 0 0 0 0 0 0 0 1 1 1$ 12 1@ 1N 1\ 1j 1x 1 1 1 1 1 1 1 1 1 2 2 2 2. 2< 2J 2X 2f 2t 2 2 2 2 2 2 2 2 2 3 3 3 3* 38 3F 3T 3b 3p 3~ 3 3 3 3 3 3 3 3 3 4 4 4& 44 4B 4P 4^ 4l 4z 4 4 4 4 4 4 4 4 4 5 5 5" 50 5> 5L 5Z 5h 5v 5 5 5 5 5 5 5 5 5 6 6 6 6, 6: 6H 6V 6d 6r 6 6 6 6 6 6 6 6 6 6 7 7 7( 76 7D 7R 7` 7n 7| 7 7 7 7 7 7 7 7 7 8 8 8$ 82 8@ 8N 8\ 8j 8x 8 8 8 8 8 8 8 8 8 9 9 9 9. 9< 9J 9X 9f 9t 9 9 9 9 9 9 9 9 9 : : : :* :8 :F :T :b :p :~ : : : : : : : : : ; ; ;& ;4 ;B ;P ;^ ;l ;z ; ; ; ; ; ; ; ; ; < < <" <0 <> > >( >6 >D >R >` >n >| > > > > > > > > > ? ? ?$ ?2 ?@ ?N ?\ ?j ?x ? ? ? ? ? ? ? ? ? @ @ @ @. @< @J @X @f @t @ @ @ @ @ @ @ @ @ A A A A* A8 AF AT Ab Ap A~ A A A A A A A A A B B B& B4 BB BP B^ Bl Bz B B B B B B B B B C C C" C0 C> CL CZ Ch Cv C C C C C C C C C D D D D, D: DH DV Dd Dr D D D D D D D D D D E E E( E6 ED ER E` En E| E E E E E E E E E F F F$ F2 F@ FN F\ Fj Fx F F F F F F F F F G G G G. G< GJ GX Gf Gt G G G G G G G G G H H H H* H8 HF HT Hb Hp H~ H H H H H H H H H I I I& I4 IB IP I^ Il Iz I I I I I I I I I J J J" J0 J> JL JZ Jh Jv J J J J J J J J J K K K K, K: KH KV Kd Kr K K K K K K K K K K L L L( L6 LD LR L` Ln L| L L L L L L L L L M M M$ M2 M@ MN M\ Mj Mx M M M M M M M M M N N N N. N< NJ NX Nf Nt N N N N N N N N N O O O O* O8 OF OT Ob Op O~ O O O O O O O O O P P P& P4 PB PP P^ Pl Pz P P P P P P P P P Q Q Q" Q0 Q> QL QZ Qh Qv Q Q Q Q Q Q Q Q Q R R R R, R: RH RV Rd Rr R R R R R R R R R R S S S( S6 SD SR S` Sn S| S S S S S S S S S T T T$ T2 T@ TN T\ Tj Tx T T T T T T T T T U U U U. U< UJ UX Uf Ut U U U U U U U U U V V V V* V8 VF VT Vb Vp V~ V V V V V V V V V W W W& W4 WB WP W^ Wl Wz W W W W W W W W W X X X" X0 X> XL XZ Xh Xv X X X X X X X X X Y Y Y Y, Y: YH YV Yd Yr Y Y Y Y Y Y Y Y Y Y Z Z Z( Z6 ZD ZR Z` Zn Z| Z Z Z Z Z Z Z Z Z [ [ [$ [2 [@ [N [\ [j [x [ [ [ [ [ [ [ [ [ \ \ \ \. \< \J \X \f \t \ \ \ \ \ \ \ \ \ ] ] ] ]* ]8 ]F ]T ]b ]p ]~ ] ] ] ] ] ] ] ] ] ^ ^ ^& ^4 ^B ^P ^^ ^l ^z ^ ^ ^ ^ ^ ^ ^ ^ ^ _ _ _" _0 _> _L _Z _h _v _ _ _ _ _ _ _ _ _ ` ` ` `, `: `H `V `d `r ` ` ` ` ` ` ` ` ` ` a a a( a6 aD aR a` an a| a a a a a a a a a b b b$ b2 b@ bN b\ bj bx b b b b b b b b b c c c c. c< cJ cX cf ct c c c c c c c c c d d d d* d8 dF dT db dp d~ d d d d d d d d d e e e& e4 eB eP e^ el ez e e e e e e e e e f f f" f0 f> fL fZ fh fv f f f f f f f f f g g g g, g: gH gV gd gr g g g g g g g g g g h h h( h6 hD hR h` hn h| h h h h h h h h h i i i$ i2 i@ iN i\ ij ix i i i i i i i i i j j j j. j< jJ jX jf jt j j j j j j j j j k k k k* k8 kF kT kb kp k~ k k k k k k k k k l l l& l4 lB lP l^ ll lz l l l l l l l l l m m m" m0 m> mL mZ mh mv m m m m m m m m m n n n n, n: nH nV nd nr n n n n n n n n n n o o o( o6 oD oR o` on o| o o o o o o o o o p p p$ p2 p@ pN p\ pj px p p p p p p p p p q q q q. q< qJ qX qf qt q q q q q q q q q r r r r* r8 rF rT rb rp r~ r r r r r r r r r s s s& s4 sB sP s^ sl sz s s s s s s s s s t t t" t0 t> tL tZ th tv t t t t t t t t t u u u u, u: uH uV ud ur u u u u u u u u u u v v v( v6 vD vR v` vn v| v v v v v v v v v w w w$ w2 w@ wN w\ wj wx w w w w w w w w w x x x x. x< xJ xX xf xt x x x x x x x x x y y y y* y8 yF yT yb yp y~ y y y y y y y y y z z z& z4 zB zP z^ zl zz z z z z z z z z z { { {" {0 {> {L {Z {h {v { { { { { { { { { | | | |, |: |H |V |d |r | | | | | | | | | | } } }( }6 }D }R }` }n }| } } } } } } } } } ~ ~ ~$ ~2 ~@ ~N ~\ ~j ~x ~ ~ ~ ~ ~ ~ ~ ~ ~    . < J X f t            * 8 F T b p ~  & 4 B P ^ l z   " 0 > L Z h v    , : H V d r  ( 6 D R ` n |   $ 2 @ N \ j x   . < J X f t   * 8 F T b p ~  & 4 B P ^ l z   " 0 > L Z h v    , : H V d r  ( 6 D R ` n |   $ 2 @ N \ j x   . < J X f t   * 8 F T b p ~  & 4 B P ^ l z   " 0 > L Z h v    , : H V d r  ( 6 D R ` n |   $ 2 @ N \ j x   . < J X f t   * 8 F T b p ~  & 4 B P ^ l z   " 0 > L Z h v    , : H V d r  ( 6 D R ` n |   $ 2 @ N \ j x   . < J X f t   * 8 F libgeo-shapelib-perl-0.22/example/xyz.sbn0000755000175000017500000010100413042422412020225 0ustar frankiefrankie' pA 'A AP'`Az3AP33PAZ [%'\4]x 5 y *6BJ^ iz     &' "/<CPU_dp{ %+ ,9=FGKQTVW`ajm"      !#$%& () + -.01 2378:;>?@AD EHIL MN O RSXY bcefghk lnoqrstu vw |}~                 !#$() * HԀC;< ܀zyLM@ 56 <=GH0IJ8JK9@ACD(   G  } d 4           $ }   e @ h    g  I J L K  0 ~   i f      j          4   N   3 2   O     1     M   T               ! ! ! ! #$ $% !" "# 0"# "# '( &' $% $% %& '( )* '( %& () 01 34 23 23 34  ,- !" /0 4)* o'( n-. +, !" =!" U-. ,- #$ >() m&' l)* *+ H"# #$ #"# #$ #$ %& %& +, Y*+ X+, p-. q)* @() ?)* W%& V/0 ./ /0       7L   4 R Q P   5  k        L  : ; <  9   ! 8 6   T S    D % &   a $ (       !P   b  u   y * )  ? w '  `  A @"  E - .#P                "$@ 2   / 0  1    F %<   +     v x z c , B C &, { | D       '@A @A {@A|@A_@A (AB )0AB BC |GH AB AB DE EF AB dCD CD EF HI * LMEF`KL+0[\STUV͔WXΔYZYZUV[\STWXTUST, OP̘GHOP-MNsNOuOPvEFEGH?JKqCD)OPyAB5AB/4 23#$ /0 %& -. )* R &"# 5$ ! ! ' ! ! !  ! i ! ! 7 ! N6 "# ./ )*߰;< ܰ?@ ߰$% ,- Ͱ9: w734 34 56 غ34 89 ڿ56 8P78 9: 9: 34 ]>? 45 ^12 C78 78 v56 u78 t34 s56 23 r12 [12 (<= ݵ<= ޷9: ۳12 *9 )* +, #$:H!" )* () -. Z/0 \#$ '( ʾ)* $)* %$% $% ߺ-. '-. B+, &+, A%& &' () ;D+, "#ܷ*+ $% $% /0 )$%"#'(޶() ˴() *+ *+ ̱-. &' /0 ./ <01 01 ==> x?@ z>D23 23 56 -34 ,78 _12 89 `>? 45 56 78 D78 /9: b9: c56 +<= 34 ?D?@ y12 23 34;< a78 ¤45 23 56 78 => F78 .=> E67 >? H45 ;< @D/0 *+ )* &' 9"# O$% %& 8-. ,-/0 "# k/0 )* /0 '(+,'(A<$% l!" j+, () #$ m./+, -. )* S*+ ;*+ :&' Q&' P#$ /0 B  LC    ~D4 H J g e    3    ED  5      K M f  6 h I   F    G H   % "   I  # ! $J=>P;<G12 r?@Q34 [56:K9:]L045 ;<f?@ G9: 12 78Ϟ;< =>i34?@m=>{9: M\=> ×>?g;< ?@^;<c=>d?@e23 !12 56 #56 "569:З34 7834 \12 Z56K9:L=>W12 >78U;<VN4%& "# ,- W$% '( )* o'( n+, V./ =-. <./ *+ U() TO(*+ )* '( '( -. q/0 Y/0 X-. +, p)* P01 Q=>3R<9:278;89<56-23 s?@I=>H12 56 ]78 ^34 t67A;<B?@C9:FS@;< :;!=>"56 34 34 45 9:6778?@#;<.12 ?@4:;'89 _T./ ./ ,- /0 ,- UVׁ݂ڄքф҃W ͈ X ˊŒŊ Y4 Ƈ dž ʇ̇χІ w E ć Z4*+:;;<78k ,-J'( PQ[@Ay@Az\45]@ ! ! ! ! ! ! ! ! ! ! !n !o !m !j !l !q^00101801010101U01:01V01901W0101_34;78`12122345^45]34\a89bD:;:;=> ;<:;:;:;:;=> ;<:;=> =>=>:;=>=>c<78{34z34y34Y34X34[34Z7867347867787867d*+-.eL-../*+*+-.-.-.././-.-.-.*+/0)*~*+|*+}*+-.f '({'(z'(yg8*+*+-.*+*+*+-.-.-.-.-.6-.7*+*+h<#$p#$r#$s'('('(x#$'('(#$t'('('(w#$v#$ui<01v0101w010101010101010101x010101j8989k(:;;<<=:;9::;:;:;=>9:l@34783434787834347878783434347878m89)n<:;9:;8:;I>?Q=>L=>M:;J:;(=>K=>_=>O=>P=>N=>^:;7o<3478#782378&78'78$78%67343434343467p-.s*+Oq8-.u*+1*+2-.t*+3*+P*+*+4-.5-.Q-.R-.S-.T*+r@#$#$#$#$ '( '( #$#$'( '('('('(0#$'( #$sH-.-.-./0*+-.*+*+*+q-.r*+o*+p+,./-.*+)**+t8"#I#$#$#$#$J#$/'(m&'.&'N#$-&'L'(K&'M&'nu(kdebchifgv<a`w$[\ZXY]_^xX ! ! ! ! !@ !D !, !B !E !+ ! ! ! ! !R ! !g ! ! ! !e !>y&'vz(0101?01 0101!01.0101001U01V{:;|H=>u>?t?@v?@x=>w=>s<=n:;m:;G:;H:;\:;k:;];<l=>r:;o=>q<=p}@34178F78E34434"34234378Y78Z7853478[34C78D78634B~H:;=>=>=>>?=>>?=><=:;:;9:;<:;:;:;:;j:;07812@78i7878g34W34e34f78X78h34A78#$()()0-.*+*+-.,--.*+,-*+*+-.*+<$%G&''(#$#$H$%"#F$%j#$i'(l#$k#$h#$&'&'() H*++,)* -.>,--.)*,-/0/*+*+)**+,-./+-.-.--.,@#$!"'(&'&'!"&'%&&''(%&&'!"'(#$"#001b01;0101T0101|0101}01a01=01c01899:D781278787856346778673434d34341212~34 67l34m45n12:45912<3423o)*&',-p&'()<*+*./S./`*+t-.=)*s*+r*++,@)*u-.:-.<-.;-.R*+q8&'#$%&#$&'B#$#$'(#$&'A'(#$#$%&H)*/0{/0)**+)*,-/0>-.?-.*+-.-.)*-.*+K-.-.<#$#$N#$'(&'&'#$#$&'&'L'(#$P&'M"##$O ~  a< TSAH *C )'(<WUVQ@cb@d f&=%?>$  L #!"O NRP LM4 F E G H J K I     D4YL V <`_ S Q|}<OKMN JHID ? =EDBAC@FG TURS6  @          [ = Z  <9;8:<>?ABC@0 W X     432547@|A}@]A^<@GAH@[A\@AAB@BAC@vAw@|A}@|A}@zA{@|A}@XAY@kAl@iAj@`Aa@@9A:/@8A9,@lAm@,A-3@"A#%@WAX@UAV@eAf@gAh@SATr@6A7@;A<u@_A`>@IAJ@JAK@?A@w@+A,@xAy@OAPp@sAth@rAsg@3A4B@CAj@kA`EaF#`RaS`EaF$`OaP`OaPpCqDpIqJzP{Q ~QRRS}Q~RxEyFxGyH0zI{JEF*}I~J+}G~H$}I~J%zO{P}O~P1{A|B|M}N,}E~FyAzB |C}DTqErFtDuEwAxBqGrHqIrJwKxLqMrNvKwLtKuLwOxP&wMxNtMuNtOuPsOtPtOuPtIuJqCrDrAsBwCxD tGuHwCxD aQbRaQbR hOiPhKiLhCiDHiMjNmInJlKmLoEpFnFoGiEjFoKpLoNpOnMoNlBmCkNlOkMlNkElFkGlHiGjHiGjHmAnBmAnBDdKeLgMhNgOhPbLcMbIcJdGeHdKeLbAcB cFdGcEdFdAeB!gOhPgOhPaBbC"gChDeEfFdGeHP`Qa+B`CauM`NaS`TaT`UaM`NaPfQg PfQgPcQdPeQf SbTcIpJqFpGq/JpKqFpGq.HtIuHqIr$FtGuEwFxCxDyCqDrCxDyGuHvGuHvDtEu0CvDw1DJnKoMjNkJoKpKnLoMjNkKdLeJeKfIbJcbJdKecMeNfMjNk OhPi MfNgOfPg IlJm-JiKj,JfKg8CcDdCjDk0GaHb-FeGf.CiDj/FhGieFgGhdDfEgCmDnfGnHoEdFeCeDfCoDpGjHk4PCQD4P_Q`PSQT'P[Q\PMQNPXQY`PJQKPBQC2PPQQPOQPPGQHiPIQJjP]Q^*\P]QZP[Q'WPXQTPUQ] ]S^T^Q_RZU[V]S^TZU[VZV[WZS[TZU[V@SXTYVSWT(WYXZWZX[SWTXVUWV)S_T`S]T^T^U_V[W\WWXXS[T\SSTT^WYXZSUTV_WYXZLYAZB^M_N]O^P[D\EWZE[F!^H_I]I^J%^K_L\A]B ]M^N^B_CV\C]DUZM[NYJZKZ^A_BT[J\KZO[P&[G\HXYIZJYHVOWP\UCVDSATBgTAUBhVLWM[SETFUFVGSNTO&QJRKWCXDWHXI#WFXG"TLUM%VKWL$RHSIRFSGUDVEQARB3MPNQHSITn|;}<}7~8}9~:|5}6z?{@ y7z867 8w=x>r9s:r7s8u>v?r;s<s=t>w8x9u7v8v9w:r?s@t;u<t=u>q3r4q5r6x%y&y#z${#|${"|#z${%@w)x*t-u.u*v+w)x*w)x*q%r&v&w'r's(q"r#q.r/t-u.s*t+r-s.u#v$v"w#s$t%L f0g1Qn0o1l0m1h7i8Lm9n:j?k@n7o8m;n<l?m@j=k>n;o<k4l5m3n4n2o3o?p@i3j4m3n4j1k2j6k7j7k8i:j;n4b3c4a9b:a5b6f=g>a?b@d?e@g4h5Rg3h4a:b;e5f6f4g5f9g:g;h<h'i(Lj'k(Ni/j0l-m.Pn(o)k/l0i(j)j!k"[o-p.m#n$Kk*l+n$o%j"k#n/o0i"j#j$k%i*j+Oi-j.j$k%k&l'0f-g.d(e)b(c)&b%c&$f&g'f"g##g)h*f%g&]b-c.`f/g0a.b/ac"d#\ p q pqpq pqWpqpqXp q pq z{}~xstUxyxy{xyxy~8}~ |}z{}~}~~}~I{|}~z{}}~|yz8stvwJtutustwxqr strswx stuv wxwx0}~ Dyzz { Fz { } ~ G} ~ }~H|}yz yz{|,vwtu stv w s t st Twx  uvtuv w s t opjkcddeRhiP+Q, P4Q5bP?Q@P:Q;P$Q%P2Q3\0]1+R0S1` X[?^5_68V1W2T5U6S7T8S9T:S=T>0S>T?1Q:R;V;W</U9V:.T6U7S4T5cT2U3aT?U@fU=V>dX-Y.X&Y'\L]*^+(].^/*]+^,'^,_-_^&_'%[$\%Z$[%\(])Y.Z/](^)^!_"Z/[0["\#\,]-]-^.Z"[#[[&\'^#_$Y*Z+4Q&R'T$U%U"V#T'U(W(X)R(S)R#S$jS/T0 T+U, Q*R+W(X)]T,U-^T/U0_L0M1DM6N7M5N6N2O3J8K9J6K7I;J<J;K<L9M:fM9N:eI?J@hLa?#`$a00n1o~0z1{~0a1b)0c1d0q1r0r1s0u1v0j1k{0w1xG0~1010p1q3p4qE?p@q1D=x>yi:z;{69{:|79~:j:s;t:v;w:w;x5=z>{={>|:r;s=v>w4=~>:;=~>s2?~@ <3r4s3~47y8z3v4w|3{4|7u8v7s8t6x7y2t3uF6r7s{3v4w}347~883x4y6{7| @m=n>o=f>gBb?cA9c:d:j;kw=g>hv:h;iC:o;pz:n;oy0F1G0E1F0O1P0^1_0[1\0Y1Z0M1N0]1^0C1DKUs:Z;[t:Q;R\=_>`=9S:T:^;_w=Y>Z=]>^@3X4Y5U6V6X7Y3Q4R;5[6\3Z4[3^4_(6Q7R3R4S3\4]&6\7]'3U4V3V4W7W8X"7R8S7_8`vH=A>By?E@F9C:D2=C>Dz:L;M~:M;N:F;G{:K;L|?M@N9G:H6=L>M;JO@3E4F3M4N5D6E6A7B3I4J3J4K4I5J6C7D3A4BI3C4DL6G7H53N4O96I7J76M7N}3G4H7O8P&P'QV(X)YH*Q+RW/T0U*T+U/Q0R:)V*W-Q.R)^*_*T+U+S,T/R0S<-[.\*\+]-_.`,\-]-Y.Z?-V.W=*S+T*Z+[@8#_$`'S(TY#U$VZ'_(`A#R$SX#V$W\'X(Y`#]$^d'W(X]#Y$Z_'](^&U'V#Z$[%[&\4-O.P*L+MT*O+P/H0I-I.J+L,M/I0JR+G,HN-D.EM-C.DJ)K*LQ-H.IP*I+JO&O'PU&M'NSz{|}z{rstuvypqsst D|}}~yzMqrz {xy{|yzNvwqrIr su vKstJwxL~x yuv!8tuxuvtuxy}wx~ qrv~Oqruxywx{|uv|}"efj#Dghnolmf gcdhf gabfcdiijnklpefkhilnon oopophi$lmohimmnrmnqop% wx{ xyz z {| }~ } ~ z{~  tuw& ^_eZ [a]^b'0=1>C(<:2;39>5?6<7=8<3=4::6;7?;5<6=93:4<<6=7=?>@0=;><=;><.:>;?:<;=:9;:9::;),2;3<B2;3<D7;8<E6?7@6:7;2?3@G728386374;6778>5768A394:@*4<+=,/;,<-2:-;.1?(@)-?%@&(?&@'*=(>),>/?07=/>0=/>0:-;.4>/?05:/;06+/?0@Flibgeo-shapelib-perl-0.22/example/xyz.sbx0000755000175000017500000000467413042422412020256 0ustar frankiefrankie' p 'A AP'`Az3AP33PA2H .FN ^j$@   4R b T0BJ^ n4H LnLDPZnP@<F,v0 0 <^LD(*Hv< $ &BP HD:FRDDD*<jv 4D"B Rnv0\ 4B(nv~<@"BNf44@20frD<*Lz 8< < F R( ~@  <! <!J!V8!@!H""8"^("<"$"X#N#V(##H#@$H$f0$$$0$<%"%*H%v@%0%%%D&F &j&~&<&8'H'N<' ' '''H(6<(v@(L) )&4)^)f4))<)<**D*r@**@+<+R0+4+,V,b,z,, ,,0,T-6-B -RH-D-....2.>$.fD.8.4/"/6 /Z@/L/H0:0B0J<0@0@1@1V@11 111,2 82F2N2b@2 22L343F3NL303 3 4484V8404,45 5<5R@55$5 5$6 6:6F 6V<6866L7.47f7nD7877L8ND8 888@9 89F9N9n(99H9 ::*:24:j:v0::D:<;>@;<;;8<<">*>2H>~8>4>>??"?*D?r8??D?@ @: @J@R<@,@4@libgeo-shapelib-perl-0.22/README.md0000644000175000017500000000133013042422412016511 0ustar frankiefrankiePerl extension Geo::Shapelib =================== INSTALLATION To install this module type the following: perl Makefile.PL make make test make install DEPENDENCIES Geo::Shapelib.pm requires Shapefile C Library from http://shapelib.maptools.org/ Chances are that you can install it with sudo apt-get install libshp-dev or something similar. COPYRIGHT AND LICENSE Copyright (c) 2000- Ari Jolma. This library is free software; you can redistribute it and/or modify it under the terms of The Artistic License 2.0. ACKNOWLEDGEMENTS The example shapefile set is taken from the Shapelib examples. The following people have sent comments and/or bug fixes Massimiliano Galanti Leif Pedersen Daniel Babault woodbri libgeo-shapelib-perl-0.22/LICENSE0000644000175000017500000002132213042422412016242 0ustar frankiefrankie The Artistic License 2.0 Copyright (c) 2015 Ari Jolma Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble This license establishes the terms under which a given free software Package may be copied, modified, distributed, and/or redistributed. The intent is that the Copyright Holder maintains some artistic control over the development of that Package while still keeping the Package available as open source and free software. You are always permitted to make arrangements wholly outside of this license directly with the Copyright Holder of a given Package. If the terms of this license do not permit the full use that you propose to make of the Package, you should contact the Copyright Holder and seek a different licensing arrangement. Definitions "Copyright Holder" means the individual(s) or organization(s) named in the copyright notice for the entire Package. "Contributor" means any party that has contributed code or other material to the Package, in accordance with the Copyright Holder's procedures. "You" and "your" means any person who would like to copy, distribute, or modify the Package. "Package" means the collection of files distributed by the Copyright Holder, and derivatives of that collection and/or of those files. A given Package may consist of either the Standard Version, or a Modified Version. "Distribute" means providing a copy of the Package or making it accessible to anyone else, or in the case of a company or organization, to others outside of your company or organization. "Distributor Fee" means any fee that you charge for Distributing this Package or providing support for this Package to another party. It does not mean licensing fees. "Standard Version" refers to the Package if it has not been modified, or has been modified only in ways explicitly requested by the Copyright Holder. "Modified Version" means the Package, if it has been changed, and such changes were not explicitly requested by the Copyright Holder. "Original License" means this Artistic License as Distributed with the Standard Version of the Package, in its current version or as it may be modified by The Perl Foundation in the future. "Source" form means the source code, documentation source, and configuration files for the Package. "Compiled" form means the compiled bytecode, object code, binary, or any other form resulting from mechanical transformation or translation of the Source form. Permission for Use and Modification Without Distribution (1) You are permitted to use the Standard Version and create and use Modified Versions for any purpose without restriction, provided that you do not Distribute the Modified Version. Permissions for Redistribution of the Standard Version (2) You may Distribute verbatim copies of the Source form of the Standard Version of this Package in any medium without restriction, either gratis or for a Distributor Fee, provided that you duplicate all of the original copyright notices and associated disclaimers. At your discretion, such verbatim copies may or may not include a Compiled form of the Package. (3) You may apply any bug fixes, portability changes, and other modifications made available from the Copyright Holder. The resulting Package will still be considered the Standard Version, and as such will be subject to the Original License. Distribution of Modified Versions of the Package as Source (4) You may Distribute your Modified Version as Source (either gratis or for a Distributor Fee, and with or without a Compiled form of the Modified Version) provided that you clearly document how it differs from the Standard Version, including, but not limited to, documenting any non-standard features, executables, or modules, and provided that you do at least ONE of the following: (a) make the Modified Version available to the Copyright Holder of the Standard Version, under the Original License, so that the Copyright Holder may include your modifications in the Standard Version. (b) ensure that installation of your Modified Version does not prevent the user installing or running the Standard Version. In addition, the Modified Version must bear a name that is different from the name of the Standard Version. (c) allow anyone who receives a copy of the Modified Version to make the Source form of the Modified Version available to others under (i) the Original License or (ii) a license that permits the licensee to freely copy, modify and redistribute the Modified Version using the same licensing terms that apply to the copy that the licensee received, and requires that the Source form of the Modified Version, and of any works derived from it, be made freely available in that license fees are prohibited but Distributor Fees are allowed. Distribution of Compiled Forms of the Standard Version or Modified Versions without the Source (5) You may Distribute Compiled forms of the Standard Version without the Source, provided that you include complete instructions on how to get the Source of the Standard Version. Such instructions must be valid at the time of your distribution. If these instructions, at any time while you are carrying out such distribution, become invalid, you must provide new instructions on demand or cease further distribution. If you provide valid instructions or cease distribution within thirty days after you become aware that the instructions are invalid, then you do not forfeit any of your rights under this license. (6) You may Distribute a Modified Version in Compiled form without the Source, provided that you comply with Section 4 with respect to the Source of the Modified Version. Aggregating or Linking the Package (7) You may aggregate the Package (either the Standard Version or Modified Version) with other packages and Distribute the resulting aggregation provided that you do not charge a licensing fee for the Package. Distributor Fees are permitted, and licensing fees for other components in the aggregation are permitted. The terms of this license apply to the use and Distribution of the Standard or Modified Versions as included in the aggregation. (8) You are permitted to link Modified and Standard Versions with other works, to embed the Package in a larger work of your own, or to build stand-alone binary or bytecode versions of applications that include the Package, and Distribute the result without restriction, provided the result does not expose a direct interface to the Package. Items That are Not Considered Part of a Modified Version (9) Works (including, but not limited to, modules and scripts) that merely extend or make use of the Package, do not, by themselves, cause the Package to be a Modified Version. In addition, such works are not considered parts of the Package itself, and are not subject to the terms of this license. General Provisions (10) Any use, modification, and distribution of the Standard or Modified Versions is governed by this Artistic License. By using, modifying or distributing the Package, you accept this license. Do not use, modify, or distribute the Package, if you do not accept this license. (11) If your Modified Version has been derived from a Modified Version made by someone other than you, you are nevertheless required to ensure that your Modified Version complies with the requirements of this license. (12) This license does not grant you the right to use any trademark, service mark, tradename, or logo of the Copyright Holder. (13) This license includes the non-exclusive, worldwide, free-of-charge patent license to make, have made, use, offer to sell, sell, import and otherwise transfer the Package with respect to any patent claims licensable by the Copyright Holder that are necessarily infringed by the Package. If you institute patent litigation (including a cross-claim or counterclaim) against any party alleging that the Package constitutes direct or contributory patent infringement, then this Artistic License to you shall terminate on the date that such litigation is filed. (14) Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. libgeo-shapelib-perl-0.22/Shapelib.xs0000644000175000017500000006131613042422412017347 0ustar frankiefrankie#include "EXTERN.h" #include "perl.h" #include "XSUB.h" #include #undef min #define min(x, y) ((x)<(y) ? (x) : (y)) MODULE = Geo::Shapelib PACKAGE = Geo::Shapelib SHPHandle SHPOpen(pszShapeFile,pszAccess) char *pszShapeFile char *pszAccess SV * SHPGetInfo(hSHP) SHPHandle hSHP CODE: { int NShapes; int Shapetype; double MinBounds[4]; double MaxBounds[4]; int count; AV *av; HV *hv; SV *sv; SHPGetInfo(hSHP, &NShapes, &Shapetype, MinBounds, MaxBounds); if (!(hv = newHV())) goto BREAK; if (!(sv = newSViv(NShapes))) goto BREAK; hv_store(hv, "NShapes", 7, sv, 0); if (!(sv = newSViv(Shapetype))) goto BREAK; hv_store(hv, "Shapetype", 9, sv, 0); /* Make MinBounds */ if (!(av = newAV())) goto BREAK; for (count = 0; count < 4; count++) { if (!(sv = newSVnv(MinBounds[count]))) goto BREAK; av_push(av, sv); } if (!(sv = newRV_noinc((SV*) av))) goto BREAK; hv_store(hv, "MinBounds", 9, sv, 0); /* Make MaxBounds */ if (!(av = newAV())) goto BREAK; for (count = 0; count < 4; count++) { if (!(sv = newSVnv(MaxBounds[count]))) goto BREAK; av_push(av, sv); } if (!(sv = newRV_noinc((SV*) av))) goto BREAK; hv_store(hv, "MaxBounds", 9, sv, 0); if (!(sv = newRV_noinc((SV *) hv))) goto BREAK; goto DONE; BREAK: fprintf(stderr,"Out of memory!\n"); hv = NULL; DONE: RETVAL = sv; } OUTPUT: RETVAL SV * SHPReadObject(hSHP, which, combine_vertices) SHPHandle hSHP int which int combine_vertices CODE: { HV *hv = NULL; SV *sv = NULL; AV *av = NULL; int count; SHPObject *shape = SHPReadObject( hSHP, which ); if (!shape) goto DONE; hv = newHV(); if (!hv) goto BREAK; if (!(sv = newSViv(shape->nSHPType))) goto BREAK; hv_store(hv, "SHPType", 7, sv, 0); if (!(sv = newSViv(shape->nShapeId))) goto BREAK; hv_store(hv, "ShapeId", 7, sv, 0); if (!(sv = newSViv(shape->nParts))) goto BREAK; hv_store(hv, "NParts", 6, sv, 0); /* Make MinBounds */ if (!(av = newAV())) goto BREAK; if (!(sv = newSVnv(shape->dfXMin))) goto BREAK; av_push(av, sv); if (!(sv = newSVnv(shape->dfYMin))) goto BREAK; av_push(av, sv); if (!(sv = newSVnv(shape->dfZMin))) goto BREAK; av_push(av, sv); if (!(sv = newSVnv(shape->dfMMin))) goto BREAK; av_push(av, sv); if (!(sv = newRV_noinc((SV*) av))) goto BREAK; hv_store(hv, "MinBounds", 9, sv, 0); /* Make MaxBounds */ if (!(av = newAV())) goto BREAK; if (!(sv = newSVnv(shape->dfXMax))) goto BREAK; av_push(av, sv); if (!(sv = newSVnv(shape->dfYMax))) goto BREAK; av_push(av, sv); if (!(sv = newSVnv(shape->dfZMax))) goto BREAK; av_push(av, sv); if (!(sv = newSVnv(shape->dfMMax))) goto BREAK; av_push(av, sv); if (!(sv = newRV_noinc((SV*) av))) goto BREAK; hv_store(hv, "MaxBounds", 9, sv, 0); if (combine_vertices) { /* This is the default, make a separate array of parts and vertices */ /* Make array of parts */ if (!(av = newAV())) goto BREAK; for (count = 0; count < shape->nParts; count++) { AV *av2; if (!(av2 = newAV())) goto BREAK; if (!(sv = newSViv(shape->panPartStart[count]))) goto BREAK; av_push(av2, sv); if (!(sv = newSViv(shape->panPartType[count]))) goto BREAK; av_push(av2, sv); if (!(sv = newRV_noinc((SV*) av2))) goto BREAK; av_push(av, sv); } if (!(sv = newRV_noinc((SV*) av))) goto BREAK; hv_store(hv, "Parts", 5, sv, 0); /* Make array of vertices */ if (!(sv = newSViv(shape->nVertices))) goto BREAK; hv_store(hv, "NVertices", 9, sv, 0); if (!(av = newAV())) goto BREAK; for (count = 0; count < shape->nVertices; count++) { AV *av2; if (!(av2 = newAV())) goto BREAK; if (!(sv = newSVnv(shape->padfX[count]))) goto BREAK; av_push(av2, sv); if (!(sv = newSVnv(shape->padfY[count]))) goto BREAK; av_push(av2, sv); if (!(sv = newSVnv(shape->padfZ[count]))) goto BREAK; av_push(av2, sv); if (!(sv = newSVnv(shape->padfM[count]))) goto BREAK; av_push(av2, sv); if (!(sv = newRV_noinc((SV*) av2))) goto BREAK; av_push(av, sv); } if (!(sv = newRV_noinc((SV*) av))) goto BREAK; hv_store(hv, "Vertices", 8, sv, 0); } else { /* Make array of parts, each containing an array of vertices */ if (!(av = newAV())) goto BREAK; for (count = 0; count < shape->nParts; count++) { HV *hv2; AV *av2; int count2, num_vertices, first_vertex; if (!(hv2 = newHV())) goto BREAK; /* hv2 represents this part */ if (!(sv = newSViv(count))) goto BREAK; hv_store(hv2, "PartId", 6, sv, 0); if (!(sv = newSViv(shape->panPartType[count]))) goto BREAK; hv_store(hv2, "PartType", 8, sv, 0); /* Make array of vertices for this part */ first_vertex = shape->panPartStart[count]; if(count + 1 < shape->nParts) num_vertices = shape->panPartStart[count + 1] - first_vertex; else num_vertices = shape->nVertices - first_vertex; if (!(sv = newSViv(num_vertices))) goto BREAK; hv_store(hv2, "NVertices", 9, sv, 0); if (!(av2 = newAV())) goto BREAK; for (count2 = 0; count2 < num_vertices; count2++) { AV *av3; if (!(av3 = newAV())) goto BREAK; if (!(sv = newSVnv(shape->padfX[first_vertex + count2]))) goto BREAK; av_push(av3, sv); if (!(sv = newSVnv(shape->padfY[first_vertex + count2]))) goto BREAK; av_push(av3, sv); if (!(sv = newSVnv(shape->padfZ[first_vertex + count2]))) goto BREAK; av_push(av3, sv); if (!(sv = newSVnv(shape->padfM[first_vertex + count2]))) goto BREAK; av_push(av3, sv); if (!(sv = newRV_noinc((SV*) av3))) goto BREAK; av_push(av2, sv); } if (!(sv = newRV_noinc((SV*) av2))) goto BREAK; hv_store(hv2, "Vertices", 8, sv, 0); if (!(sv = newRV_noinc((SV*) hv2))) goto BREAK; av_push(av, sv); } if (!(sv = newRV_noinc((SV*) av))) goto BREAK; hv_store(hv, "Parts", 5, sv, 0); } SHPDestroyObject(shape); if (!(sv = newRV_noinc((SV*) hv))) goto BREAK; goto DONE; BREAK: fprintf(stderr,"Out of memory!\n"); sv = NULL; DONE: RETVAL = sv; } OUTPUT: RETVAL void SHPClose(hSHP) SHPHandle hSHP SHPHandle SHPCreate(pszShapeFile, nShapeType) char *pszShapeFile int nShapeType SHPObject * _SHPCreateObject(nSHPType, iShape, nParts, Parts, nVertices, Vertices) int nSHPType int iShape int nParts SV *Parts int nVertices SV *Vertices CODE: { int *panPartStart = NULL; int *panPartType = NULL; double *padfX = NULL; double *padfY = NULL; double *padfZ = NULL; double *padfM = NULL; AV *p = NULL; AV *v = NULL; int i; int n; if (nParts) p = (AV *)SvRV(Parts); v = (AV *)SvRV(Vertices); if (nParts) { Newx(panPartStart, nParts, int); Newx(panPartType, nParts, int); } Newx(padfX, nVertices, double); Newx(padfY, nVertices, double); Newx(padfZ, nVertices, double); Newx(padfM, nVertices, double); if (nParts && (SvTYPE(p) != SVt_PVAV)) { fprintf(stderr,"Parts is not a list\n"); goto BREAK; } if (v && (SvTYPE(v) != SVt_PVAV)) { fprintf(stderr,"Vertices is not a list\n"); goto BREAK; } n = nParts; if (p) n = min(n,av_len(p)+1); for (i = 0; i < n; i++) { SV **pa = av_fetch(p, i, 0); AV *pi; if (!pa) { fprintf(stderr,"NULL value in Parts array at index %i\n", i); goto BREAK; } pi = (AV *)SvRV(*pa); if (SvTYPE(pi) == SVt_PVAV) { SV **ps = av_fetch(pi, 0, 0); SV **pt = av_fetch(pi, 1, 0); panPartStart[i] = SvIV(*ps); panPartType[i] = SvIV(*pt); } else { fprintf(stderr,"Parts is not a list of lists\n"); goto BREAK; } } n = nVertices; if (v) n = min(n,av_len(v)+1); for (i = 0; i < n; i++) { SV **va = av_fetch(v, i, 0); AV *vi; if (!va) { fprintf(stderr,"NULL value in Vertices array at index %i\n", i); goto BREAK; } vi =(AV *)SvRV(*va); if (SvTYPE(vi) == SVt_PVAV) { SV **x = av_fetch(vi, 0, 0); SV **y = av_fetch(vi, 1, 0); SV **z = av_fetch(vi, 2, 0); SV **m = av_fetch(vi, 3, 0); padfX[i] = SvNV(*x); padfY[i] = SvNV(*y); if (z) padfZ[i] = SvNV(*z); else padfZ[i] = 0; if (m) padfM[i] = SvNV(*m); else padfM[i] = 0; } else { fprintf(stderr,"Vertices is not a list of lists\n"); goto BREAK; } } RETVAL = SHPCreateObject(nSHPType, iShape, nParts, panPartStart, panPartType, nVertices, padfX, padfY, padfZ, padfM); goto DONE; BREAK: RETVAL = NULL; DONE: if (panPartStart) Safefree(panPartStart); if (panPartType) Safefree(panPartType); if (padfX) Safefree(padfX); if (padfY) Safefree(padfY); if (padfZ) Safefree(padfZ); if (padfM) Safefree(padfM); } OUTPUT: RETVAL int SHPCreateSpatialIndex(filename, iMaxDepth, hSHP) char *filename int iMaxDepth SHPHandle hSHP INIT: SHPTree *psTree; CODE: #ifdef HAS_SEARCH_DISK_TREE psTree = SHPCreateTree( hSHP, 2, iMaxDepth, NULL, NULL ); SHPTreeTrimExtraNodes( psTree ); SHPWriteTree( psTree, filename ); SHPDestroyTree( psTree ); RETVAL = access( filename, F_OK ) != -1; #else RETVAL = 1; #endif OUTPUT: RETVAL SV * SHPSearchDiskTree(hSHP, filename, svBounds, MaxDepth) SHPHandle hSHP char *filename SV * svBounds int MaxDepth INIT: AV * results; double adfSearchMin[4], adfSearchMax[4]; int i, *panResult, nResultCount = 0, iResult; if ((!SvROK(svBounds)) || (SvTYPE(SvRV(svBounds)) != SVt_PVAV) || (( av_len((AV *)SvRV(svBounds))) != 3) ) { fprintf(stderr,"Bounds array reference incorrectly defined!\n"); XSRETURN_UNDEF; } adfSearchMin[0] = SvNV(*av_fetch((AV *)SvRV(svBounds), 0, 0)); adfSearchMin[1] = SvNV(*av_fetch((AV *)SvRV(svBounds), 1, 0)); adfSearchMax[0] = SvNV(*av_fetch((AV *)SvRV(svBounds), 2, 0)); adfSearchMax[1] = SvNV(*av_fetch((AV *)SvRV(svBounds), 3, 0)); adfSearchMin[2] = adfSearchMax[2] = 0.0; adfSearchMin[3] = adfSearchMax[3] = 0.0; if( adfSearchMin[0] > adfSearchMax[0] || adfSearchMin[1] > adfSearchMax[1] ) { fprintf(stderr,"Min greater than max in search criteria.\n" ); XSRETURN_UNDEF; } results = (AV *)sv_2mortal((SV *)newAV()); CODE: SHPTree *tree = NULL; #ifdef HAS_SEARCH_DISK_TREE FILE *qix = fopen(filename, "r"); if (!qix) { tree = SHPCreateTree( hSHP, 2, 0, NULL, NULL ); SHPTreeTrimExtraNodes( tree ); SHPWriteTree( tree, filename ); panResult = SHPTreeFindLikelyShapes( tree, adfSearchMin, adfSearchMax, &nResultCount ); } else { panResult = SHPSearchDiskTree( qix, adfSearchMin, adfSearchMax, &nResultCount ); } #else tree = SHPCreateTree( hSHP, 2, 0, NULL, NULL ); SHPTreeTrimExtraNodes( tree ); panResult = SHPTreeFindLikelyShapes( tree, adfSearchMin, adfSearchMax, &nResultCount ); #endif for( iResult = 0; iResult < nResultCount; iResult++ ) { SHPObject *psObject; psObject = SHPReadObject( hSHP, panResult[iResult] ); if( psObject == NULL ) continue; if( SHPCheckBoundsOverlap( adfSearchMin, adfSearchMax, &(psObject->dfXMin), &(psObject->dfXMax), 2 ) ) { av_push(results, newSViv(panResult[iResult])); } SHPDestroyObject( psObject ); } free( panResult ); if (tree) SHPDestroyTree( tree ); #ifdef HAS_SEARCH_DISK_TREE if (qix) fclose(qix); #endif RETVAL = newRV((SV *)results); OUTPUT: RETVAL int SHPWriteObject(hSHP, iShape, psObject) SHPHandle hSHP int iShape SHPObject *psObject void SHPDestroyObject(psObject) SHPObject *psObject DBFHandle DBFOpen(pszDBFFile,pszAccess) char *pszDBFFile char *pszAccess int DBFGetRecordCount(hDBF) DBFHandle hDBF SV * ReadDataModel(hDBF, bForceStrings) DBFHandle hDBF int bForceStrings CODE: { HV *hv = NULL; SV *sv = NULL; AV *av = NULL; int num_fields; int num_records; int record, field; if (!(hv = newHV())) goto BREAK; num_fields = DBFGetFieldCount(hDBF); num_records = DBFGetRecordCount(hDBF); for (field = 0; field < num_fields; field++) { char field_name[12], *field_type; int nWidth, nDecimals, iType; iType = DBFGetFieldInfo(hDBF, field, field_name, &nWidth, &nDecimals); /* Force Type to String */ if (1 == bForceStrings) iType = FTString; switch (iType) { case FTString: field_type = "String"; break; case FTInteger: field_type = "Integer"; break; case FTDouble: field_type = "Double"; break; default: field_type = "Invalid"; } /*if (!(sv = newSVpv(field_type, 0))) goto BREAK;*/ if (nDecimals) { if (!(sv = newSVpvf("%s:%i:%i",field_type,nWidth,nDecimals))) goto BREAK; } else { if (!(sv = newSVpvf("%s:%i",field_type,nWidth))) goto BREAK; } hv_store(hv, field_name, strlen(field_name), sv, 0); } goto DONE; BREAK: fprintf(stderr,"Out of memory!\n"); hv = NULL; DONE: RETVAL = newRV_noinc((SV *)hv); } OUTPUT: RETVAL SV * ReadData(hDBF, bForceStrings) DBFHandle hDBF int bForceStrings CODE: { AV *av = NULL; int num_fields; int num_records; int record, field; num_fields = DBFGetFieldCount(hDBF); num_records = DBFGetRecordCount(hDBF); if (!(av = newAV())) goto BREAK; for (record = 0; record < num_records; record++) { HV *hv = NULL; SV *sv = NULL; if (!(hv = newHV())) goto BREAK; for (field = 0; field < num_fields; field++) { char field_name[12]; int nWidth, nDecimals, iType; iType = DBFGetFieldInfo(hDBF, field, field_name, &nWidth, &nDecimals); /* Force Type to String */ if (1 == bForceStrings) iType = FTString; switch (iType) { case FTString: if (!(sv = newSVpv((char *)DBFReadStringAttribute(hDBF,record,field),0))) goto BREAK; break; case FTInteger: if (!(sv = newSViv(DBFReadIntegerAttribute(hDBF,record,field)))) goto BREAK; break; case FTDouble: if (!(sv = newSVnv(DBFReadDoubleAttribute(hDBF,record,field)))) goto BREAK; break; } hv_store(hv, field_name, strlen(field_name), sv, 0); } if (!(sv = newRV_noinc((SV*) hv))) goto BREAK; av_push(av, sv); } goto DONE; BREAK: fprintf(stderr,"Out of memory!\n"); av = NULL; DONE: RETVAL = newRV_noinc((SV *)av); } OUTPUT: RETVAL SV * ReadRecord(hDBF, bForceStrings, record) DBFHandle hDBF int bForceStrings int record CODE: { HV *hv = NULL; int num_fields; int num_records; int field; num_fields = DBFGetFieldCount(hDBF); num_records = DBFGetRecordCount(hDBF); if (!(hv = newHV())) goto BREAK; if (record >= 0 && record < num_records) { SV *sv = NULL; for (field = 0; field < num_fields; field++) { char field_name[12]; int nWidth, nDecimals, iType; iType = DBFGetFieldInfo(hDBF, field, field_name, &nWidth, &nDecimals); /* Force Type to String */ if (1 == bForceStrings) iType = FTString; switch (iType) { case FTString: if (!(sv = newSVpv((char *)DBFReadStringAttribute(hDBF,record,field),0))) goto BREAK; break; case FTInteger: if (!(sv = newSViv(DBFReadIntegerAttribute(hDBF,record,field)))) goto BREAK; break; case FTDouble: if (!(sv = newSVnv(DBFReadDoubleAttribute(hDBF,record,field)))) goto BREAK; break; } hv_store(hv, field_name, strlen(field_name), sv, 0); } } goto DONE; BREAK: fprintf(stderr,"Out of memory!\n"); hv = NULL; DONE: RETVAL = newRV_noinc((SV *)hv); } OUTPUT: RETVAL DBFHandle DBFCreate(pszDBFFile) char *pszDBFFile int _DBFAddField(hDBF, pszFieldName, type, nWidth, nDecimals) DBFHandle hDBF char *pszFieldName int type int nWidth int nDecimals CODE: { DBFFieldType eType; switch (type) { case 1: eType = FTString; break; case 2: eType = FTInteger; break; case 3: eType = FTDouble; break; } RETVAL = DBFAddField(hDBF, pszFieldName, eType, nWidth, nDecimals); } OUTPUT: RETVAL int DBFWriteIntegerAttribute(hDBF, iShape, iField, nFieldValue) DBFHandle hDBF int iShape int iField int nFieldValue int DBFWriteDoubleAttribute(hDBF, iShape, iField, dFieldValue) DBFHandle hDBF int iShape int iField double dFieldValue int DBFWriteStringAttribute(hDBF, iShape, iField, pszFieldValue) DBFHandle hDBF int iShape int iField char *pszFieldValue void DBFClose(hDBF) DBFHandle hDBF libgeo-shapelib-perl-0.22/t/0000755000175000017500000000000013042430442015502 5ustar frankiefrankielibgeo-shapelib-perl-0.22/t/00.t0000644000175000017500000001260313042430377016117 0ustar frankiefrankie# Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl test.pl' ######################### We start with some black magic to print on failure. # Change 1..1 below to 1..last_test_to_print . # (It may become useful if the test is moved to ./t subdirectory.) BEGIN { $| = 1; } END {print "not ok 1\n" unless $loaded;} use Geo::Shapelib qw /:all/; use Test::More tests => 12; $loaded = 1; ######################### End of black magic. # Insert your test code below (better if it prints "ok 13" # (correspondingly "not ok 13") depending on the success of chunk 13 # of the test code): my $shape = new Geo::Shapelib { Shapetype => POLYLINE, }; for (0..0) { push @{$shape->{Shapes}}, { Vertices=>[[0,0],[1,1]] }; } for (0..0) { $s = $shape->get_shape($_); @l = $shape->lengths($s); ok(abs($l[0] - sqrt(2)) < 0.00001,'lengths'); } my $test; my $shapefile = 'test_shape'; my $shape = new Geo::Shapelib { Name => $shapefile, Shapetype => POINT, FieldNames => ['Name','Code','Founded'], FieldTypes => ['String:50','String:10','Integer:8'] }; while () { chomp; ($station,$code,$founded,$x,$y) = split /\|/; push @{$shape->{Shapes}}, { Vertices=>[[$x,$y]] }; push @{$shape->{ShapeRecords}}, [$station,$code,$founded]; } ok($shape, 'new from data'); $rec = $shape->get_record_hashref(0); ok($rec->{Founded} == 19780202, "get_record_hashref, $rec->{Founded} == 19780202"); $shape->dump("$shapefile.dump"); ok(1, 'dump'); $shape->save(); ok(1, "save"); { my $shape2 = new Geo::Shapelib $shapefile, {Rtree=>1}; ok(ref($shape2->{Rtree}) eq 'Tree::R', "Rtree"); $test = $shape->{Shapes}->[2]->{Vertices}->[0]->[1] == $shape2->{Shapes}->[2]->{Vertices}->[0]->[1] and $shape->{Shapes}->[2]->{Vertices}->[0]->[1] == 6722622; ok($test, 'Rtree seems to work'); is_deeply ($shape2->query_within_rect( [3382750, 6690570, 3394250, 6698260]), [0, 8], "Quadtree spatial query" ); ok ($shape2->create_spatial_index, "Create Quadtree index"); } $example = "example/xyz"; { $shape = new Geo::Shapelib $example, {Load=>0}; my $rec = $shape->get_record_hashref(0); my $y = sprintf("%.2f", $rec->{Y}); ok($y == 4235332.51, "get_record_hashref (unloaded rec) $rec->{Y} ~ 4235332.51"); $shape->save($shapefile); #for ('.shp','.dbf') { # @stat1 = stat $example.$_; # @stat2 = stat $shapefile.$_; # ok($stat1[7] == $stat2[7], "cmp $_ files, expected $stat1[7] got $stat2[7]"); #} } $shape = new Geo::Shapelib $example, {Load=>0}; $shape2 = new Geo::Shapelib { Name => $shapefile, Like => $shape }; $shape2->create(); for (0..$shape->{NShapes}-1) { $s = $shape->get_shape($_); $r = $shape->get_record($_); $shape2->add($s,$r); } $shape2->close(); #for ('.shp','.dbf') { # @stat1 = stat $example.$_; # @stat2 = stat $shapefile.$_; # ok($stat1[7] == $stat2[7], "cmp $_ files, expected $stat1[7] got $stat2[7]"); #} $shape = new Geo::Shapelib "example/xyz", {UnhashFields => 0}; $shape->save($shapefile); #for ('.shp','.dbf') { # @stat1 = stat $example.$_; # @stat2 = stat $shapefile.$_; # ok($stat1[7] == $stat2[7], "cmp $_ files after unhash=0, expected $stat1[7] got $stat2[7]"); #} $shape = new Geo::Shapelib "example/xyz", {LoadRecords => 0}; $shape->save($shapefile); #for ('.shp','.dbf') { # @stat1 = stat $example.$_; # @stat2 = stat $shapefile.$_; # ok($stat1[7] == $stat2[7], "cmp $_ files after loadrecords=0, expected $stat1[7] got $stat2[7]"); #} $shape = new Geo::Shapelib "example/xyz", {LoadRecords => 0, UnhashFields => 0}; $shape->save($shapefile); #for ('.shp','.dbf') { # @stat1 = stat $example.$_; # @stat2 = stat $shapefile.$_; # ok($stat1[7] == $stat2[7], "cmp $_ files after loadrecords=0,unhash=0, expected $stat1[7] got $stat2[7]"); #} # thanks to Ethan Alpert for this test $shape = new Geo::Shapelib; $shape->{Name}; $shape->{Shapetype}=5; $shape->{FieldNames}=['ID','Name']; $shape->{FieldTypes}=['Integer','String']; push @{$shape->{ShapeRecords}},[0,$shapefile]; push @{$shape->{Shapes}}, { SHPType=>5, ShapeId=>0, NParts=>2, Parts=>[[0,5,'Ring'],[5,5,'Ring']], NVertices=>10, Vertices=>[[-1,1,0,0],[1,1,0,0],[1,-1,0,0],[-1,-1,0,0],[-1,1,0,0],[-.1,.1,0,0],[-.1,-.1,0,0],[.1,-.1,0,0],[.1,.1,0,0],[-.1,.1,0,0]] }; $shape->set_bounds; $shape->save($shapefile); #$shape->dump; $shape = new Geo::Shapelib $shapefile; #$shape->dump; #use Data::Dumper; #print Dumper($shape->{Shapes}[0]); ok($shape->{Shapes}[0]->{Vertices}[4][0] == -1, 'save multipart, vertices'); ok($shape->{Shapes}[0]->{Parts}[1][0] == 5, 'save multipart, parts'); END { foreach ( 'shp', 'shx', 'dbf', 'qix', 'dump' ) { unlink "$shapefile.$_"; } } __DATA__ Helsinki-Vantaan Lentoasema|HVL|19780202|3387419|6692222 Helsinki Kaisaniemi |HK|19580201|3385926|6675529 Hyvink Mutila |HM|19630302|3379813|6722622 Nurmijrvi Rajamki |HR|19340204|3376486|6715764 Vihti Maasoja |VM|19230502|3356766|6703481 Porvoo Jrnble |PJ|19450202|3426574|6703254 Porvoon Mlk Bengtsby |PMB|19670202|3424354|6684723 Orimattila Kkel |OK|19560202|3432847|6743998 Tuusula Ruotsinkyl |TR|19750402|3388723|6696784 libgeo-shapelib-perl-0.22/Changes0000644000175000017500000000607513042427731016551 0ustar frankiefrankieRevision history for Perl extension Geo::Shapelib. 0.01 Thu Aug 24 13:48:52 2000 - original version; created by h2xs 1.20 with options -n Shape shapelib-1.2.8/shapefil 0.02 Fri Aug 25 14:29:26 EEST 2000 - save implemented 0.03 released Sep 13. 2001 - changes from Quinn Hart , see README.Debian - included the debian files into MANIFEST 0.04 released Mar 4 2003 - changes from Leif Pedersen 0.05 released Oct 20 2003 - as Geo::Shapelib in CPAN - removed the debian files, sorry 0.06 released Oct 22 2003 - included Shapelib-1.2.10 tree into the distro 0.07 released Jan 14 2004 - change suggested by Stephen Woodbridge ("it would be nice to be able to define the size of the the DBF fields") - changes to shputils.c (#include ,int findunit(char *unit);) 0.08 released May 14 2004 - notes on installation in Windows from daniel.babault@mbda.fr 0.09 released May 27 2004 - DBFWrite.. bugs fixed (thanks Joaquin Ferrero) 0.10 released August 20 2004 - ForceStrings and other options for the new method (thanks Massimiliano ) - save bails out if shape is empty 0.11 released November 15 2004 - ShapeID, NParts, NVertices optional (they are set in save method) - Removed the DB method 0.12 released January 8 2005 - bug fix: $self->{Options} gets set in all cases - Fieldwidths in dbf files are used - rewrote if($self->{Options}{UnhashFields}) in new method - set_sizes method - failure of DBFWriteAttribute gets correctly tested - many bug fixes in dump method - brush up of the man page - new parameters for the constructor - SHPType optional - test.pl rewritten 0.13 released Feb 8 2005 - changes to Shapelib.xs to make it compile with gcc 2.96 (as suggested by Greg Machala) 0.14 released Apr 11 2005 - use Tree:R, optionally build a R-tree of the shapes - new methods: clear_selections, select_vertices, move_selected_vertices - use $shapefile instead of $shape in the docs, $shapefile is the whole object, $shape is either and individual shape or an index to an individual shape 0.15 released Apr 11 2005 - fixed small bugs in 0.14 0.16 released Apr 21 2005 - select_vertices more options (all, one shape, vertices) - Rtree handling in move_selected_vertices 0.17 released May 26 2005 - LoadRecords to control whether load records into Perl vars or not - fixed a bug which made open, save fail 0.18 released June 11 2005 - fixed bugs pointed out by Ethan Alpert: - in xs: in _CreateObject parts and vertices were not read correctly always, wrote tests for these - edited pod, Parts, CombineVertices - new method set_bounds 0.19 released Jan 15 2006 - new constructor options: Like, Load - get_record_hashref - create, add, close - lengths 0.20 released Jan 15 2006 - some bugfixes related to NShapes 0.21 released Sep 15 2015 - remove shapelib from the distribution - add quadtree support 0.22 released Jan 26 2017 - fix error https://rt.cpan.org/Public/Bug/Display.html?id=119994 - do not run file size comparison tests libgeo-shapelib-perl-0.22/MANIFEST0000644000175000017500000000052613042430442016373 0ustar frankiefrankieChanges LICENSE MANIFEST README.md typemap Makefile.PL t/00.t lib/Geo/Shapelib.pm Shapelib.xs example/xyz.dbf example/xyz.sbn example/xyz.sbx example/xyz.shp example/xyz.shx META.yml Module YAML meta-data (added by MakeMaker) META.json Module JSON meta-data (added by MakeMaker) libgeo-shapelib-perl-0.22/lib/0000755000175000017500000000000013042430442016005 5ustar frankiefrankielibgeo-shapelib-perl-0.22/lib/Geo/0000755000175000017500000000000013221542471016524 5ustar frankiefrankielibgeo-shapelib-perl-0.22/lib/Geo/Shapelib.pm0000644000175000017500000010265013042427573020623 0ustar frankiefrankiepackage Geo::Shapelib; use strict; use Carp; use Tree::R; use File::Basename qw(fileparse); use vars qw($VERSION @ISA @EXPORT %EXPORT_TAGS @EXPORT_OK $AUTOLOAD); use vars qw(%ShapeTypes %PartTypes); require Exporter; require DynaLoader; use AutoLoader 'AUTOLOAD'; @ISA = qw(Exporter DynaLoader); $VERSION = '0.22'; bootstrap Geo::Shapelib $VERSION; # Preloaded methods go here. # Autoload methods go after =cut, and are processed by the autosplit program. # Page 4 of the ESRI Shapefile Technical Description, July 1998 %ShapeTypes = ( 1 => 'Point', 3 => 'PolyLine', 5 => 'Polygon', 8 => 'Multipoint', 11 => 'PointZ', 13 => 'PolyLineZ', 15 => 'PolygonZ', 18 => 'MultipointZ', 21 => 'PointM', 23 => 'PolyLineM', 25 => 'PolygonM', 28 => 'MultipointM', 31 => 'Multipatch', ); # Page 21 of the ESRI Shapefile Technical Description, July 1998 %PartTypes = ( 0 => 'TriStrip', 1 => 'TriFan', 2 => 'OuterRing', 3 => 'InnerRing', 4 => 'FirstRing', 5 => 'Ring', ); # Create the SUBROUTINES FOR ShapeTypes and PartTypes # We could prefix these with SHPT_ and SHPP_ respectively { my %typeval = (map(uc,reverse(%ShapeTypes)),map(uc,reverse(%PartTypes))); for my $datum (keys %typeval) { no strict "refs"; # to register new methods in package *$datum = sub { $typeval{$datum}; } } } # Add Extended Exports %EXPORT_TAGS = ('constants' => [ map(uc,values(%ShapeTypes)), map(uc,values(%PartTypes)) ], 'types' =>[ qw(%ShapeTypes %PartTypes) ] ); $EXPORT_TAGS{all}=[ @{ $EXPORT_TAGS{constants} }, @{ $EXPORT_TAGS{types} } ]; @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); @EXPORT = qw(); =pod =head1 NAME Geo::Shapelib - Perl extension for reading and writing shapefiles as defined by ESRI(r) =head1 SYNOPSIS use Geo::Shapelib qw/:all/; or use Geo::Shapelib qw/:all/; my $shapefile = new Geo::Shapelib { Name => 'stations', Shapetype => POINT, FieldNames => ['Name','Code','Founded'], FieldTypes => ['String:50','String:10','Integer:8'] }; while () { chomp; my($station,$code,$founded,$x,$y) = split /\|/; push @{$shapefile->{Shapes}},{ Vertices => [[$x,$y,0,0]] }; push @{$shapefile->{ShapeRecords}}, [$station,$code,$founded]; } $shapefile->save(); =head1 DESCRIPTION This is a library for reading, creating, and writing shapefiles as defined by ESRI(r) using Perl. The Perl code uses Frank Warmerdam's Shapefile C Library (http://shapelib.maptools.org/). The library is included in this distribution. Currently no methods exist for populating an empty Shape. You need to do it in your own code. This is how: First you include the module into your code. If you want to define the shape type using its name, import all: use Geo::Shapelib qw/:all/; Create the shapefile object and specify its name and type: $shapefile = new Geo::Shapelib { Name => , Shapetype => , FieldNames => , FieldTypes => } The name (filename, may include path) of the shapefile, the extension is not used (it is stripped in the save method). The shape type is an integer. This module defines shape type names as constants (see below). The field name list is an array reference of the names of the data items assigned to each shape. The field type list is an array reference of the types of the data items. Field type is either 'Integer', 'Double', or 'String'. The types may have optional 'width' and 'decimals' fields defined, like this: 'Integer[:width]' defaults: width = 10 'Double[:width[:decimals]]' defaults: width = 10, decimals = 4 'String[:width]' defaults: width = 255 There are some other attributes which can be defined in the constructor (see below), they are rarely needed. The shape object will need or get a couple of other attributes as well. They should be treated as private: $shapefile->{NShapes} is the number of shapes in your object. Shapefile is a collection of shapes. This is usually automatically deduced from the Shapes array when needed. $shapefile->{MinBounds} is set by shapelib C functions. $shapefile->{MaxBounds} is set by shapelib C functions. Create the shapes and respective shape records and put them into the shape: for many times { make $s, a new shape as a reference to a hash push @{$shapefile->{Shapes}}, $s; make $r, a shape record as a reference to an array push @{$shapefile->{ShapeRecords}}, $r; } how to create $s? It is a (reference to an) hash. set: $s->{Vertices} this is a reference to an array of arrays of four values, one for each vertex: x, y, z, and m of the vertex. There should be at least one vertex in $s. Point has only one vertex. $s->{Parts}: $s->{Parts} is not needed in simple cases. $s->{Parts} is a reference to an array (a) of arrays (b). There is one (b) array for each part. In a (b) array the first value is an index to the Vertices array denoting the first vertex of that part. The second value is the type of the part (NOTE: not the type of the shape). The type is 5 (Ring) unless the shape is of type Multipatch. The third value is set as the type of the part as a string when reading from a file but the save method requires only the first two values. The index of the last vertex of any part is implicitly the index of the next part minus one or the index of the last vertex. forget these: $s->{ShapeId} may be left undefined. The save method sets it to the index in the Shapes array. Instead create and use an id field in the record. $s->{NParts} and $s->{NVertices} may be set but that is usually not necessary since they are calculated in the save method. You only need to set these if you want to save less parts or vertices than there actually are in the Parts or Vertices arrays. $s->{SHPType} is the type of the shape and it is automatically set to $shape->{Shapetype} unless defined (which you should not do) The shape record is simply an array reference, for example: $r = [item1,item2,item3,...]; That's all. Then save it and start your shapefile viewer to look at the result. =head1 EXPORT None by default. The following export tags are defined. =over 8 =item :constants This exports constant functions for the individual types of shapefile Types and shapefile part types. They all return scalar (integer) values. The shapetype functions: POINT, ARC, POLYGON, MULTIPOINT, POINTZ, ARCZ, POLYGONZ, MULTIPOINTZ, POINTM, ARCM, POLYGONM, MULTIPOINTM, MULTIPATCH are defined. The shapefile part types: TRISTRIP, TRIFAN, OUTERRING, INNERRING, FIRSTRING, RING are defined. =item :types Exports two hashs: %ShapeTypes, %PartTypes which map the shapelib type integers to string values. =item :all All possible exports are included. =back =head1 CONSTRUCTORS This one reads in an existing shapefile: $shapefile = new Geo::Shapelib "myshapefile", {}; This one creates a new, blank Perl shapefile object: $shapefile = new Geo::Shapelib {}; {} is optional in both cases, an example (note the curly braces): $shapefile = new Geo::Shapelib { Name => $shapefile, Shapetype => POINT, FieldNames => ['Name','Code','Founded'], FieldTypes => ['String:50','String:10','Integer:8'] }; $shapefile = new Geo::Shapelib "myshapefile" { Rtree => 1 }; =item Options: Like: A shapefile from which to copy ShapeType, FieldNames, and FieldTypes. Name: Default is "shapefile". The filename (if given) becomes the name for the shapefile unless overridden by this. Shapetype: Default "POINT". The type of the shapes. (All non-null shapes in a shapefile are required to be of the same shape type.) FieldNames: Default is []. FieldTypes: Default is []. ForceStrings: Default is 0. If 1, sets all FieldTypes to string, may be useful if values are very large ints Rtree: Default is 0. If 1, creates an R-tree of the shapes into an element Rtree. (Requires LoadAll.) When a shapefile is read from files they end up in a bit different kind of data structure than what is expected by the save method for example and what is described above. These flags enable the conversion, they are not normally needed. CombineVertices: Default is 1. CombineVertices is experimental. The default behavior is to put all vertices into the Vertices array and part indexes into the Parts array. If CombineVertices is set to 0 there is no Vertices array and all data goes into the Parts. Currently setting CombineVertices to 0 breaks saving of shapefiles. UnhashFields: Default is 1. Makes $self's attributes FieldNames, FieldTypes refs to lists, and ShapeRecords a list of lists. The default is to load all data into Perl variables in the constructor. With these options the data can be left into the files to be loaded on-demand. Load: Default is 1. If 0, has the same effect as LoadRecords=>0 and LoadAll=>0. LoadRecords: Default is 1. Reads shape records into $self->{ShapeRecords} automatically in the constructor using the get_record($shape_index) method LoadAll: Default is 1. Reads shapes (the geometry data) into $self->{Shapes} automatically in the constructor using the get_shape($shape_index) method =cut sub new { my $package = shift; my $filename; my $options = shift; unless (ref $options) { $filename = $options; $options = shift; } croak "usage: new Geo::Shapelib , {};" if (defined $options and not ref $options); my $self = {}; bless $self => (ref($package) or $package); $self->{Name} = $filename if $filename; my %defaults = ( Like => 0, Name => 'shapefile', Shapetype => 'POINT', FieldNames => [], FieldTypes => [], CombineVertices => 1, UnhashFields => 1, Load => 1, LoadRecords => 1, LoadAll => 1, ForceStrings => 0, Rtree => 0 ); for (keys %defaults) { next if defined $self->{$_}; $self->{$_} = $defaults{$_}; } if (defined $options and ref $options) { for (keys %$options) { croak "unknown constructor option for Geo::Shapelib: $_" unless defined $defaults{$_} } for (keys %defaults) { next unless defined $options->{$_}; $self->{$_} = $options->{$_}; } if ($self->{Like}) { for ('Shapetype','FieldNames','FieldTypes') { $self->{$_} = $options->{Like}->{$_}; } } } return $self unless $filename; # print "\n\n"; # for (keys %$self) { # print "$_ $self->{$_}\n"; # } # Read the specified file # Get 'NShapes', 'FieldTypes' and 'ShapeRecords' from the dbf my $dbf_handle = DBFOpen($self->{Name}, 'rb'); unless ($dbf_handle) { croak("DBFOpen $self->{Name} failed"); return undef; } $self->{NShapes} = DBFGetRecordCount($dbf_handle); $self->{FieldNames} = ''; $self->{FieldTypes} = ReadDataModel($dbf_handle, $self->{ForceStrings}); if ($self->{Load} and $self->{LoadRecords}) { $self->{ShapeRecords} = ReadData($dbf_handle, $self->{ForceStrings}); } DBFClose($dbf_handle); #return undef unless $dbf; # Here, not above, so the dbf always gets closed. # Get 'Shapetype', 'MinBounds', and 'MaxBounds' $self->{SHPHandle} = SHPOpen($self->{Name}, 'rb'); unless ($self->{SHPHandle}) { carp("SHPOpen $self->{Name} failed!"); return undef; } my $info = SHPGetInfo($self->{SHPHandle}); # DESTROY closes SHPHandle unless ($info) { carp("SHPGetInfo failed!"); return undef; } @$self{keys %$info} = values %$info; $self->{ShapetypeString} = $ShapeTypes{ $self->{Shapetype} }; if ($self->{UnhashFields}) { ($self->{FieldNames}, $self->{FieldTypes}) = data_model($self); if ($self->{Load} and $self->{LoadRecords}) { for my $i (0..$self->{NShapes}-1) { $self->{ShapeRecords}->[$i] = get_record_arrayref($self, $i, undef, 1); } } } if ($self->{Load} and $self->{LoadAll}) { for (my $i = 0; $i < $self->{NShapes}; $i++) { my $shape = get_shape($self, $i, 1); push @{$self->{Shapes}}, $shape; } } $self->Rtree() if $self->{Rtree}; return $self; } =pod =head1 METHODS =head2 data_model Returns data model converted into two arrays. If in a constructor a filename is given, then the data model is read from the dbf file and stored as a hashref in the attribute FieldTypes. This converts the hashref into two arrays: FieldNames and respective FieldTypes. These arrayrefs are stored in attributes of those names if UnhashFields is TRUE. =cut sub data_model { my $self = shift; my @FieldNames; my @FieldTypes; while (my($name,$type) = each %{$self->{FieldTypes}}) { push @FieldNames,$name; push @FieldTypes,$type; } return (\@FieldNames,\@FieldTypes); } =pod =head2 get_shape(shape_index, from_file) Returns a shape nr. shape_index+1 (first index is 0). The shape is read from a file even if array Shapes exists if from_file is TRUE. Option CombineVertices is in operation here. Use this method to get a shape unless you know what you are doing. =cut sub get_shape { my ($self, $i, $from_file) = @_; if (!$from_file and $self->{Shapes}) { return $self->{Shapes}->[$i]; } else { my $shape = SHPReadObject($self->{SHPHandle}, $i, $self->{CombineVertices}?1:0) or return undef; # $shape->{ShapeRecords} = $self->{ShapeRecords}[$i]; if($self->{CombineVertices}) { for my $part (@{$shape->{Parts}}) { $part->[2] = $PartTypes{ $part->[1] }; } } return $shape; } } =pod =head2 get_record(shape_index, from_file) Returns the record which belongs to shape nr. shape_index+1 (first index is 0). The record is read from a file even if array ShapeRecords exists if from_file is TRUE. =cut sub get_record { my ($self, $i, $from_file) = @_; if (!$from_file and $self->{ShapeRecords}) { return $self->{ShapeRecords}->[$i]; } else { my $dbf_handle = DBFOpen($self->{Name}, 'rb'); unless ($dbf_handle) { croak("DBFOpen $self->{Name} failed"); return undef; } my $rec = ReadRecord($dbf_handle, $self->{ForceStrings}, $i); DBFClose($dbf_handle); return $rec; } } =pod =head2 get_record_arrayref(shape_index, FieldNames, from_file) Returns the record which belongs to shape nr. shape_index+1 (first index is 0) as an arrayref. The parameter FieldNames may be undef but if defined, it is used as the array according to which the record array is sorted. This in case the ShapeRecords contains hashrefs. The record is read from the file even if array ShapeRecords exists if from_file is TRUE. Use this method to get a record of a shape unless you know what you are doing. =cut sub get_record_arrayref { my ($self, $i, $FieldNames, $from_file) = @_; my $rec = get_record($self, $i, $from_file); if (ref $rec eq 'HASH') { my @rec; $FieldNames = $self->{FieldNames} unless defined $FieldNames; for (@$FieldNames) { push @rec,$rec->{$_}; } return \@rec; } return $rec; } =pod =head2 get_record_hashref(shape_index, from_file) Returns the record which belongs to shape nr. shape_index+1 (first index is 0) as a hashref. The record is read from the file even if array ShapeRecords exists if from_file is TRUE. If records are in the array ShapeRecords as a list of lists, then FieldNames _must_ contain the names of the fields. Use this method to get a record of a shape unless you know what you are doing. =cut sub get_record_hashref { my ($self, $i, $from_file) = @_; my $rec = get_record($self, $i, $from_file); if (ref $rec eq 'ARRAY') { my %rec; for my $i (0..$#{$self->{FieldNames}}) { $rec{$self->{FieldNames}->[$i]} = $rec->[$i]; } return \%rec; } return $rec; } =pod =head2 lengths(shape) Returns the lengths of the parts of the shape. This is lengths of the parts of polyline or the length of the boundary of polygon. 2D and 3D data is taken into account. =cut sub lengths { my ($self, $shape) = @_; my @l; if ($shape->{NParts}) { my $pindex = 0; my $pmax = $shape->{NParts}; while($pindex < $pmax) { my $l = 0; my $prev = 0; my $part = $shape->{Parts}[$pindex]; if($self->{CombineVertices}) { my $vindex = $part->[0]; my $vmax = $shape->{Parts}[$pindex+1][0]; $vmax = $shape->{NVertices} unless defined $vmax; while($vindex < $vmax) { my $vertex = $shape->{Vertices}[$vindex]; if ($prev) { my $c2 = 0; if ($self->{Shapetype} < 10) { # x,y for (0..1) { $c2 += ($vertex->[$_] - $prev->[$_])**2; } } else { for (0..2) { $c2 += ($vertex->[$_] - $prev->[$_])**2; } } $l += sqrt($c2); } $prev = $vertex; $vindex++; } } else { for my $vertex (@{$part->{Vertices}}) { if ($prev) { my $c2 = 0; if ($self->{Shapetype} < 10) { # x,y for (0..1) { $c2 += ($vertex->[$_] - $prev->[$_])**2; } } else { for (0..2) { $c2 += ($vertex->[$_] - $prev->[$_])**2; } } $l += sqrt($c2); } $prev = $vertex; } } push @l,$l; $pindex++; } } else { my $l = 0; my $prev = 0; for my $vertex (@{$shape->{Vertices}}) { if ($prev) { my $c2 = 0; if ($self->{Shapetype} < 10) { # x,y for (0..1) { $c2 += ($vertex->[$_] - $prev->[$_])**2; } } else { for (0..2) { $c2 += ($vertex->[$_] - $prev->[$_])**2; } } $l += sqrt($c2); } $prev = $vertex; } push @l,$l; } return @l; } =pod =head2 Using shapefile quadtree spatial indexing Obtain a list of shape ids within the specified bound using a shapefile quadtree index: $shapefile->query_within_rect($bounds, $maxdepth = 0); $bounds should be an array reference of 4 elements (xmin, ymin, xmax, ymax) This method uses the quadtree indices defined by Shapelib *not* ESRI spatial index files (.sbn, .sbx). If a quadtree index (.qix) does not exist, one is created and saved as a file. To just create an index you can also use the method: $shapefile->create_spatial_index($maxdepth = 0); $maxdepth (optional) is the maximum depth of the index to create. Default is 0 meaning that shapelib will calculate a reasonable default depth. =cut sub query_within_rect { my ($self, $bounds, $maxdepth) = @_; croak "Shapefile is not open." unless $self->{SHPHandle}; my $fn = $self->qix_filename; $maxdepth ||= 0; my $found = SHPSearchDiskTree($self->{SHPHandle}, $fn, $bounds, $maxdepth); return $found; } sub create_spatial_index { my ($self, $maxdepth, $quiet) = @_; $maxdepth ||= 0; croak "Shapefile is not open." unless $self->{SHPHandle}; my $fn = $self->qix_filename; my $ret = SHPCreateSpatialIndex($fn, $maxdepth, $self->{SHPHandle}); croak "Could not create the spatial index file: $fn." if !$ret; return $ret; } sub qix_filename { my $self = shift; my ($file, $path, $suffix) = fileparse( $self->{Name}, '.shp' ); return "$path$file.qix"; } =pod =head2 Rtree and editing the shapefile Building a R-tree for the shapes: $shapefile->Rtree(); This is automatically done if Rtree-option is set when a shapefile is loaded from files. You can then use methods like (there are not yet any wrappers for these). my @shapes; $shapefile->{Rtree}->query_point(@xy,\@shapes); # or $shapefile->{Rtree}->query_completely_within_rect(@rect,\@shapes); # or $shapefile->{Rtree}->query_partly_within_rect(@rect,\@shapes); To get a list of shapes (indexes to the shape array), which you can feed for example to the select_vertices function. for my $shape (@shapes) { my $vertices = $shapefile->select_vertices($shape,@rect); my $n = @$vertices; print "you selected $n vertices from shape $shape\n"; } The shapefile object remembers the selected vertices and calling the function $shapefile->move_selected_vertices($dx,$dy); moves the vertices. The bboxes of the affected shapes, and the R-tree, if one exists, are updated automatically. To clear all selections from all shapes, call: $selected->clear_selections(); =cut sub Rtree { my $self = shift @_; unless (defined $self->{NShapes}) { croak "no shapes" unless $self->{Shapes} and ref $self->{Shapes} eq 'ARRAY' and @{$self->{Shapes}}; $self->{NShapes} = @{$self->{Shapes}}; } $self->{Rtree} = new Tree::R @_; for my $sindex (0..$self->{NShapes}-1) { my $shape = get_shape($self, $sindex); my @rect; @rect[0..1] = @{$shape->{MinBounds}}[0..1]; @rect[2..3] = @{$shape->{MaxBounds}}[0..1]; $self->{Rtree}->insert($sindex,@rect); } } sub clear_selections { my($self) = @_; for my $shape (@{$self->{Shapes}}) { $shape->{SelectedVertices} = []; } } sub select_vertices { my($self,$shape,$minx,$miny,$maxx,$maxy) = @_; unless (defined $shape) { for my $sindex (0..$self->{NShapes}-1) { $self->select_vertices($sindex); } return; } $shape = $self->{Shapes}->[$shape]; my @vertices; unless (defined $maxy) { @vertices = (0..$shape->{NVertices}-1); $shape->{SelectedVertices} = \@vertices; return \@vertices; } my $v = $shape->{Vertices}; my $i; for ($i = 0; $i < $shape->{NVertices}; $i++) { next unless $v->[$i]->[0] >= $minx and $v->[$i]->[0] <= $maxx and $v->[$i]->[1] >= $miny and $v->[$i]->[1] <= $maxy; push @vertices,$i; } $shape->{SelectedVertices} = \@vertices; return \@vertices; } sub move_selected_vertices { my($self,$dx,$dy) = @_; return unless $self->{NShapes}; my $count = 0; for my $sindex (0..$self->{NShapes}-1) { my $shape = $self->{Shapes}->[$sindex]; next unless $shape->{SelectedVertices} and @{$shape->{SelectedVertices}}; my $v = $shape->{Vertices}; for my $vindex (@{$shape->{SelectedVertices}}) { $v->[$vindex]->[0] += $dx; $v->[$vindex]->[1] += $dy; } my @rect; for my $vertex (@{$shape->{Vertices}}) { $rect[0] = defined($rect[0]) ? min($vertex->[0],$rect[0]) : $vertex->[0]; $rect[1] = defined($rect[1]) ? min($vertex->[1],$rect[1]) : $vertex->[1]; $rect[2] = defined($rect[2]) ? max($vertex->[0],$rect[2]) : $vertex->[0]; $rect[3] = defined($rect[3]) ? max($vertex->[1],$rect[3]) : $vertex->[1]; } @{$shape->{MinBounds}}[0..1] = @rect[0..1]; @{$shape->{MaxBounds}}[0..1] = @rect[2..3]; $count++; } if ($self->{Rtree}) { if ($count < 10) { for my $sindex (0..$self->{NShapes}-1) { my $shape = $self->{Shapes}->[$sindex]; next unless $shape->{SelectedVertices} and @{$shape->{SelectedVertices}}; # update Rtree... #delete $sindex from it print STDERR "remove $sindex\n"; $self->{Rtree}->remove($sindex); } for my $sindex (0..$self->{NShapes}-1) { my $shape = $self->{Shapes}->[$sindex]; next unless $shape->{SelectedVertices} and @{$shape->{SelectedVertices}}; my @rect = (@{$shape->{MinBounds}}[0..1],@{$shape->{MaxBounds}}[0..1]); # update Rtree... # add $sindex to it print STDERR "add $sindex\n"; $self->{Rtree}->insert($sindex,@rect); } } else { $self->Rtree; } } $self->{MinBounds}->[0] = $self->{Shapes}->[0]->{MinBounds}->[0]; $self->{MinBounds}->[1] = $self->{Shapes}->[0]->{MinBounds}->[1]; $self->{MaxBounds}->[0] = $self->{Shapes}->[0]->{MaxBounds}->[0]; $self->{MaxBounds}->[1] = $self->{Shapes}->[0]->{MaxBounds}->[1]; for my $sindex (1..$self->{NShapes}-1) { my $shape = $self->{Shapes}->[$sindex]; $self->{MinBounds}->[0] = min($self->{MinBounds}->[0],$shape->{MinBounds}->[0]); $self->{MinBounds}->[1] = min($self->{MinBounds}->[1],$shape->{MinBounds}->[1]); $self->{MaxBounds}->[0] = max($self->{MaxBounds}->[0],$shape->{MaxBounds}->[0]); $self->{MaxBounds}->[1] = max($self->{MaxBounds}->[1],$shape->{MaxBounds}->[1]); } } sub min { $_[0] > $_[1] ? $_[1] : $_[0]; } sub max { $_[0] > $_[1] ? $_[0] : $_[1]; } =pod =head2 Setting the bounds of the shapefile $shapefile->set_bounds; Sets the MinBounds and MaxBounds of all shapes and of the shapefile. =cut sub set_bounds { my($self) = @_; return unless @{$self->{Shapes}}; my $first = 1; for my $shape (@{$self->{Shapes}}) { my @rect; for my $vertex (@{$shape->{Vertices}}) { $rect[0] = defined($rect[0]) ? min($vertex->[0],$rect[0]) : $vertex->[0]; $rect[1] = defined($rect[1]) ? min($vertex->[1],$rect[1]) : $vertex->[1]; $rect[2] = defined($rect[2]) ? max($vertex->[0],$rect[2]) : $vertex->[0]; $rect[3] = defined($rect[3]) ? max($vertex->[1],$rect[3]) : $vertex->[1]; } @{$shape->{MinBounds}}[0..1] = @rect[0..1]; @{$shape->{MaxBounds}}[0..1] = @rect[2..3]; if ($first) { $self->{MinBounds}->[0] = $shape->{MinBounds}->[0]; $self->{MinBounds}->[1] = $shape->{MinBounds}->[1]; $self->{MaxBounds}->[0] = $shape->{MaxBounds}->[0]; $self->{MaxBounds}->[1] = $shape->{MaxBounds}->[1]; $first = 0; } else { $self->{MinBounds}->[0] = min($self->{MinBounds}->[0],$shape->{MinBounds}->[0]); $self->{MinBounds}->[1] = min($self->{MinBounds}->[1],$shape->{MinBounds}->[1]); $self->{MaxBounds}->[0] = max($self->{MaxBounds}->[0],$shape->{MaxBounds}->[0]); $self->{MaxBounds}->[1] = max($self->{MaxBounds}->[1],$shape->{MaxBounds}->[1]); } } } =pod =head2 Saving the shapefile $shapefile->save($filename); The argument $shapefile is optional, the internal attribute $shapefile->{Name} is used if $filename is not specified. If $filename is specified it also becomes the new name. $filename may contain an extension, it is removed and .shp etc. are used instead. If you are not sure that the bounds of the shapefile are ok, then call $shapefile->set_bounds; before saving. =cut sub save { my($self,$filename) = @_; unless (defined $self->{NShapes}) { croak "no shapes" unless $self->{Shapes} and ref $self->{Shapes} eq 'ARRAY' and @{$self->{Shapes}}; $self->{NShapes} = @{$self->{Shapes}}; } $self->create($filename); for my $i (0..$self->{NShapes}-1) { my $s = get_shape($self, $i); my $rec = get_record($self, $i); $self->add($s, $rec); } $self->close(); } =pod =head2 create, add, close $shapefile->create($filename); many times: $shapefile->add($shape, $record); $shapefile->close(); These methods make it easy to create large shapefiles. $filename is optional. These methods create some temporary variables (prefix: _) in internal data and thus calling of close method is required. =cut sub create { my ($self, $filename) = @_; $filename = $self->{Name} unless defined $filename; $filename =~ s/\.\w+$//; $self->{_filename} = $filename; $self->{_SHPhandle} = SHPCreate($filename.'.shp', $self->{Shapetype}); croak "SHPCreate failed" unless $self->{_SHPhandle}; $self->{_DBFhandle} = DBFCreate($filename.'.dbf'); croak "DBFCreate failed" unless $self->{_DBFhandle}; $self->{_fn} = $self->{FieldNames}; my $ft = $self->{FieldTypes}; unless ($self->{_fn}) { ($self->{_fn}, $ft) = data_model($self); } for my $f (0..$#{$self->{_fn}}) { my $type = 0; my $width; my $decimals = 0; my ($ftype, $fwidth, $fdeci) = split(/[:;,]/, $ft->[$f]); SWITCH: { if ($ftype eq 'String') { $type = 1; $width = defined($fwidth)?$fwidth:255; last SWITCH; } if ($ftype eq 'Integer') { $type = 2; $width = defined($fwidth)?$fwidth:10; last SWITCH; } if ($ftype eq 'Double') { $type = 3; $width = defined($fwidth)?$fwidth:10; $decimals = defined($fdeci)?$fdeci:4; last SWITCH; } } $self->{_ftypes}->[$f] = $type; next unless $type; my $ret = _DBFAddField($self->{_DBFhandle}, $self->{_fn}->[$f], $type, $width, $decimals); croak "DBFAddField failed for field $self->{_fn}->[$f] of type $ft->[$f]" if $ret == -1; } $self->{_SHP_id} = 0; } sub add { my ($self, $shape, $record) = @_; if (defined($shape->{SHPType})) { if ($shape->{SHPType} != 0 and $shape->{SHPType} != $self->{Shapetype}) { croak "non-null shapes with differing shape types"; } } else { $shape->{SHPType} = $self->{Shapetype}; } my $nParts = exists $shape->{Parts} ? @{$shape->{Parts}} : 0; if (defined $shape->{NParts}) { if ($shape->{NParts} > $nParts) { croak "NParts is larger than the actual number of Parts"; } else { $nParts = $shape->{NParts}; } } my $nVertices = exists $shape->{Vertices} ? @{$shape->{Vertices}} : 0; if (defined $shape->{NVertices}) { if ($shape->{NVertices} > $nVertices) { croak "NVertices is larger than the actual number of Vertices"; } else { $nVertices = $shape->{NVertices}; } } my $id = defined $shape->{ShapeId} ? $shape->{ShapeId} : $self->{_SHP_id}; my $s = _SHPCreateObject($shape->{SHPType}, $id, $nParts, $shape->{Parts}, $nVertices, $shape->{Vertices}); croak "SHPCreateObject failed" unless $s; SHPWriteObject($self->{_SHPhandle}, -1, $s); SHPDestroyObject($s); my $r = $record; if (ref $r eq 'HASH') { my @rec; for (@{$self->{_fn}}) { push @rec,$r->{$_}; } $r = \@rec; } for my $f (0..$#{$self->{_fn}}) { next unless $self->{_ftypes}->[$f]; my $ret; SWITCH: { if ($self->{_ftypes}->[$f] == 1) { $ret = DBFWriteStringAttribute($self->{_DBFhandle}, $self->{_SHP_id}, $f, $r->[$f]) if exists $r->[$f]; last SWITCH; } if ($self->{_ftypes}->[$f] == 2) { $ret = DBFWriteIntegerAttribute($self->{_DBFhandle}, $self->{_SHP_id}, $f, $r->[$f]) if exists $r->[$f]; last SWITCH; } if ($self->{_ftypes}->[$f] == 3) { $ret = DBFWriteDoubleAttribute($self->{_DBFhandle}, $self->{_SHP_id}, $f, $r->[$f]) if exists $r->[$f]; last SWITCH; } } croak "DBFWriteAttribute(field = $self->{_fn}->[$f], ftype = $self->{_ftypes}[$f], value = $r->[$f]) failed" unless $ret; } $self->{_SHP_id}++; } sub close { my ($self) = @_; SHPClose($self->{_SHPhandle}); DBFClose($self->{_DBFhandle}); $self->{Name} = $self->{_filename}; delete $self->{_SHPhandle}; delete $self->{_DBFhandle}; delete $self->{_fn}; delete $self->{_ftypes}; delete $self->{_SHP_id}; delete $self->{_filename}; } =pod =head2 Dump $shapefile->dump($to); $to can be undef (then dump uses STDOUT), filename, or reference to a filehandle (e.g., \*DUMP). This method just dumps all data. If you have yourself created the shapefile then the reported bounds may be incorrect. =cut sub dump { my ($self,$file) = @_; unless (defined $self->{NShapes}) { croak "no shapes" unless $self->{Shapes} and ref $self->{Shapes} eq 'ARRAY' and @{$self->{Shapes}}; $self->{NShapes} = @{$self->{Shapes}}; } my $old_select; if (defined $file) { if (not ref $file) { # $file is a name that we'll convert to a file handle # ref. Passing open a scalar makes it close when the # scaler is destroyed. my $fh; unless (open $fh, ">$file") { carp("$file: $!"), return undef; } $file = $fh; } return undef unless ref($file) eq 'GLOB'; $old_select = select($file); } printf "Name: %s\n", ($self->{Name} or '(none)'); print "Shape type: $self->{Shapetype} ($ShapeTypes{$self->{Shapetype}})\n"; printf "Min bounds: %11f %11f %11f %11f\n", @{$self->{MinBounds}} if $self->{MinBounds}; printf "Max bounds: %11f %11f %11f %11f\n", @{$self->{MaxBounds}} if $self->{MaxBounds}; my $fn = $self->{FieldNames}; my $ft = $self->{FieldTypes}; unless ($fn) { ($fn, $ft) = data_model($self); } print "Field names: ", join(', ', @$fn), "\n"; print "Field types: ", join(', ', @$ft), "\n"; print "Number of shapes: $self->{NShapes}\n"; my $sindex = 0; while($sindex < $self->{NShapes}) { my $shape = get_shape($self, $sindex); my $rec = get_record_arrayref($self, $sindex, $fn); print "Begin shape ",$sindex+1," of $self->{NShapes}\n"; print "\tShape id: $shape->{ShapeId}\n"; print "\tShape type: $shape->{SHPType} ($ShapeTypes{$shape->{SHPType}})\n"; printf "\tMin bounds: %11f %11f %11f %11f\n", @{$shape->{MinBounds}} if $shape->{MinBounds}; printf "\tMax bounds: %11f %11f %11f %11f\n", @{$shape->{MaxBounds}} if $shape->{MaxBounds}; print "\tShape record: ", join(', ', @$rec), "\n"; if ($shape->{NParts}) { my $pindex = 0; my $pmax = $shape->{NParts}; while($pindex < $pmax) { my $part = $shape->{Parts}[$pindex]; print "\tBegin part ",$pindex+1," of $pmax\n"; if($self->{CombineVertices}) { print "\t\tPartType: $part->[1] ($part->[2])\n"; my $vindex = $part->[0]; my $vmax = $shape->{Parts}[$pindex+1][0]; $vmax = $shape->{NVertices} unless defined $vmax; while($vindex < $vmax) { printf "\t\tVertex: %11f %11f %11f %11f\n", @{$shape->{Vertices}[$vindex]}; $vindex++; } } else { print "\t\tPart id: $part->{PartId}\n"; print "\t\tPart type: $part->{PartType} ($PartTypes{$part->{PartType}})\n"; for my $vertex (@{$part->{Vertices}}) { printf "\t\tVertex: %11f %11f %11f %11f\n", @$vertex; } } print "\tEnd part ",$pindex+1," of $pmax\n"; $pindex++; } } else { for my $vertex (@{$shape->{Vertices}}) { printf "\t\tVertex: %11f %11f %11f %11f\n", @$vertex; } } print "End shape ",$sindex+1," of $self->{NShapes}\n"; $sindex++; } select $old_select if defined $old_select; return 1; } sub DESTROY { my $self = shift; SHPClose($self->{SHPHandle}) if defined $self->{SHPHandle}; } 1; __END__ =head1 AUTHOR Ari Jolma, https://github.com/ajolma =head1 REPOSITORY L =cut libgeo-shapelib-perl-0.22/META.json0000644000175000017500000000224113042430442016657 0ustar frankiefrankie{ "abstract" : "Perl extension for reading and writing shapefiles as defined by ESRI(r)", "author" : [ "Ari Jolma " ], "dynamic_config" : 1, "generated_by" : "ExtUtils::MakeMaker version 7.24, CPAN::Meta::Converter version 2.150005", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : "2" }, "name" : "Geo-Shapelib", "no_index" : { "directory" : [ "t", "inc" ] }, "prereqs" : { "build" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "configure" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "runtime" : { "requires" : { "Tree::R" : "0.01" } } }, "release_status" : "stable", "resources" : { "repository" : { "type" : "git", "url" : "https://github.com/ajolma/Geo-Shapelib.git", "web" : "https://github.com/ajolma/Geo-Shapelib" } }, "version" : "0.22", "x_serialization_backend" : "JSON::PP version 2.27400" }