Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project!

## geotools-gt2-users

 [Geotools-gt2-users] Envelope Question From: OMAR BEN KIRANE - 2005-02-15 21:53:39 ```Hi all, =20 i have a problem concerning the mapping of a position (P(x,y)) into the corresponding segment in the the shapefile (Map = matching) =20 i tried to use the function getbounds() in the class envelope but it = does not give an exact result, it return many segments at a time = corresponding to the position. =20 =20 This the code that i used: =20 GeometryFactory geomFac =3D new GeometryFactory(); Point point2 =3D geomFac.createPoint(new Coordinate(P)); Feature feature2 =3D pointType.create(new Object[] {point2}); =20 =20 FeatureSource fs =3D = this.frame.mapPane.getMapContext().getLayer(0).getFeatureSource(); FeatureResults fr =3D fs.getFeatures(); FeatureCollection fc1 =3D fr.collection(); FeatureIterator f =3D fc1.features(); =20 =20 while(f.hasNext()) { Feature ft =3D f.next(); if (ft.getBounds().contains(P)) { System.out.println(ft.getID()); } } =20 ```
 [Geotools-gt2-users] Envelope Question From: Myriam Benkirane - 2005-02-16 19:26:08 Attachments: Message as HTML ```Hi all, i have a problem concerning the mapping of a position or a Point (P(x,y)) into the corresponding segment in the the shapefile (Map = matching) i tried to use the function getbounds() in the class envelope but it = does not give an exact result, it return many segments at a time = corresponding to the position. This the code that i used: GeometryFactory geomFac =3D new GeometryFactory(); Point point2 =3D geomFac.createPoint(new Coordinate(P)); Feature feature2 =3D pointType.create(new Object[] {point2}); =20 FeatureSource fs =3D = this.frame.mapPane.getMapContext().getLayer(0).getFeatureSource(); FeatureResults fr =3D fs.getFeatures(); FeatureCollection fc1 =3D fr.collection(); FeatureIterator f =3D fc1.features(); =20 while(f.hasNext()) { Feature ft =3D f.next(); =20 // P is the coordinate of the point or the position and ft is a = feature (segment) in the shapefile if (ft.getBounds().contains(P)) { =20 System.out.println(ft.getID()); } } ```
 [Geotools-gt2-users] Envelope Question From: Myriam Benkirane - 2005-02-16 19:05:54 Attachments: Message as HTML ```Hi all, i have a problem concerning the mapping of a position (P(x,y)) into the corresponding segment in the the shapefile (Map = matching) i tried to use the function getbounds() in the class envelope but it = does not give an exact result, it return many segments at a time = corresponding to the position. This the code that i used: GeometryFactory geomFac =3D new GeometryFactory(); Point point2 =3D geomFac.createPoint(new Coordinate(P)); Feature feature2 =3D pointType.create(new Object[] {point2}); =20 FeatureSource fs =3D = this.frame.mapPane.getMapContext().getLayer(0).getFeatureSource(); FeatureResults fr =3D fs.getFeatures(); FeatureCollection fc1 =3D fr.collection(); FeatureIterator f =3D fc1.features(); =20 while(f.hasNext()) { Feature ft =3D f.next(); if (ft.getBounds().contains(P)) { System.out.println(ft.getID()); } } ```