本文整理汇总了Java中com.vividsolutions.jts.io.ParseException.printStackTrace方法的典型用法代码示例。如果您正苦于以下问题:Java ParseException.printStackTrace方法的具体用法?Java ParseException.printStackTrace怎么用?Java ParseException.printStackTrace使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.vividsolutions.jts.io.ParseException
的用法示例。
在下文中一共展示了ParseException.printStackTrace方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSimilarity
import com.vividsolutions.jts.io.ParseException; //导入方法依赖的package包/类
@Override
public double getSimilarity(Object object1, Object object2) {
// expects WKT Strings
String sWKT, tWKT;
Geometry sGeo, tGeo;
sWKT = object1.toString();
tWKT = object2.toString();
WKTReader reader = new WKTReader();
try {
sGeo = reader.read(sWKT);
tGeo = reader.read(tWKT);
} catch (ParseException e) {
e.printStackTrace();
return 0d;
}
return sGeo.crosses(tGeo) ? 1d : 0d;
}
示例2: getSimilarity
import com.vividsolutions.jts.io.ParseException; //导入方法依赖的package包/类
@Override
public double getSimilarity(Object object1, Object object2) {
// expects WKT Strings
String sWKT, tWKT;
Geometry sGeo, tGeo;
sWKT = object1.toString();
tWKT = object2.toString();
WKTReader reader = new WKTReader();
try {
sGeo = reader.read(sWKT);
tGeo = reader.read(tWKT);
} catch (ParseException e) {
e.printStackTrace();
return 0d;
}
return sGeo.equals(tGeo) ? 1d : 0d;
}
示例3: getSimilarity
import com.vividsolutions.jts.io.ParseException; //导入方法依赖的package包/类
@Override
public double getSimilarity(Object object1, Object object2) {
// expects WKT Strings
String sWKT, tWKT;
Geometry sGeo, tGeo;
sWKT = object1.toString();
tWKT = object2.toString();
WKTReader reader = new WKTReader();
try {
sGeo = reader.read(sWKT);
tGeo = reader.read(tWKT);
} catch (ParseException e) {
e.printStackTrace();
return 0d;
}
return sGeo.coveredBy(tGeo) ? 1d : 0d;
}
示例4: getSimilarity
import com.vividsolutions.jts.io.ParseException; //导入方法依赖的package包/类
@Override
public double getSimilarity(Object object1, Object object2) {
// expects WKT Strings
String sWKT, tWKT;
Geometry sGeo, tGeo;
sWKT = object1.toString();
tWKT = object2.toString();
WKTReader reader = new WKTReader();
try {
sGeo = reader.read(sWKT);
tGeo = reader.read(tWKT);
} catch (ParseException e) {
e.printStackTrace();
return 0d;
}
return sGeo.overlaps(tGeo) ? 1d : 0d;
}
示例5: getSimilarity
import com.vividsolutions.jts.io.ParseException; //导入方法依赖的package包/类
@Override
public double getSimilarity(Object object1, Object object2) {
// expects WKT Strings
String sWKT, tWKT;
Geometry sGeo, tGeo;
sWKT = object1.toString();
tWKT = object2.toString();
WKTReader reader = new WKTReader();
try {
sGeo = reader.read(sWKT);
tGeo = reader.read(tWKT);
} catch (ParseException e) {
e.printStackTrace();
return 0d;
}
return sGeo.touches(tGeo) ? 1d : 0d;
}
示例6: getSimilarity
import com.vividsolutions.jts.io.ParseException; //导入方法依赖的package包/类
@Override
public double getSimilarity(Object object1, Object object2) {
// expects WKT Strings
String sWKT, tWKT;
Geometry sGeo, tGeo;
sWKT = object1.toString();
tWKT = object2.toString();
WKTReader reader = new WKTReader();
try {
sGeo = reader.read(sWKT);
tGeo = reader.read(tWKT);
} catch (ParseException e) {
e.printStackTrace();
return 0d;
}
return sGeo.within(tGeo) ? 1d : 0d;
}
示例7: getSimilarity
import com.vividsolutions.jts.io.ParseException; //导入方法依赖的package包/类
@Override
public double getSimilarity(Object object1, Object object2) {
// expects WKT Strings
String sWKT, tWKT;
Geometry sGeo, tGeo;
sWKT = object1.toString();
tWKT = object2.toString();
WKTReader reader = new WKTReader();
try {
sGeo = reader.read(sWKT);
tGeo = reader.read(tWKT);
} catch (ParseException e) {
e.printStackTrace();
return 0d;
}
return sGeo.disjoint(tGeo) ? 1d : 0d;
}
示例8: getSimilarity
import com.vividsolutions.jts.io.ParseException; //导入方法依赖的package包/类
@Override
public double getSimilarity(Object object1, Object object2) {
// expects WKT Strings
String sWKT, tWKT;
Geometry sGeo, tGeo;
sWKT = object1.toString();
tWKT = object2.toString();
WKTReader reader = new WKTReader();
try {
sGeo = reader.read(sWKT);
tGeo = reader.read(tWKT);
} catch (ParseException e) {
e.printStackTrace();
return 0d;
}
return sGeo.intersects(tGeo) ? 1d : 0d;
}
示例9: getSimilarity
import com.vividsolutions.jts.io.ParseException; //导入方法依赖的package包/类
@Override
public double getSimilarity(Object object1, Object object2) {
// expects WKT Strings
String sWKT, tWKT;
Geometry sGeo, tGeo;
sWKT = object1.toString();
tWKT = object2.toString();
WKTReader reader = new WKTReader();
try {
sGeo = reader.read(sWKT);
tGeo = reader.read(tWKT);
} catch (ParseException e) {
e.printStackTrace();
return 0d;
}
return sGeo.contains(tGeo) ? 1d : 0d;
}
示例10: getSimilarity
import com.vividsolutions.jts.io.ParseException; //导入方法依赖的package包/类
@Override
public double getSimilarity(Object object1, Object object2) {
// expects WKT Strings
String sWKT, tWKT;
Geometry sGeo, tGeo;
sWKT = object1.toString();
tWKT = object2.toString();
WKTReader reader = new WKTReader();
try {
sGeo = reader.read(sWKT);
tGeo = reader.read(tWKT);
} catch (ParseException e) {
e.printStackTrace();
return 0d;
}
return sGeo.covers(tGeo) ? 1d : 0d;
}
示例11: wktTest
import com.vividsolutions.jts.io.ParseException; //导入方法依赖的package包/类
public static void wktTest() {
GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory(null);
WKTReader reader = new WKTReader(geometryFactory);
try {
Polygon polygon = (Polygon) reader.read("POLYGON((20 10, 30 0, 40 10, 30 20, 20 10))");
MultiPolygon multiPolygon = geometryFactory.createMultiPolygon(new Polygon[]{polygon});
System.out.println(multiPolygon.toText());
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
示例12: createPlace
import com.vividsolutions.jts.io.ParseException; //导入方法依赖的package包/类
public void createPlace(String identifier, String name, String shape) {
enableAuthentication();
Place p = new Place();
p.setIdentifier(identifier);
p.setTitle(name);
WKTReader r = new WKTReader();
try {
p.setShape(r.read(shape));
} catch (ParseException e) {
e.printStackTrace();
}
data.push(p);
placeService.save(p);
disableAuthentication();
}
示例13: getWktPolygon
import com.vividsolutions.jts.io.ParseException; //导入方法依赖的package包/类
public com.vividsolutions.jts.geom.Polygon getWktPolygon() {
if(wktPolygon == null && points != null && points.size() > 0){
try {
wktPolygon = (com.vividsolutions.jts.geom.Polygon) CommonFunctions.getInstance().getWktReader()
.read("POLYGON ((" + feature.getCoordinates() + "))");
} catch (ParseException e) {
e.printStackTrace();
}
}
return wktPolygon;
}
示例14: getWktLine
import com.vividsolutions.jts.io.ParseException; //导入方法依赖的package包/类
public LineString getWktLine() {
if(wktLine == null && points != null && points.size() > 0){
try {
wktLine = (com.vividsolutions.jts.geom.LineString) CommonFunctions.getInstance().getWktReader()
.read("LINESTRING (" + feature.getCoordinates() + ")");
} catch (ParseException e) {
e.printStackTrace();
}
}
return wktLine;
}
示例15: getWktPoint
import com.vividsolutions.jts.io.ParseException; //导入方法依赖的package包/类
public com.vividsolutions.jts.geom.Point getWktPoint() {
if(wktPoint == null && points != null && points.size() > 0){
try {
wktPoint = (com.vividsolutions.jts.geom.Point) CommonFunctions.getInstance().getWktReader()
.read("POINT (" + feature.getCoordinates() + ")");
} catch (ParseException e) {
e.printStackTrace();
}
}
return wktPoint;
}