public static void main(String[] args) {
String point="113.711239,34.800116_113.711765,34.80042_113.71181,34.800023_113.711244,34.800112";
String isPoint="113.711507,34.800008";
String[] sp = isPoint.split(",");
double xx= Double.parseDouble(sp[0]);
double yy= Double.parseDouble(sp[1]);
String[] s = point.split("_");
List<Point2D.Double> potion=new ArrayList<>();
for (String value : s) {
String[] split = value.split(",");
double x = Double.parseDouble(split[0]);
double y = Double.parseDouble(split[1]);
Point2D.Double p = new Point2D.Double(x, y);
potion.add(p);
}
GeneralPath path=new GeneralPath();
Point2D.Double first=potion.get(0);
//设置起点坐标
path.moveTo(first.x,first.y);
for(Point2D.Double d:potion){
//将当前坐标连线到下方坐标
path.lineTo(d.x,d.y);
}
path.lineTo(first.x,first.y);
path.closePath();
boolean b = path.contains(xx, yy);
System.out.println(b);
}