test_class.declarator: OFFSET_X = 11000000
test_class.modifier: static final
test_class.original_string: static final int OFFSET_X = 11000000;
test_class.type: int
test_class.var_name: OFFSET_X
test_class.declarator: OFFSET_Y = 50000000
test_class.modifier: static final
test_class.original_string: static final int OFFSET_Y = 50000000;
test_class.type: int
test_class.var_name: OFFSET_Y
test_class.declarator: polygon
test_class.modifier: static
test_class.original_string: static OsmNogoPolygon polygon;
test_class.type: OsmNogoPolygon
test_class.var_name: polygon
test_class.declarator: polyline
test_class.modifier: static
test_class.original_string: static OsmNogoPolygon polyline;
test_class.type: OsmNogoPolygon
test_class.var_name: polyline
test_class.declarator: lons = {  1.0,  1.0,  0.5, 0.5, 1.0, 1.0, -1.1, -1.0 }
test_class.modifier: static final
test_class.original_string: static final double[] lons = {  1.0,  1.0,  0.5, 0.5, 1.0, 1.0, -1.1, -1.0 };
test_class.type: double[]
test_class.var_name: lons
test_class.declarator: lats = { -1.0, -0.1, -0.1, 0.1, 0.1, 1.0,  1.1, -1.0 }
test_class.modifier: static final
test_class.original_string: static final double[] lats = { -1.0, -0.1, -0.1, 0.1, 0.1, 1.0,  1.1, -1.0 };
test_class.type: double[]
test_class.var_name: lats
test_class.file: brouter-core/src/test/java/btools/router/OsmNogoPolygonTest.java
test_class.identifier: OsmNogoPolygonTest
test_case.body: @Test
    public void testIntersectsPolygon() {
      double[] p0lons  = {   0.0,   1.0,  -0.5,  0.5,  0.7,  0.7,  0.7,  -1.5, -1.5,  0.0 };
      double[] p0lats  = {   0.0,   0.0,   0.5,  0.5,  0.5,  0.05, 0.05, -1.5,  0.2,  0.0 };
      double[] p1lons  = {   0.0,   1.0,   0.5,  1.0,  0.7,  0.7,  0.7,  -0.5, -0.2,  0.5 };
      double[] p1lats  = {   0.0,   0.0,   0.5,  0.5, -0.5, -0.5, -0.05, -0.5,  1.5, -1.5 };
      boolean[] within = { false, false, false, true, true, true, false, true, true, true };
  
      for (int i=0; i<p0lons.length; i++) {
        assertEquals("("+p0lons[i]+","+p0lats[i]+")-("+p1lons[i]+","+p1lats[i]+")",within[i],polygon.intersects(toOsmLon(p0lons[i], OFFSET_X), toOsmLat(p0lats[i], OFFSET_Y), toOsmLon(p1lons[i], OFFSET_X), toOsmLat(p1lats[i], OFFSET_Y)));
      }
    }
test_case.class_method_signature: OsmNogoPolygonTest.testIntersectsPolygon()
test_case.full_signature: @Test public void testIntersectsPolygon()
test_case.identifier: testIntersectsPolygon
test_case.invocations: assertEquals intersects toOsmLon toOsmLat toOsmLon toOsmLat
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testIntersectsPolygon()
focal_class.declarator: points = new ArrayList<Point>()
focal_class.modifier: public final
focal_class.original_string: public final List<Point> points = new ArrayList<Point>();
focal_class.type: List<Point>
focal_class.var_name: points
focal_class.declarator: isClosed
focal_class.modifier: public final
focal_class.original_string: public final boolean isClosed;
focal_class.type: boolean
focal_class.var_name: isClosed
focal_class.file: brouter-core/src/main/java/btools/router/OsmNogoPolygon.java
focal_class.identifier: OsmNogoPolygon
focal_class.class_method_signature: OsmNogoPolygon.OsmNogoPolygon(boolean closed)
focal_class.full_signature: public  OsmNogoPolygon(boolean closed)
focal_class.identifier: OsmNogoPolygon
focal_class.modifiers: public
focal_class.parameters: (boolean closed)
focal_class.signature:  OsmNogoPolygon(boolean closed)
focal_class.class_method_signature: OsmNogoPolygon.addVertex(int lon, int lat)
focal_class.full_signature: public final void addVertex(int lon, int lat)
focal_class.identifier: addVertex
focal_class.modifiers: public final
focal_class.parameters: (int lon, int lat)
focal_class.return: void
focal_class.signature: void addVertex(int lon, int lat)
focal_class.class_method_signature: OsmNogoPolygon.calcBoundingCircle()
focal_class.full_signature: public void calcBoundingCircle()
focal_class.identifier: calcBoundingCircle
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void calcBoundingCircle()
focal_class.class_method_signature: OsmNogoPolygon.intersects(int lon0, int lat0, int lon1, int lat1)
focal_class.full_signature: public boolean intersects(int lon0, int lat0, int lon1, int lat1)
focal_class.identifier: intersects
focal_class.modifiers: public
focal_class.parameters: (int lon0, int lat0, int lon1, int lat1)
focal_class.return: boolean
focal_class.signature: boolean intersects(int lon0, int lat0, int lon1, int lat1)
focal_class.class_method_signature: OsmNogoPolygon.isOnPolyline( long px, long py )
focal_class.full_signature: public boolean isOnPolyline( long px, long py )
focal_class.identifier: isOnPolyline
focal_class.modifiers: public
focal_class.parameters: ( long px, long py )
focal_class.return: boolean
focal_class.signature: boolean isOnPolyline( long px, long py )
focal_class.class_method_signature: OsmNogoPolygon.isOnLine( long px, long py, long p0x, long p0y, long p1x, long p1y )
focal_class.full_signature: public static boolean isOnLine( long px, long py, long p0x, long p0y, long p1x, long p1y )
focal_class.identifier: isOnLine
focal_class.modifiers: public static
focal_class.parameters: ( long px, long py, long p0x, long p0y, long p1x, long p1y )
focal_class.return: boolean
focal_class.signature: boolean isOnLine( long px, long py, long p0x, long p0y, long p1x, long p1y )
focal_class.class_method_signature: OsmNogoPolygon.isWithin(final long px, final long py)
focal_class.full_signature: public boolean isWithin(final long px, final long py)
focal_class.identifier: isWithin
focal_class.modifiers: public
focal_class.parameters: (final long px, final long py)
focal_class.return: boolean
focal_class.signature: boolean isWithin(final long px, final long py)
focal_class.class_method_signature: OsmNogoPolygon.distanceWithinPolygon(int lon1, int lat1, int lon2, int lat2)
focal_class.full_signature: public double distanceWithinPolygon(int lon1, int lat1, int lon2, int lat2)
focal_class.identifier: distanceWithinPolygon
focal_class.modifiers: public
focal_class.parameters: (int lon1, int lat1, int lon2, int lat2)
focal_class.return: double
focal_class.signature: double distanceWithinPolygon(int lon1, int lat1, int lon2, int lat2)
focal_class.class_method_signature: OsmNogoPolygon.inSegment( final Point p, final Point seg_p0, final Point seg_p1)
focal_class.full_signature: private static boolean inSegment( final Point p, final Point seg_p0, final Point seg_p1)
focal_class.identifier: inSegment
focal_class.modifiers: private static
focal_class.parameters: ( final Point p, final Point seg_p0, final Point seg_p1)
focal_class.return: boolean
focal_class.signature: boolean inSegment( final Point p, final Point seg_p0, final Point seg_p1)
focal_class.class_method_signature: OsmNogoPolygon.intersect2D_2Segments( final Point s1p0, final Point s1p1, final Point s2p0, final Point s2p1 )
focal_class.full_signature: private static int intersect2D_2Segments( final Point s1p0, final Point s1p1, final Point s2p0, final Point s2p1 )
focal_class.identifier: intersect2D_2Segments
focal_class.modifiers: private static
focal_class.parameters: ( final Point s1p0, final Point s1p1, final Point s2p0, final Point s2p1 )
focal_class.return: int
focal_class.signature: int intersect2D_2Segments( final Point s1p0, final Point s1p1, final Point s2p0, final Point s2p1 )
focal_class.superclass: extends OsmNodeNamed
focal_method.body: public boolean intersects(int lon0, int lat0, int lon1, int lat1)
    {
      final Point p0 = new Point (lon0,lat0);
      final Point p1 = new Point (lon1,lat1);
      int i_last = points.size()-1;
      Point p2 = points.get(isClosed ? i_last : 0 );
      for (int i = isClosed ? 0 : 1 ; i <= i_last; i++)
      {
        Point p3 = points.get(i);
        // does it intersect with at least one of the polygon's segments?
        if (intersect2D_2Segments(p0,p1,p2,p3) > 0)
        {
          return true;
        }
        p2 = p3;
      }
      return false;
    }
focal_method.class_method_signature: OsmNogoPolygon.intersects(int lon0, int lat0, int lon1, int lat1)
focal_method.full_signature: public boolean intersects(int lon0, int lat0, int lon1, int lat1)
focal_method.identifier: intersects
focal_method.invocations: size get get intersect2D_2Segments
focal_method.modifiers: public
focal_method.parameters: (int lon0, int lat0, int lon1, int lat1)
focal_method.return: boolean
focal_method.signature: boolean intersects(int lon0, int lat0, int lon1, int lat1)