Java Code Examples for org.locationtech.jts.io.ParseException#getMessage()

The following examples show how to use org.locationtech.jts.io.ParseException#getMessage() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RESTRuleServiceImpl.java    From geofence with GNU General Public License v2.0 5 votes vote down vote up
protected LayerDetails detailsFromInput(RESTInputRule in) {
    RESTLayerConstraints constraints = in.getConstraints();
    if (constraints != null) {
        LayerDetails details = new LayerDetails();

        if (constraints.getAllowedStyles() != null) {
            details.setAllowedStyles(new HashSet(constraints.getAllowedStyles()));
        }
        if (constraints.getAttributes() != null) {
            details.setAttributes(new HashSet(constraints.getAttributes()));
        }
        details.setCqlFilterRead(constraints.getCqlFilterRead());
        details.setCqlFilterWrite(constraints.getCqlFilterWrite());
        details.setDefaultStyle(constraints.getDefaultStyle());
        if (constraints.getRestrictedAreaWkt() != null) {
            WKTReader reader = new WKTReader();
            Geometry g;
            try {
                g = reader.read(constraints.getRestrictedAreaWkt());
            } catch (ParseException ex) {
                throw new BadRequestRestEx("Error parsing WKT:" + ex.getMessage());
            }
            details.setArea((MultiPolygon) g);
        }

        details.setType(constraints.getType());

        return details;
    } else {
        return null;
    }
}
 
Example 2
Source File: RuleReaderServiceImplTest.java    From geofence with GNU General Public License v2.0 5 votes vote down vote up
protected MultiPolygon buildMultiPolygon(String multip) {
    try {
        WKTReader reader = new WKTReader();
        MultiPolygon mp = (MultiPolygon) reader.read(multip);
        mp.setSRID(4326);
        return mp;
    } catch (ParseException ex) {
        throw new RuntimeException("Unexpected exception: " + ex.getMessage(), ex);
    }
}
 
Example 3
Source File: BaseDAOTest.java    From geofence with GNU General Public License v2.0 5 votes vote down vote up
protected MultiPolygon buildMultiPolygon() {
    try {
        WKTReader reader = new WKTReader();
        MultiPolygon mp = (MultiPolygon) reader.read(MULTIPOLYGONWKT);
        mp.setSRID(4326);
        return mp;
    } catch (ParseException ex) {
        throw new RuntimeException("Unexpected exception: " + ex.getMessage(), ex);
    }
}
 
Example 4
Source File: BaseDAOTest.java    From geofence with GNU General Public License v2.0 5 votes vote down vote up
protected Polygon buildPolygon() {
    try {
        WKTReader reader = new WKTReader();
        Polygon mp = (Polygon) reader.read(POLYGONWKT);
        mp.setSRID(4326);
        return mp;
    } catch (ParseException ex) {
        throw new RuntimeException("Unexpected exception: " + ex.getMessage(), ex);
    }
}