Yes, you are right.  The getCoordinate() only works when looping through a
single feature's points.

Larry

On Wed, Jun 24, 2009 at 12:12 PM, Sunburned Surveyor <
sunburned.surve...@gmail.com> wrote:

> Thanks for the responses Larry and Michael. I have attached a text
> file with my modified method. (Note: There are other changes to my
> method that I would not include in the patch.) I believe that the use
> of getCoordinate method should be replaced with the
> getEnvelopeInternal method.
>
> But I could be wrong.
>
> SS
>
> On Wed, Jun 24, 2009 at 6:22 AM, Larry Becker<becker.la...@gmail.com>
> wrote:
> > Hi SS,
> >
> > If you are talking about this code, it looks like it works to me:
> >
> >     public static Envelope getEnvelopeForFeatures(Feature[] features){
> >         Envelope env = null;
> >         Feature feat;
> >
> >         for (int i=0; i<features.length; i++){
> >             feat = features[i];
> >             if (env==null){
> >                 env = new Envelope(feat.getGeometry().getCoordinate());
> >             } else {
> >                 env.expandToInclude(feat.getGeometry().getCoordinate());
> >             }
> >         }
> >
> >         return env;
> >     }
> >
> > regards,
> > Larry
> >
> > 2009/6/24 Michaël Michaud <michael.mich...@free.fr>
> >>
> >> Hi,
> >> > I believe there may be a bug in the getEnvelopeForFeatures method of
> >> > the FeatureCollectionTools class. It uses the Geometry.getCoordinate
> >> > method when it should use the Geometry.getEnvelopeInternal method.
> >> > This may result in the calculation of an envolope that does not
> >> > include the envelope of all features.
> >> >
> >> I think you're right. Using getCoordinate to compute an envelope is not
> >> correct.
> >> Feel free to fix it. You've got a correct implementation in
> >> com.vividsolutions.jump.feature.FeatureDataset.getEnvelope().
> >>
> >> Michaël
> >> > When I get my modified version of the getEnvelopeForFeature method
> >> > tested I will submit a patch.
> >> >
> >> > SS
> >> >
> >> >
> >> >
> ------------------------------------------------------------------------------
> >> > _______________________________________________
> >> > Jump-pilot-devel mailing list
> >> > Jump-pilot-devel@lists.sourceforge.net
> >> > https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
> >> >
> >> >
> >> >
> >>
> >>
> >>
> >>
> ------------------------------------------------------------------------------
> >> _______________________________________________
> >> Jump-pilot-devel mailing list
> >> Jump-pilot-devel@lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
> >
> >
> >
> > --
> > Larry Becker
> > Integrated Systems Analysts, Inc.
> >
> >
> ------------------------------------------------------------------------------
> >
> > _______________________________________________
> > Jump-pilot-devel mailing list
> > Jump-pilot-devel@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
> >
> >
>
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> Jump-pilot-devel mailing list
> Jump-pilot-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
>
>


-- 
Larry Becker
Integrated Systems Analysts, Inc.
------------------------------------------------------------------------------
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to