本文整理汇总了PHP中versao函数的典型用法代码示例。如果您正苦于以下问题:PHP versao函数的具体用法?PHP versao怎么用?PHP versao使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了versao函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: markerclusterMapfile
function markerclusterMapfile()
{
global $dir, $map_file, $layer, $base, $locaplic, $dir_tmp, $postgis_mapa;
if (empty($map_file) && file_exists($dir . "/../../temas/{$layer}.map")) {
$versao = versao();
$versao = $versao["principal"];
if (!isset($base) || $base == "") {
if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) {
$base = $locaplic . "/aplicmap/geral1windowsv" . $versao . ".map";
} else {
if ($base == "" && file_exists('/var/www/i3geo/aplicmap/geral1debianv' . $versao . '.map')) {
$base = "/var/www/i3geo/aplicmap/geral1debianv" . $versao . ".map";
}
if ($base == "" && file_exists('/var/www/html/i3geo/aplicmap/geral1fedorav' . $versao . '.map')) {
$base = "/var/www/html/i3geo/aplicmap/geral1fedorav" . $versao . ".map";
}
if ($base == "" && file_exists('/opt/www/html/i3geo/aplicmap/geral1fedorav' . $versao . '.map')) {
$base = "/opt/www/html/i3geo/aplicmap/geral1v" . $versao . ".map";
}
if ($base == "") {
$base = $locaplic . "/aplicmap/geral1v" . $versao . ".map";
}
}
}
$map_file = $dir_tmp . "/" . nomeRandomico() . ".map";
$mapa = ms_newMapObj($base);
$tempMapa = ms_newMapObj($dir . "/../../temas/{$layer}.map");
$layern = $tempMapa->getlayer(0);
restauraConObj($mapa, $postgis_mapa);
ms_newLayerObj($mapa, $layern);
$mapa->save($map_file);
}
return $map_file;
}
示例2: __construct
function __construct($map_file, $tema = "", $locaplic = "")
{
include dirname(__FILE__) . "/../ms_configura.php";
$this->postgis_mapa = $postgis_mapa;
if (file_exists($locaplic . "/funcoes_gerais.php")) {
include_once $locaplic . "/funcoes_gerais.php";
} else {
include_once "funcoes_gerais.php";
}
$this->v = versao();
$this->vi = $this->v["inteiro"];
$this->v = $this->v["principal"];
$this->mapa = ms_newMapObj($map_file);
substituiConObj($this->mapa, $postgis_mapa);
$this->arquivo = str_replace(".map", "", $map_file) . ".map";
if ($tema != "" && @$this->mapa->getlayerbyname($tema)) {
$this->layer = $this->mapa->getlayerbyname($tema);
}
$this->nome = $tema;
}
示例3: __construct
function __construct($map_file, $tema = "", $ext = "")
{
include_once dirname(__FILE__) . "/funcoes_gerais.php";
include dirname(__FILE__) . "/../ms_configura.php";
$this->postgis_mapa = $postgis_mapa;
$this->v = versao();
$this->v = $this->v["principal"];
$this->qyfile = str_replace(".map", "_qy.map", $map_file);
if ($tema != "") {
$this->qyfileTema = dirname($map_file) . "/" . $tema . "_qy.map";
} else {
$this->qyfileTema = "";
}
$this->mapa = ms_newMapObj($map_file);
substituiConObj($this->mapa, $postgis_mapa);
$this->arquivo = str_replace(".map", "", $map_file) . ".map";
if ($tema != "" && @$this->mapa->getlayerbyname($tema)) {
$this->layer = $this->mapa->getlayerbyname($tema);
}
$this->nome = $tema;
$c = $this->mapa->numlayers;
for ($i = 0; $i < $c; ++$i) {
$l = $this->mapa->getlayer($i);
$l->set("template", "none.htm");
}
if ($ext && $ext != "") {
$e = explode(" ", $ext);
$extatual = $this->mapa->extent;
$extatual->setextent(min($e[0], $e[2]), min($e[1], $e[3]), max($e[0], $e[2]), max($e[1], $e[3]));
}
if ($this->mapa->getmetadata("interface") == "googlemaps") {
$this->projO = $this->mapa->getProjection();
$this->mapa->setProjection(pegaProjecaoDefault("proj4"));
}
}
示例4: calculaGeometrias
function calculaGeometrias($dir_tmp, $imgdir, $lista, $operacao)
{
// error_reporting(0);
$lista = explode(",", $lista);
$dir = $dir_tmp . "/" . $imgdir . "/";
foreach ($lista as $l) {
$geos = $this->unserializeGeo($dir . $l);
//
// verifica a versão do mapserver
// se for anterior a 5, utiliza a conexão com o postgis para fazer o processamento dos daods
//
$v = versao();
if ($v["principal"] < 5) {
return "erro. E necessario uma versão maior que 5.0 do Mapserver.";
}
foreach ($geos["dados"] as &$geo) {
$g = $geo["wkt"];
switch ($operacao) {
case "perimetro":
$shape = ms_shapeObjFromWkt($g);
$rect = $shape->bounds;
$projInObj = ms_newprojectionobj("proj=longlat,ellps=WGS84,datum=WGS84,no_defs");
$projOutObj = ms_newprojectionobj("proj=poly,ellps=GRS67,lat_0=" . $rect->miny . ",lon_0=" . $rect->minx . ",x_0=5000000,y_0=10000000,units=m");
$shape->project($projInObj, $projOutObj);
$s = $shape->towkt();
$shape = ms_shapeObjFromWkt($s);
$area = $shape->getLength();
$geo["valores"][] = array("item" => "P_perim_metros", "valor" => $area);
break;
case "area":
$shape = ms_shapeObjFromWkt($g);
$rect = $shape->bounds;
$projInObj = ms_newprojectionobj("proj=longlat,ellps=WGS84,datum=WGS84,no_defs");
$projOutObj = ms_newprojectionobj("proj=laea,lat_0=" . $rect->miny . ",lon_0=" . $rect->minx . ",x_0=500000,y_0=10000000,ellps=GRS67,units=m,no_defs");
$shape->project($projInObj, $projOutObj);
$s = $shape->towkt();
$shape = ms_shapeObjFromWkt($s);
$area = $shape->getArea();
$geo["valores"][] = array("item" => "P_area_metros", "valor" => $area);
break;
case "comprimento":
break;
}
}
$this->serializeGeo($dir . $l, $geos);
}
return "ok";
}
示例5: mapfileCompleto
/**
* Complementa um mapfile resumido inserindo seus layers em um mapfile completo, contendo todos os elementos necessarios para uso
* Usado na geracao de WMS e outros servicos
* @param mapfile resumido
* @return nome do arquivo com o mapfile completo
*/
function mapfileCompleto($mapfile)
{
$f = $this->base;
if ($f == "") {
include_once $this->locaplic . "/classesphp/funcoes_gerais.php";
$versao = versao();
$versao = $versao["principal"];
$f = "";
if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) {
$f = $this->locaplic . "/aplicmap/geral1windowsv" . $versao . ".map";
} else {
if ($f == "" && file_exists('/var/www/i3geo/aplicmap/geral1debianv' . $versao . '.map')) {
$f = "/var/www/i3geo/aplicmap/geral1debianv" . $versao . ".map";
}
if ($f == "" && file_exists('/var/www/html/i3geo/aplicmap/geral1fedorav' . $versao . '.map')) {
$f = "/var/www/html/i3geo/aplicmap/geral1fedorav" . $versao . ".map";
}
if ($f == "" && file_exists('/opt/www/html/i3geo/aplicmap/geral1fedorav' . $versao . '.map')) {
$f = "/opt/www/html/i3geo/aplicmap/geral1v" . $versao . ".map";
}
if ($f == "") {
$f = $this->locaplic . "/aplicmap/geral1v" . $versao . ".map";
}
}
}
$mapa = ms_newMapObj($f);
$n = $mapa->numlayers;
for ($i = 0; $i < $n; $i++) {
$l = $mapa->getlayer($i);
$l->set("status", MS_DELETE);
}
$mapatemp = ms_newMapObj($mapfile);
$l = $mapatemp->getlayer(0);
$l->set("status", MS_DEFAULT);
$novonome = str_replace(".map", "completo.map", $mapfile);
//necessario para o kml
$mapa->setmetadata("ows_enable_request", "*");
$listaepsg = "EPSG:4618 EPSG:4291 EPSG:4326 EPSG:22521 EPSG:22522 EPSG:22523 EPSG:22524 EPSG:22525 EPSG:29101 EPSG:29119 EPSG:29120 EPSG:29121 EPSG:29122 EPSG:29177 EPSG:29178 EPSG:29179 EPSG:29180 EPSG:29181 EPSG:29182 EPSG:29183 EPSG:29184 EPSG:29185";
$l->setmetadata("ows_srs", $listaepsg);
$temp = ms_newLayerObj($mapa, $l);
$mapa->save($novonome);
return $novonome;
}
示例6: iniciaMapa
//.........这里部分代码省略.........
//o mapa precisa ser salvo para registrar a extensão geográfica
//
//$imgo = $m->mapa->draw();
$imgo = $m->mapa->prepareImage();
$m->salva($map_file);
//$e = $m->mapa->extent;
//$ext = ($e->minx)." ".($e->miny)." ".($e->maxx)." ".($e->maxy);
$escalaMapa = $m->mapa->scaledenom;
$celula = $m->mapa->cellsize;
//
//pega os parametros de cada tema
//
$qyfile = str_replace(".map", ".qy", $map_file);
$arqsel = file_exists($qyfile) ? true : false;
$m = new Mapa($map_file, $locaplic);
$temas = $m->parametrosTemas();
//$m->ligaDesligaTemas("",implode(",",$m->nomes),"nao");
//
//é necessário um mapa para compor o fundo apenas com o imagecolor e sem nenhuma outra camada
//utilizado em algumas interfaces
//
/*
$nomefundo = str_replace(".map","fundo.map",$map_file);
$m->mapa->save($nomefundo);
$mf = ms_newMapObj($nomefundo);
$numlayers = $mf->numlayers;
for($i = 0;$i < $numlayers;++$i)
{
$l = $mf->getLayer($i);
$l->set("status",MS_DELETE);
}
$of = $mf->outputformat;
$of->set("driver","GD/PNG");
$versao = versao();
$temp = $mf->scalebar;
$temp->set("status",MS_OFF);
$mf->save($nomefundo);
*/
$versao = versao();
$temp = $m->mapa->scalebar;
$temp->set("status", MS_OFF);
$of = $m->mapa->outputformat;
$of->set("imagemode", MS_IMAGEMODE_RGBA);
$of->setOption("QUANTIZE_FORCE", "OFF");
$of->set("driver", "AGG/PNG");
$m->mapa->setmetadata("interface", $interface);
$m->salva();
$nomes = nomeRandomico(12);
if ($imgo->imagepath == "") {
echo "Erro IMAGEPATH vazio";
exit;
}
$nomer = $imgo->imagepath . "mapa" . $nomes . ".png";
//$imgo->saveImage($nomer);
if (isset($utilizacgi) && strtolower($utilizacgi) == "sim") {
$nomer = $locmapserv . "?map=" . $map_file . "&mode=map";
} else {
$nomer = $imgo->imageurl . basename($nomer);
}
//pega a cor de fundo do mapa
$c = $m->mapa->imagecolor;
$cordefundo = $c->red . "," . $c->green . "," . $c->blue;
//pega o texto de copyright
$copyright = "";
$lc = $m->mapa->getlayerbyname("copyright");
if ($lc != "" && $lc->status == MS_DEFAULT) {
示例7: __construct
function __construct($map_file, $locaplic = "")
{
include dirname(__FILE__) . "/../ms_configura.php";
$this->postgis_mapa = $postgis_mapa;
if (!function_exists('ms_newMapObj')) {
return false;
}
if (file_exists($locaplic . "/funcoes_gerais.php")) {
include_once $locaplic . "/funcoes_gerais.php";
} else {
include_once "funcoes_gerais.php";
}
$this->v = versao();
$this->vi = $this->v["inteiro"];
$this->v = $this->v["principal"];
$this->qyfile = str_replace(".map", ".qy", $map_file);
$this->locaplic = $locaplic;
if (!file_exists($map_file)) {
return $this->arquivo = false;
}
if (!@ms_newMapObj($map_file)) {
return $this->mapa = false;
}
$this->mapa = @ms_newMapObj($map_file);
substituiConObj($this->mapa, $postgis_mapa);
$this->arquivo = str_replace(".map", "", $map_file) . ".map";
$c = $this->mapa->numlayers;
for ($i = 0; $i < $c; ++$i) {
$l = $this->mapa->getlayer($i);
$this->layers[] = $l;
$this->nomes[] = $l->name;
}
}
示例8: listaSimbolos
function listaSimbolos($tipo, $dir_tmp, $imgdir, $onclick, $tamanho = 8, $width = 1, $forca = false)
{
$versao = versao();
$versao = $versao["principal"];
error_reporting(0);
if ($tipo == 3) {
$tipo = 2;
}
//tipo raster
if ($imgdir == "") {
$dir = $dir_tmp;
} else {
$dir = $dir_tmp . "/" . $imgdir;
}
if ($forca == true) {
unlink($dir . "/simbolos" . $tipo . ".inc");
}
$ins = "";
//pega imagens que podem ser usadas como simbolos
if ($tipo == 0) {
if (!isset($locaplic)) {
include dirname(__FILE__) . "/../ms_configura.php";
}
//veja esse codigo tambem em ferramentas/uploadsimbolo/exec.php
$pasta = $locaplic . "/temas";
$url = "../temas";
if ($customDir != "interface") {
$teste = $locaplic . "/" . $customDir;
if (file_exists($teste)) {
$pasta = $teste;
$url = "../" . $customDir;
}
$teste = $locaplic . "/" . $customDir . "/images";
if (file_exists($teste)) {
$pasta = $teste;
$url = "../" . $customDir . "/images";
}
$teste = $locaplic . "/" . $customDir . "/imagens";
if (file_exists($teste)) {
$pasta = $teste;
$url = "../" . $customDir . "/imagens";
}
}
if (file_exists($pasta)) {
$lista = listaArquivos($pasta, true, array("png", "PNG"));
//var_dump($lista);exit;
$n = count($lista["nomes"]);
for ($i = 0; $i < $n; $i++) {
$ins .= "<img src='" . $url . "/" . $lista["nomes"][$i] . "' style='max-width: 80px;cursor:pointer;border: 5px solid #FFFFFF' title=" . $pasta . "/" . $lista["nomes"][$i] . " onclick='" . $onclick . "'>";
}
}
}
if (!file_exists($dir . "/simbolos" . $tipo . ".inc")) {
$f = fopen($dir . "/simbolos" . $tipo . ".inc", "w");
if ($tipo == 2) {
$t = "simpolv" . $versao . ".map";
}
if ($tipo == 0) {
$t = "simptv" . $versao . ".map";
}
if ($tipo == 1) {
$t = "simlinv" . $versao . ".map";
$tamanho = $tamanho / 4;
}
if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) {
$mapatemp = ms_newMapObj($this->localaplicacao . "\\aplicmap\\" . $t);
} else {
$mapatemp = ms_newMapObj($this->localaplicacao . "/aplicmap/" . $t);
}
$l = $mapatemp->getlayer(0);
if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) {
$novoss = dirname($this->mapa->symbolsetfilename) . "\\" . basename($mapatemp->symbolsetfilename);
} else {
$novoss = dirname($this->mapa->symbolsetfilename) . "/" . basename($mapatemp->symbolsetfilename);
}
$this->mapa->setsymbolset($novoss);
$ns = $this->mapa->getnumsymbols();
$inis = 0;
//na versao 7 nao tem o simbolo 0
if ($this->v >= 7) {
$inis = 1;
//se for versao 7 inclui um primeiro simbolo com valor 0 e imagem
$oSymbol = $this->mapa->getSymbolObjectById(1);
$adiciona = ms_newLayerObj($this->mapa, $l);
$nomel = $l->name;
$tematemp = $this->mapa->getlayerbyname($nomel);
$c = $tematemp->getClass(0);
$e = $c->getstyle(0);
$e->set("size", 1);
$e->set("width", 1);
$ico = $c->createLegendIcon(40, 40);
$nimg = $ico->saveWebImage();
$pat = $this->mapa->web->imageurl;
$ins .= "<img src='" . $nimg . "' style='cursor:pointer;border: 5px solid #FFFFFF' title='0' onclick='" . $onclick . "'>";
}
for ($i = $inis; $i < $ns; ++$i) {
$oSymbol = $this->mapa->getSymbolObjectById($i);
$nomes = $oSymbol->name;
if ($nomes == "") {
$nomes = $i;
//.........这里部分代码省略.........
示例9: getDataStore
function getDataStore($nomelayer, $colunasvalor, $colunanomeregiao, $titulo, $descricao, $ext = "", $mapType = "")
{
//$indicatorID, $year, $region){
if (!function_exists("versao")) {
include dirname(__FILE__) . "/../../classesphp/funcoes_gerais.php";
}
$versao = versao();
$versao = $versao["principal"];
$mapa = ms_newMapObj($this->map_file);
if ($ext == "") {
$mapa = extPadrao($mapa);
} else {
$e = str_replace(",", " ", $ext);
$e = explode(" ", $ext);
$extatual = $mapa->extent;
$extatual->setextent(min($e[0], $e[2]), min($e[1], $e[3]), max($e[0], $e[2]), max($e[1], $e[3]));
}
$layer = $mapa->getlayerbyname($nomelayer);
$layer->set("template", "none.html");
$existesel = "nao";
if ($this->postgis_mapa != "" && $this->postgis_mapa != " ") {
if ($layer->connectiontype == MS_POSTGIS) {
$lcon = $layer->connection;
if ($lcon == " " || $lcon == "" || in_array($lcon, array_keys($this->postgis_mapa))) {
if ($lcon == " " || $lcon == "") {
$layer->set("connection", $this->postgis_mapa);
} else {
$layer->set("connection", $this->postgis_mapa[$lcon]);
}
}
}
}
$itens = pegaItens($layer, $mapa);
carregaquery2($this->map_file, $layer, $mapa);
if ($layer->getNumresults() > 0) {
$existesel = "sim";
}
if ($existesel == "nao") {
$layer->querybyrect($mapa->extent);
}
$layer->open();
$res_count = $layer->getNumresults();
$dataStore = array();
$dataStore['indicators']['valores'] = array("name" => $titulo, "description" => $descricao, "source" => "", "decimals" => 2, "max" => 0, "min" => 0);
for ($i = 0; $i < $res_count; $i++) {
$valitem = array();
if ($versao >= 6) {
$shape = $layer->getShape($layer->getResult($i));
} else {
$shape = $layer->getFeature($layer->getResult($i)->shapeindex);
}
$pt = $shape->getCentroid();
$texto = $shape->values[$colunanomeregiao];
/*
if(!mb_detect_encoding($texto,"ISO-8859-1",true)){
$texto = mb_convert_encoding($texto,"ISO-8859-1","UTF-8");
}
*/
if ($mapType == "bar") {
$wkt = "";
} else {
$wkt = $shape->toWkt();
}
$dataStore['features'][$i] = array("featureID" => $i, "name" => $texto, "lon" => round($pt->x, 6), "lat" => round($pt->y, 6), "wkt" => $wkt);
//[0] � o ano
foreach ($colunasvalor as $colunavalor) {
$valor = $shape->values[$colunavalor];
settype($valor, "float");
//echo $valor;
if (is_numeric($valor)) {
$valor = number_format($valor, 2, '.', '');
$dataStore['indicators']['valores']['values'][$colunavalor][$i] = $valor;
$indicatorYears[$colunavalor] = $colunavalor;
$todosV[] = $valor;
}
}
}
$fechou = $layer->close();
$dataStore['indicators']['valores']['years'] = $indicatorYears;
$dataStore['indicators']['valores']['max'] = max($todosV);
$dataStore['indicators']['valores']['min'] = min($todosV);
//echo "<pre>";
//var_dump($dataStore);
return $dataStore;
/*
$sqlregion = '';
if ($region) $sqlregion = "region = $region AND";
$sqlyear = '';
if ($year) $sqlyear = "AND year = $year";
// Add features - exclude Antarctica
$sql = "SELECT un AS featureID, name, lon, lat, AsText(geom) AS wkt
FROM $this->featureTable
WHERE $sqlregion un != 10
ORDER BY featureID";
$features = $this->dbc->query($sql);
while($row = $features->fetch_array(MYSQLI_ASSOC))
{
// First field should be feature id
$featureID = array_shift($row);
//.........这里部分代码省略.........
示例10: __construct
function __construct($map_file = "", $tema = "", $locaplic = "", $ext = "")
{
if (!function_exists('ms_newMapObj')) {
return false;
}
if ($locaplic == "") {
include dirname(__FILE__) . "/../ms_configura.php";
}
if (!function_exists("corRGB")) {
include_once dirname(__FILE__) . "/funcoes_gerais.php";
}
include dirname(__FILE__) . "/../ms_configura.php";
$this->postgis_mapa = $postgis_mapa;
$this->v = versao();
$this->v = $this->v["principal"];
$this->dbaseExiste = false;
if (function_exists("dbase_create")) {
$this->dbaseExiste = true;
}
$this->locaplic = $locaplic;
if ($map_file != "") {
$this->mapa = ms_newMapObj($map_file);
substituiConObj($this->mapa, $postgis_mapa);
$this->arquivo = str_replace(".map", "", $map_file) . ".map";
$this->tema = $tema;
if ($tema != "" && @$this->mapa->getlayerbyname($tema)) {
$this->layer = $this->mapa->getlayerbyname($tema);
}
$this->nome = $tema;
if ($ext && $ext != "") {
$e = explode(" ", $ext);
$extatual = $this->mapa->extent;
$extatual->setextent(min($e[0], $e[2]), min($e[1], $e[3]), max($e[0], $e[2]), max($e[1], $e[3]));
}
} else {
$this->mapa = "";
$this->arquivo = $dir_tmp . "/" . nomeRandomico();
}
}
示例11: calculaarea
function calculaarea($geo)
{
global $postgis_con;
$v = versao();
if ($v["principal"] < 5 && $postgis_con == "") {
return "erro. É necessária uma versão maior que 5.0 do Mapserver.";
}
$g = $geo->towkt();
$shape = ms_shapeObjFromWkt($g);
$rect = $shape->bounds;
$projInObj = ms_newprojectionobj("proj=longlat,ellps=WGS84,datum=WGS84,no_defs");
$projOutObj = ms_newprojectionobj("proj=laea,lat_0=" . $rect->miny . ",lon_0=" . $rect->minx . ",x_0=500000,y_0=10000000,ellps=GRS67,units=m,no_defs");
$shape->project($projInObj, $projOutObj);
$s = $shape->towkt();
$shape = ms_shapeObjFromWkt($s);
$area = $shape->getArea();
return $area / 10000;
}
示例12: pegaValoresM
function pegaValoresM($mapa, $layer, $itens, $exclui = "nulo", $selecionados = "nao", $chaves = false, $centroide = false)
{
$versao = versao();
$versao = $versao["principal"];
$prjMapa = $mapa->getProjection();
$prjTema = $layer->getProjection();
$layer->set("template", "none.htm");
$layer->setfilter("");
$indicesel = array();
//pega os valores dos indices dos elementos selecionados para comparacao posterior
if ($selecionados == "sim") {
$sopen = $layer->open();
if ($sopen == MS_FAILURE) {
return "erro";
}
$res_count = $layer->getNumresults();
for ($i = 0; $i < $res_count; ++$i) {
$result = $layer->getResult($i);
$indicesel[] = $result->shapeindex;
}
$layer->close();
}
$valores = array();
$nclasses = $layer->numclasses;
if (@$layer->queryByrect($mapa->extent) == MS_SUCCESS) {
//$layer->draw();
$sopen = $layer->open();
if ($sopen == MS_FAILURE) {
return "erro";
}
$res_count = $layer->getNumresults();
//echo $res_count;echo "\n";
for ($i = 0; $i < $res_count; ++$i) {
if ($versao >= 6) {
$shape = $layer->getShape($layer->getResult($i));
$shp_index = $shape->index;
} else {
$result = $layer->getResult($i);
$shp_index = $result->shapeindex;
$shape = $layer->getfeature($shp_index, -1);
}
if ($selecionados == "sim" && array_search($shp_index, $indicesel) === FALSE) {
continue;
}
$considera = "sim";
//verifica se no registro deve ser considerado
if ($exclui != "nulo") {
foreach ($itens as $item) {
if ($shape->values[$item] == $exclui) {
$considera = "nao";
}
}
}
//pega os valores
$v = array();
if ($considera == "sim") {
//pega os valores dos itens do registro
foreach ($itens as $item) {
$vitem = $shape->values[$item];
if (!mb_detect_encoding($vitem, "UTF-8", true)) {
$vitem = mb_convert_encoding($vitem, "UTF-8", "ISO-8859-1");
}
if ($chaves == false) {
$v[] = $vitem;
} else {
$v[$item] = $vitem;
}
}
//pega o centroide
//echo $i;echo "\n";
if ($centroide == true) {
$c = $shape->getCentroid();
if ($prjTema != "" && $prjMapa != $prjTema) {
$projOutObj = ms_newprojectionobj($prjTema);
$projInObj = ms_newprojectionobj($prjMapa);
$c->project($projInObj, $projOutObj);
}
$v["centroide"] = "POINT(" . $c->x . " " . $c->y . ")";
}
//echo $i;echo "---\n";
//pega a cor da classe onde cai o registro
if ($nclasses > 0 && $versao >= 6) {
$cx = $layer->getClassIndex($shape);
if ($cx > -1) {
$classe = $layer->getclass($cx);
$cor = $classe->getstyle(0)->color;
$v["cores"] = $cor->red . " " . $cor->green . " " . $cor->blue;
}
}
if (count($v) == 1) {
$valores[] = $v[0];
} else {
$valores[] = $v;
}
}
}
$layer->close();
}
return $valores;
}
示例13: __construct
function __construct($map_file = "", $tema = "", $locaplic = "", $ext = "")
{
include dirname(__FILE__) . "/../ms_configura.php";
$this->postgis_mapa = $postgis_mapa;
if (!function_exists('ms_newMapObj')) {
return false;
}
if (file_exists($locaplic . "/funcoes_gerais.php")) {
include_once $locaplic . "/funcoes_gerais.php";
} else {
include_once "funcoes_gerais.php";
}
$this->v = versao();
$this->v = $this->v["principal"];
if ($map_file != "") {
$this->locaplic = $locaplic;
if (is_string($map_file)) {
$this->mapa = ms_newMapObj($map_file);
$this->arquivo = str_replace(".map", "", $map_file) . ".map";
$this->qyfile = str_replace(".map", ".qy", $map_file);
} else {
$this->mapa = $map_file;
$this->arquivo = "";
}
substituiConObj($this->mapa, $postgis_mapa);
if ($tema != "" && @$this->mapa->getlayerbyname($tema)) {
$this->layer = $this->mapa->getlayerbyname($tema);
$this->nome = $tema;
}
if ($ext && $ext != "") {
$e = explode(" ", $ext);
$extatual = $this->mapa->extent;
$extatual->setextent(min($e[0], $e[2]), min($e[1], $e[3]), max($e[0], $e[2]), max($e[1], $e[3]));
}
if ($this->mapa->getmetadata("interface") == "googlemaps") {
$this->projO = $this->mapa->getProjection();
$this->mapa->setProjection(pegaProjecaoDefault("proj4"));
}
}
}
示例14: dirname
require dirname(__FILE__) . "/../../classesphp/funcoes_gerais.php";
error_reporting(0);
$nomes = nomeRandomico();
$map = ms_newMapObj($map_file);
$temp = str_replace(".map", "xxx.map", $map_file);
$map->save($temp);
substituiCon($temp, $postgis_mapa);
$map = ms_newMapObj($temp);
if ($map->getmetadata("interface") == "googlemaps") {
$proj4 = pegaProjecaoDefault("proj4");
$map->setProjection($proj4);
$map->set("units", MS_METERS);
$map->preparequery();
$map->set("scaledenom", $map->scaledenom * 100000);
}
$v = versao();
$leb = $eb->label;
if ($leb->type == "MS_BITMAP") {
$leb->set("type", MS_TRUETYPE);
$leb->set("font", "Arial");
}
//altera o nome das classes vazias
$numlayers = $map->numlayers;
for ($i = 0; $i < $numlayers; $i++) {
$layer = $map->getlayer($i);
if ($layer->data != "" && strtolower($layer->getmetadata("escondido")) != "sim" && strtolower($layer->getmetadata("tema")) != "sim") {
if ($layer->numclasses > 0) {
$classe = $layer->getclass(0);
if ($classe->name == "" || $classe->name == " ") {
$classe->set("name", $layer->getmetadata("tema"));
}
示例15: mapfilebase
function mapfilebase($base, $locaplic)
{
$versao = versao();
$versao = $versao["principal"];
if (isset($base) && $base != "") {
if (file_exists($base)) {
$f = $base;
} else {
$f = $locaplic . "/aplicmap/" . $base . ".map";
}
} else {
$f = "";
if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) {
$f = $locaplic . "/aplicmap/geral1windowsv" . $versao . ".map";
} else {
if ($f == "" && file_exists('/var/www/i3geo/aplicmap/geral1debianv' . $versao . '.map')) {
$f = "/var/www/i3geo/aplicmap/geral1debianv" . $versao . ".map";
}
if ($f == "" && file_exists('/var/www/html/i3geo/aplicmap/geral1fedorav' . $versao . '.map')) {
$f = "/var/www/html/i3geo/aplicmap/geral1fedorav" . $versao . ".map";
}
if ($f == "" && file_exists('/opt/www/html/i3geo/aplicmap/geral1fedorav' . $versao . '.map')) {
$f = "/opt/www/html/i3geo/aplicmap/geral1v" . $versao . ".map";
}
if ($f == "") {
$f = $locaplic . "/aplicmap/geral1v" . $versao . ".map";
}
}
}
return $f;
}