[Chameleon] getShape w/ OGR and MapInfo Tabs

Stephan Holl holl at gdf-hannover.de
Tue May 10 04:31:23 EDT 2005


Hello Stephan, 

On Sat, 23 Apr 2005 21:41:16 +0200 Stephan Holl <sholl at gmx.net> wrote:

> dear list,
> 
> I have a problem getting shape-information with getShape() from
> Mapinfo- Tabs generated with ogr2ogr from a shapefile.
> 
> it does not retrieve any bounds for the object:
> $oLayer->open();
> $oShape = $oLayer->getShape($nTile, 0 );
>                 $aszAttributes['name'] = $oLayer->name;
>                 $aszAttributes['index'] = $oLayer->index;
>                 $oRect = $oShape->bounds;
>                 $aszAttributes['minx'] = $oRect->minx;
>                 $aszAttributes['miny'] = $oRect->miny;
>                 $aszAttributes['maxx'] = $oRect->maxx;
>                 $aszAttributes['maxy'] = $oRect->maxy;
> 
> $oRect is alway empty when I try this on TAB-Files connected through
> OGR.
> 
> My Mapfile-Snippet.
> TYPE POLYGON
>   STATUS ON
>   CONNECTIONTYPE OGR #
>   CONNECTION "/data/lka/seen_tab/seen.tab" 
> CLASS
>     NAME "Binnenseen"
> ...
> 
> I couldn`t find similar problems at goole.
> Does anybodyy can give me a hint?!
$oShape = $oLayer->getShape($nTile, 0 );
+                $oShape = $oLayer->getShape($nTile, 1 );
for the record.
Frank W. pointed me to the right direction.

In order to use the Label-widget to label OCG and local layers on the
fly it is needed to change this to make mapinfo-tab-files working.
Change from
	$oShape = $oLayer->getShape($nTile, 0 );
to
	$oShape = $oLayer->getShape($nTile, 1 );
in LayerAttributes.php:178

Cheers
	Stephan

PS: just a dirty hack...


+                $oShape = $oLayer->getShape($nTile, 1 );

-- 
GDF Hannover - Solutions for spatial data analysis and remote sensing
Hannover Office (TCH) -  Vahrenwalder Straße 7   -   D-30165 Hannover
Internet: www.gdf-hannover.de      -      Email: holl at gdf-hannover.de
Phone : ++49-(0)511-9357560       -          Fax: ++49-(0)511-9357100


More information about the Chameleon mailing list