[maplab-users] Query Object

Adriano Hantequeste Gomes adrianohg at gmail.com
Mon Jan 29 12:51:24 EST 2007


Hi All,

I modified the code and I arrived below at this stage, when I consult
a District (quarter) - "Bairro" that is seen in view of the map, does
not happen nothing, only one "refresh" in the navigator (to browser),
but when I consult a quarter it are of view of the map happens this
error:

Warning: [MapServer Error]: msQueryByAttributes(): No matching
record(s) found. in
D:\ms4w\apps\maplab-2.2.1\projects\gmf_apps\Geo\Geo.php on line 826

Warning: [MapServer Error]: msFreeHashItems(): Can't free NULL table
in D:\ms4w\apps\maplab-2.2.1\projects\gmf_apps\Geo\Geo.php on line 826

Warning: [MapServer Error]: msFreeHashItems(): Can't free NULL table
in D:\ms4w\apps\maplab-2.2.1\projects\gmf_apps\Geo\Geo.php on line 826

Warning: [MapServer Error]: msInsertHashTable: Invalid hash table or
key in D:\ms4w\apps\maplab-2.2.1\projects\gmf_apps\Geo\Geo.php on line
826

Warning: [MapServer Error]: msInsertHashTable: Invalid hash table or
key in D:\ms4w\apps\maplab-2.2.1\projects\gmf_apps\Geo\Geo.php on line
826

Warning: [MapServer Error]: msInsertHashTable: Invalid hash table or
key in D:\ms4w\apps\maplab-2.2.1\projects\gmf_apps\Geo\Geo.php on line
826

Warning: [MapServer Error]: msInsertHashTable: Invalid hash table or
key in D:\ms4w\apps\maplab-2.2.1\projects\gmf_apps\Geo\Geo.php on line
826

Warning: [MapServer Error]: msInsertHashTable: Invalid hash table or
key in D:\ms4w\apps\maplab-2.2.1\projects\gmf_apps\Geo\Geo.php on line
826

Warning: [MapServer Error]: msInsertHashTable: Invalid hash table or
key in D:\ms4w\apps\maplab-2.2.1\projects\gmf_apps\Geo\Geo.php on line
826

Warning: Division by zero in
D:\ms4w\apps\maplab-2.2.1\projects\gmf_apps\Geo\Geo.php on line 850

Warning: Division by zero in
D:\ms4w\apps\maplab-2.2.1\projects\gmf_apps\Geo\Geo.php on line 851

Warning: Division by zero in
D:\ms4w\apps\maplab-2.2.1\projects\gmf_apps\Geo\Geo.php on line 852

Warning: Division by zero in
D:\ms4w\apps\maplab-2.2.1\projects\gmf_apps\Geo\Geo.php on line 853

Fatal error: [MapServer Error]: msCalculateScale(): Invalid image
extent, minx=362893.561644, miny=7755955.097581, maxx=362893.561644,
maxy=7755955.097581. in
D:\ms4w\apps\maplab-2.2.1\projects\gmf_apps\Geo\wrapper\map_navigator.php
on line 341


Code Change


// Adriano Hantequeste Gomes - 19/jan/07
//
// Consulta Objeto
//
//
if ($http_form_vars["texto"]) {

  $p_texto = strtoupper($_GET[texto]);
  //$p_tipo  = $_GET[tipo];

  $nome_bairro = $p_texto;
  $capa = $oMapSession->oMap->getLayerByname("Bairros");
  $capa->queryByAttributes("NOME_BAIRR",$nome_bairro,MS_SINGLE);
  $oextent = $oMapSession->oMap->extent;

  if ($capa->getNumResults() > 0) {

        $oresult = $capa->getResult(0);
        $capa->open();
        $oshape = $capa->getShape($oresult->tileindex,$oresult->shapeindex);
    $oExtents = $oMapSession->oMap->extent;
    $oldExtents=$oExtents;
        $oshape->free();
        //Zoom
        $nXBuffer = ( $oExtents->maxx - $oExtents->minx )*0.05;
        $nYBuffer = ( $oExtents->maxy - $oExtents->miny )*0.05;
        $nMinX = $oExtents->minx - $nXBuffer;
        $nMaxX = $oExtents->maxx + $nXBuffer;
        $nMinY = $oExtents->miny - $nYBuffer;
        $nMaxY = $oExtents->maxy + $nYBuffer;
        $oExtents->setextent( $nMinX, $nMinY, $nMaxX, $nMaxY );

  }

  $breite=$oMapSession->oMap->width;
  $hoehe=$oMapSession->oMap->height;
  $px1=$breite/($oldExtents->maxx-$oldExtents->minx)*($oExtents->minx-$oldExtents->minx);
  $px2=$breite/($oldExtents->maxx-$oldExtents->minx)*($oExtents->maxx-$oldExtents->minx);
  $py1=$hoehe/($oldExtents->maxy-$oldExtents->miny)*($oldExtents->maxy-$oExtents->maxy);
  $py2=$hoehe/($oldExtents->maxy-$oldExtents->miny)*($oldExtents->maxy-$oExtents->miny);
  $oMapNavigator->zoomRectangle($px1, $py2, $px2, $py1);
}

--
Atenciosamente,
Adriano Hantequeste Gomes
CREA 080047648-4
Departamento de Geoprocessamento - GEO
Gerência de Estatística e Analise Criminal - GEAC
Secretaria de Estado da Segurança Pública e Defesa Social - SESP
Av. Marechal Mascarenhas de Moraes, 2355
Bento Ferreira - Vitória - Espírito Santo
CEP: 29.052-121
Telefone: 55 27 3334-4736
Fax:       55 27 3334-4735
Celular:   55 27 9225-4852



More information about the Maplab-users mailing list