Skip to content

Commit

Permalink
Merge pull request #1027 from akrherz/241213
Browse files Browse the repository at this point in the history
🎨 Cleanups for IEM Freeze
  • Loading branch information
akrherz authored Dec 13, 2024
2 parents d441dac + b22bbde commit b170aea
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 121 deletions.
34 changes: 0 additions & 34 deletions data/gis/base2163.map
Original file line number Diff line number Diff line change
Expand Up @@ -481,40 +481,6 @@ LAYER
END
END

# Credits
LAYER
NAME "bar640t-title"
TYPE POINT
STATUS OFF
TRANSFORM FALSE
CLASS
NAME 's14y'
LABEL
COLOR 255 255 0
TYPE TRUETYPE
SIZE 14
FONT 'liberation'
POSITION CR
FORCE TRUE
PARTIALS TRUE
BUFFER 2
END
END
CLASS
NAME 's12w'
LABEL
COLOR 255 255 255
TYPE TRUETYPE
SIZE 12
FONT 'liberation'
POSITION CR
FORCE TRUE
PARTIALS TRUE
BUFFER 2
END
END
END

###
# Watch by County
LAYER
Expand Down
35 changes: 0 additions & 35 deletions data/gis/base26915.map
Original file line number Diff line number Diff line change
Expand Up @@ -474,41 +474,6 @@ LAYER
END
END


# Credits
LAYER
NAME "bar640t-title"
TYPE POINT
STATUS OFF
TRANSFORM FALSE
CLASS
NAME 's14y'
LABEL
COLOR 255 255 0
TYPE TRUETYPE
SIZE 14
FONT 'liberation'
POSITION CR
FORCE TRUE
PARTIALS TRUE
BUFFER 2
END
END
CLASS
NAME 's12w'
LABEL
COLOR 255 255 255
TYPE TRUETYPE
SIZE 12
FONT 'liberation'
POSITION CR
FORCE TRUE
PARTIALS TRUE
BUFFER 2
END
END
END

LAYER
CONNECTIONTYPE postgis
NAME allsbw
Expand Down
37 changes: 0 additions & 37 deletions data/gis/base4326.map
Original file line number Diff line number Diff line change
Expand Up @@ -813,43 +813,6 @@ LAYER
END
END




# Credits
LAYER
NAME "bar640t-title"
TYPE POINT
STATUS OFF
TRANSFORM FALSE
CLASS
NAME 's14y'
LABEL
COLOR 255 255 0
TYPE TRUETYPE
SIZE 14
FONT 'liberation'
POSITION CR
FORCE TRUE
PARTIALS TRUE
BUFFER 2
END
END
CLASS
NAME 's12w'
LABEL
COLOR 255 255 255
TYPE TRUETYPE
SIZE 12
FONT 'liberation'
POSITION CR
FORCE TRUE
PARTIALS TRUE
BUFFER 2
END
END
END

# Credits
LAYER
NAME credits
Expand Down
29 changes: 29 additions & 0 deletions data/gis/iem.mapinc
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,35 @@ LAYER
END
END

# Credits
LAYER
NAME "bar640t-title"
TYPE POINT
STATUS OFF
TRANSFORM FALSE
LABELCACHE OFF
CLASS
NAME 's14y'
LABEL
COLOR 255 255 0
TYPE TRUETYPE
SIZE 14
FONT 'liberation'
POSITION CR
END
END
CLASS
NAME 's12w'
LABEL
COLOR 255 255 255
TYPE TRUETYPE
SIZE 12
FONT 'liberation'
POSITION CR
END
END
END

LAYER
CONNECTIONTYPE postgis
NAME airtemps
Expand Down
31 changes: 22 additions & 9 deletions htdocs/GIS/apps/iem/freeze.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require_once "../../../../include/forms.php";
$state = isset($_GET['state']) ? xssafe($_GET['state']) : '';
$radar = isset($_GET['radar']) ? xssafe($_GET['radar']) : 1;
$refresh = isset($_GET['refresh']) ? xssafe($_GET['refresh']) : 0;
$imgsize = isset($_GET["imgsize"]) ? xssafe($_GET["imgsize"]) : "640x480";
$imgsize = isset($_GET["imgsize"]) ? xssafe($_GET["imgsize"]) : "1280x1024";
$tokens = explode("x", $imgsize);
$imgwidth = intval($tokens[0]);
$imgheight = intval($tokens[1]);
Expand Down Expand Up @@ -58,7 +58,7 @@ if (isset($sextent))
$oextents = $sextent;
else
$oextents = isset($_GET['extents']) ? xssafe($_GET['extents']) : "-105,36,-86,50";
$zoom = isset($_GET['zoom']) ? intval($_GET['zoom']) : 0;
$zoom = isset($_GET['zoom']) ? intval($_GET['zoom']) : 0;
/**
* Something simple to enable click interface on a PHP mapcript
* application
Expand Down Expand Up @@ -112,7 +112,7 @@ $imgurl .= sprintf(
if ($radar) {
$imgurl .= "layers[]=nexrad&";
}
$imgurl .= "&title=IEM%20Freeze&";
$imgurl .= "&title=IEM%20Freeze&layers[]=interstates";

if ($refresh > 0) {
$t->headextra = "<meta http-equiv=\"refresh\" content=\"" . $refresh . "; URL=" . $uri . "?imgsize=$imgsize&refresh=" . $refresh . "&extents=" . $extents . "&state=" . $state . "\">\n";
Expand All @@ -137,12 +137,25 @@ $reselect = make_select("refresh", $refresh, $ar);
$sselect = "<select name=\"ba\" onChange=\"location=this.form.ba.options[this.form.ba.selectedIndex].value\">";
$sselect .= "<option value=\"#\"> -- User Defined -- </option>";
$ar = array(
"A" => "Midwest US", "AK" => "Alaska", "HI" => "Hawaii",
"IL" => "Illinois", "IA" => "Iowa", "IA_C" => "Iowa Central", "IA_NE" => "Iowa Northeast",
"IA_SE" => "Iowa Southeast", "IA_SW" => "Iowa Southwest", "IA_NW" => "Iowa Northwest",
"KS" => "Kansas", "NE" => "Nebraska", "MN_N" => "Minnesota North",
"MN_S" => "Minnsota South", "MO" => "Missouri", "ND" => "North Dakota",
"NW" => "Pacific Northwest", "SD" => "South Dakota", "WI" => "Wisconsin"
"A" => "Midwest US",
"AK" => "Alaska",
"HI" => "Hawaii",
"IL" => "Illinois",
"IA" => "Iowa",
"IA_C" => "Iowa Central",
"IA_NE" => "Iowa Northeast",
"IA_SE" => "Iowa Southeast",
"IA_SW" => "Iowa Southwest",
"IA_NW" => "Iowa Northwest",
"KS" => "Kansas",
"NE" => "Nebraska",
"MN_N" => "Minnesota North",
"MN_S" => "Minnsota South",
"MO" => "Missouri",
"ND" => "North Dakota",
"NW" => "Pacific Northwest",
"SD" => "South Dakota",
"WI" => "Wisconsin"
);
foreach ($ar as $key => $val) {
$sselect .= sprintf(
Expand Down
11 changes: 5 additions & 6 deletions htdocs/GIS/radmap.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
/*
* I am sort of inspired by the old mapblaster days. Lets create a map of
* all sorts of data with tons of CGI vars, yippeee
*
*/
require_once "/usr/lib64/php/modules/mapscript.php";

Expand Down Expand Up @@ -787,7 +786,7 @@ function get_ridge_fn_and_time($ts, $radar, $product)

$tlayer = $map->getLayerByName("bar640t-title");
$point = new pointobj();
$point->setXY(80, 9);
$point->setXY(80, 15);
$tzformat = "d M Y h:i A T";
$tzinfo = isset($_REQUEST["tz"]) ? xssafe($_REQUEST["tz"]) : "America/Chicago";
// Translate to ZoneInfo compat
Expand Down Expand Up @@ -850,21 +849,23 @@ function get_ridge_fn_and_time($ts, $radar, $product)
}
}

// Flush all the labels to the plot prior to doing headers and legends
$map->drawLabelCache($img);

$header_height = ($plotmeta["subtitle"] == "") ? 36 : 53;
draw_header($map, $img, $width, $header_height);

$point->draw($map, $tlayer, $img, 0, $title);

$point = new pointobj();
$point->setXY(80, 26);
$point->setXY(80, 32);
$point->draw($map, $tlayer, $img, 1, "$d");
if ($plotmeta["subtitle"] != "") {
$point = new pointobj();
$point->setXY(80, 43);
$point->draw($map, $tlayer, $img, 1, $plotmeta["subtitle"]);
}

$map->drawLabelCache($img);

$layer = $map->getLayerByName("logo");
$point = new pointobj();
Expand All @@ -887,8 +888,6 @@ function get_ridge_fn_and_time($ts, $radar, $product)
if (in_array("legend", $layers)) {
$map->embedLegend($img);
}
//$map->drawLabelCache($img);
//$map->save("/tmp/test.map");

header("Content-type: image/png");
echo $img->getBytes();

0 comments on commit b170aea

Please sign in to comment.