Geo::MapInfo::MIF::Writer::Region - Perl extension for writing MapInfo Interchange Format (MIF) Region files.
use Geo::MapInfo::MIF::Writer::Region; my $map=Geo::MapInfo::MIF::Writer::Region->new(basename=>$basename); $map->addSimpleRegion( data => {col1=>"val1", col2=>"val2"}, region => [[$lon1, $lat1], [$lon2, $lat2], [$lon3, $lat3], [$lon4, $lat4]], ); $map->addMultipartRegion( data => {col1=>"val1", col2=>"val2"}, regions => [ #note the "s" in regions [[$lon1a, $lat1a], [$lon2a, $lat2a], [$lon3a, $lat3a], [$lon4a, $lat4a]], [[$lon1b, $lat1b], [$lon2b, $lat2b], [$lon3b, $lat3b], [$lon4b, $lat4b]], [[$lon1c, $lat1c], [$lon2c, $lat2c], [$lon3c, $lat3c], [$lon4c, $lat4c]], ], ); $map->save;
Perl extension for writing MapInfo Interchange Format (MIF) Region files.
Note: This package stores data in memory before writing so it may not be appropriate for every use.
Creates a new object.
my $map=Geo::MapInfo::MIF::Writer::Region->new;
Sets and returns the basename of the mid/mif files.
$map->basename("basename"); $map->basename("./path/basename"); $map->basename("/path/basename"); $map->basename(undef); #default is "mapinfo-yyyymmddhhmiss"
Writes mid and mif files to the name indicated by basename.
$map->save;
Note: This method overwrites files if they exist.
Adds a new object to the in memory array.
$map->addSimpleRegion( data => {id=>1, col2=>"Foo", col3=>"Bar"}, #default is id=>$index. region => [[$x1,$y1], [$x2,$y2], [$x3,$y3]], #default is "none" which means no geocoded data );
$map->addMultipartRegion( data => {id=>1, col2=>"Foo", col3=>"Bar"}, regions => [ [[$x1,$y1], [$x2,$y2], [$x3,$y3]], \@r2, #can be island or lake but MapInfo figures that out for you. \@r3, ], );
Currently this package only supports Regions since points and circles are trival to support in MapInfo.
Currently we only support string and integer types.
Please log on RT and send an email to the author.
Patches accepted!
DavisNetworks.com supports all Perl applications including this package.
Michael R. Davis CPAN ID: MRDVT DavisNetworks.com davis@davisnetworks.com http://www.davisnetworks.com/
This program is free software licensed under the...
The BSD License
The full text of the license can be found in the LICENSE file included with this module.
Geo::MapInfo::MIF - MapInfo Interchange Format (MIF) File Reader
To install Geo::MapInfo::MIF::Writer::Region, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Geo::MapInfo::MIF::Writer::Region
CPAN shell
perl -MCPAN -e shell install Geo::MapInfo::MIF::Writer::Region
For more information on module installation, please visit the detailed CPAN module installation guide.