this.handler.writeHeaderAndStartElement(this.writer); this.handler.writeTitle(this.writer); this.handler.writeLayerTreeGroup(this.writer); this.handler.writeMapCanvas(this.writer); this.handler.writeLayerTreeCanvas(this.writer); this.handler.writeProjectLayers(this.writer); this.handler.writeProperties(this.writer); this.handler.endFile(this.writer); this.writer.flush(); this.writer.close();
public void writeLayerTreeCanvas(BufferedWriter out) throws IOException{ out.write("\t<layer-tree-canvas>\n"); out.write("\t\t<custom-order enabled=\"0\">\n"); for(QGisLayer layer : this.writer.getLayers()){ writeItem(out, layer); } out.write("\t\t</custom-order>\n"); out.write("\t</layer-tree-canvas>\n"); }
public void writeLayerTreeGroup(BufferedWriter out) throws IOException{ out.write("\t<layer-tree-group expanded=\"1\" checked=\"Qt::Checked\" name=\"\">\n"); out.write("\t\t<customproperties/>\n"); for(QGisLayer layer : this.writer.getLayers()){ writeLayerTreeLayer(out, layer); } out.write("\t</layer-tree-group>\n"); }
if(isCsvDataLayer(vlayer)){ writeGeometryLayer(out,vlayer);
/** * Creates a new instance of a QGis project file (*.qgs) writer. * Coordinate reference system and working directory are mandatory for writing the file. * Layers have to be added separately with the method {@code addLayer}. If no layers were * added, the writer creates an empty project file. * </p> * After calling the constructor you have to set the envelope (starting view) manually. * * @param crs coordinate reference system of the network / spatial data * @param workingDir the directory in which all generated files (shapefiles, qgs file) are put. * */ public QGisWriter(String crs, String workingDir){ setCrs(crs); this.workingDirectory = workingDir; this.handler = new QGisFileWriter(this); this.setUnit(QGisConstants.units.meters); }
public void writeMapCanvas(BufferedWriter out) throws IOException{ out.write("\t<mapcanvas>\n"); out.write("\t\t<units>" + this.writer.getUnit().toString() + "</units>\n"); out.write("\t\t<extent>\n"); out.write("\t\t\t<xmin>" + this.writer.getEnvelope().getMinX() + "</xmin>\n"); out.write("\t\t\t<ymin>" + this.writer.getEnvelope().getMinY() + "</ymin>\n"); out.write("\t\t\t<xmax>" + this.writer.getEnvelope().getMaxX() + "</xmax>\n"); out.write("\t\t\t<ymax>" + this.writer.getEnvelope().getMaxY() + "</ymax>\n"); out.write("\t\t</extent>\n"); out.write("\t\t<projections>1</projections>\n"); this.writeDestinationSrs(out); out.write("\t\t<layer_coordinate_transform_info/>\n"); out.write("\t</mapcanvas>\n"); }