private String getAllowedAreaAsString(MultiPolygon multiPolygon) { if (multiPolygon == null) { return ""; } return "SRID=" + multiPolygon.getSRID() + ";" + multiPolygon.toText(); }
public Object parse(Handler arg, GeometryFactory gf) throws SAXException { // one child, either a coord // or a coordinate sequence if(arg.children.size()<1) throw new SAXException("Cannot create a multi-polygon without atleast one polygon"); int srid = getSrid(arg.attrs,gf.getSRID()); Polygon[] plys = (Polygon[]) arg.children.toArray(new Polygon[arg.children.size()]); MultiPolygon mp = gf.createMultiPolygon(plys); if(mp.getSRID()!=srid) mp.setSRID(srid); return mp; } });
/** * Creates the multi polygon. * * @param pol * the pol * @return the multi polygon */ public MultiPolygon createMultiPolygon(Polygon[] pol) { MultiPolygon multiPoly = this.factory.createMultiPolygon(pol); if (multiPoly.getSRID() == 0) { multiPoly.setSRID(4326); } return multiPoly; }
/** * Creates the multi polygon. * * @param wkt * the wkt * @return the multi polygon * @throws ParseException * the parse exception */ public MultiPolygon createMultiPolygon(String wkt) throws ParseException { MultiPolygon multiPoly = this.multiPolAdapter.unmarshal(wkt); if (multiPoly.getSRID() == 0) { multiPoly.setSRID(4326); } return multiPoly; }
/** * Creates the wkt from multi polygon. * * @param multiPoly * the multi poly * @return the string * @throws ParseException * the parse exception */ public String createWKTFromMultiPolygon(MultiPolygon multiPoly) throws ParseException { if (multiPoly.getSRID() == 0) { multiPoly.setSRID(4326); } return this.multiPolAdapter.marshal(multiPoly); } }
@Override public String marshal(MultiPolygon the_geom) throws ParseException { if (the_geom != null) { WKTWriter wktWriter = new WKTWriter(); if (the_geom.getSRID() == 0) the_geom.setSRID(4326); return wktWriter.write(the_geom); } else { throw new ParseException("Geometry obj is null."); } } }
@Override public String marshal(MultiPolygon the_geom) throws ParseException { if (the_geom != null) { WKTWriter wktWriter = new WKTWriter(); if (the_geom.getSRID() == 0) the_geom.setSRID(4326); return wktWriter.write(the_geom); } else { throw new ParseException("Geometry obj is null."); } } }
@Override public String marshal(MultiPolygon the_geom) throws ParseException { if (the_geom != null) { WKTWriter wktWriter = new WKTWriter(); if (the_geom.getSRID() == 0) the_geom.setSRID(4326); return wktWriter.write(the_geom); } else { throw new ParseException("Geometry obj is null."); } } }
@Override public String marshal(MultiPolygon the_geom) throws ParseException { if (the_geom != null) { WKTWriter wktWriter = new WKTWriter(); if (the_geom.getSRID() == 0) the_geom.setSRID(4326); return wktWriter.write(the_geom); } else { throw new ParseException("Geometry obj is null."); } } }
layerLimitsInfo.setSrid(String.valueOf(the_geom.getSRID())); } else { layerLimitsInfo.setAllowedArea(null);
layerDetailsInfo.setAllowedArea(the_geom.toText()); layerDetailsInfo .setSrid(String.valueOf(the_geom.getSRID())); } else { layerDetailsInfo.setAllowedArea(null);