Line | |
---|
1 | /*
|
---|
2 | * GeoTools - The Open Source Java GIS Toolkit
|
---|
3 | * http://geotools.org
|
---|
4 | *
|
---|
5 | * (C) 2005-2008, Open Source Geospatial Foundation (OSGeo)
|
---|
6 | *
|
---|
7 | * This library is free software; you can redistribute it and/or
|
---|
8 | * modify it under the terms of the GNU Lesser General Public
|
---|
9 | * License as published by the Free Software Foundation;
|
---|
10 | * version 2.1 of the License.
|
---|
11 | *
|
---|
12 | * This library is distributed in the hope that it will be useful,
|
---|
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
15 | * Lesser General Public License for more details.
|
---|
16 | */
|
---|
17 | package org.geotools.feature.visitor;
|
---|
18 |
|
---|
19 | import org.geotools.geometry.jts.ReferencedEnvelope;
|
---|
20 |
|
---|
21 |
|
---|
22 | /**
|
---|
23 | * Calculates the extents (envelope) of the features it visits.
|
---|
24 | *
|
---|
25 | * @author Cory Horner, Refractions
|
---|
26 | *
|
---|
27 | * @since 2.2.M2
|
---|
28 | *
|
---|
29 | * @source $URL: http://svn.osgeo.org/geotools/branches/2.7.x/modules/library/main/src/main/java/org/geotools/feature/visitor/BoundsVisitor.java $
|
---|
30 | */
|
---|
31 | public class BoundsVisitor implements FeatureCalc {
|
---|
32 | ReferencedEnvelope bounds = new ReferencedEnvelope();
|
---|
33 |
|
---|
34 | public void visit(org.opengis.feature.Feature feature) {
|
---|
35 | bounds.include( feature.getBounds() );
|
---|
36 | }
|
---|
37 |
|
---|
38 | public ReferencedEnvelope getBounds() {
|
---|
39 | return bounds;
|
---|
40 | }
|
---|
41 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.