[ka-Map-users] Zoom To Layer
Paul Spencer
pspencer at dmsolutions.ca
Wed Sep 13 03:36:31 EDT 2006
One thing we could do is add metadata to each layer in a mapfile that
would define the extent of the layer. Perhaps using the max_extents
metadata on each layer?
If the $oLayer->getExtent() actually works, then we could do this in
init.php when we are reading each map file anyway, although I expect
this would seriously slow down initialization in some cases.
Using either mechanism, the layer extents could then be passed to
kaMap in the init.php output. The layer extents would be stored in
each of the _layer objects and then it would be trivial to have a
zoom to layer function in the legend or via some custom scripting.
Patches to implement this would be appreciated :)
Cheers
Paul
On 12-Sep-06, at 1:41 PM, Wagner, Jeffrey S. ((DMS/CISD)) wrote:
> I used MapScript to get the extent: $rect = $oLayer->getExtent();
> I don't think there is a setExtent function....
>
> -----Original Message-----
> From: ka-map-users-bounces at lists.maptools.org
> [mailto:ka-map-users-bounces at lists.maptools.org] On Behalf Of Ryan
> Ollerenshaw
> Sent: Tuesday, September 12, 2006 7:57 AM
> To: Lucian Bancescu
> Cc: ka-map-users at lists.maptools.org
> Subject: Re: [ka-Map-users] Zoom To Layer
>
> Lucian Bancescu wrote:
>> A pretty straightforward way to obtain the extent of a layer is using
>> ogrinfo, which comes with gdal-ogr tool.
>> A possible usage:
>> /
>> ogrinfo /path/to/shapefiles layername | grep Extent
>> /
>
> Can you provide the MapScript to add to a layer so each layer has
> it own
>
> extent?
> _______________________________________________
> ka-Map-users mailing list
> ka-Map-users at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/ka-map-users
>
> _______________________________________________
> ka-Map-users mailing list
> ka-Map-users at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/ka-map-users
+-----------------------------------------------------------------+
|Paul Spencer pspencer at dmsolutions.ca |
+-----------------------------------------------------------------+
|Applications & Software Development |
|DM Solutions Group Inc http://www.dmsolutions.ca/|
+-----------------------------------------------------------------+
More information about the ka-Map-users
mailing list