[OpenMap Users] check if a point is inside the terrain

From: Pierluca Sangiorgi <pierluca.sangiorgi_at_email.domain.hidden>
Date: Sun Sep 26 2010 - 10:41:30 EDT

Hi, i need to determine if a point(lat/long) is inside the terrain or
not (in the sea).
I used the "vmap_area.shp" file as map file and reading the API doc i
think i must do something like this:

       Point2D pointToCheck = new Point2D.Double(0,0);
       try {
           ShpInputStream shpStream = new ShpInputStream(
                   new FileInputStream("data/shape/vmap_area.shp"));
           EsriGraphicList list = shpStream.getGeometry();
           Iterator i = list.iterator();
           while (i.hasNext()) {
               EsriPolygon p = (EsriPolygon) i.next();
               GeneralPath path = p.getShape();
               path.contains(pointToCheck);
           }
       } catch (Exception e) {
           System.out.println(e.getMessage());
       }

but it doesn't work.
Could anyone help me?

Thanks in advance and best regards
Luca

--
[To unsubscribe to this list send an email to "majdart@bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Sun Sep 26 10:50:24 2010

This archive was generated by hypermail 2.1.8 : Sun Sep 26 2010 - 10:50:25 EDT