我正在尝试用 svg 绘制一些点。它们是小范围的 x,y 坐标:
57.206116 -6.223032
57.2225 -6.2441702
57.233299 -6.1833301
57.246666 -6.210278
57.208561 -6.2244201
当它们被绘制时,它们在屏幕上显然非常小。这是我的视图框命令:
print qq(
<svg width="20cm" height="20cm" viewBox="57 -7 3 3">);
我如何改进它,以便在 20 x 20 厘米的盒子内清楚地显示它们。
#!/usr/bin/perl
use DBI;
use CGI::Carp qw(fatalsToBrowser);
#Set content type
print "Content-Type: image/svg-xml\n\n";
#Establish connection to database
$dbh = DBI->connect ('dbi:Oracle:geosgen','user','pass')
|| die "Man down! Man down!: $DBI::errstr";
#Send SQL query for finds
$sth1 = $dbh->prepare("select table_alias.mot.sdo_point.X, table_alias.mot.sdo_point.Y
from x.mounts table_alias");
$sth1->execute;
#Set content type
print qq(<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20001102//EN"
"http://www.w3.org/TR/2000/CR-SVG-20001102/DTD/svg-20001102.dtd">);
print qq(<svg width="20cm" height="20cm" viewBox="57 -7 3 3">);
while (@data = $sth1->fetchrow_array()) {
print qq(
<g transform="scale(1,-1)">
<circle cx="$data[0]" cy="$data[1]" r="0.01" fill="green">
</circle>
</g>
);
}
打印 qq();