Class QGisWriter
- java.lang.Object
-
- org.matsim.core.utils.io.AbstractMatsimWriter
-
- org.matsim.contrib.analysis.vsp.qgis.QGisWriter
-
- All Implemented Interfaces:
org.matsim.core.api.internal.MatsimSomeWriter
,org.matsim.core.api.internal.MatsimWriter
public class QGisWriter extends org.matsim.core.utils.io.AbstractMatsimWriter implements org.matsim.core.api.internal.MatsimWriter
Writer that creates a QuantumGIs project file (*.qgs).- Author:
- dhosse
-
-
Constructor Summary
Constructors Constructor Description QGisWriter(String crs, String workingDir)
Creates a new instance of a QGis project file (*.qgs) writer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addLayer(int position, QGisLayer layer)
Adds a new layer to the layers list at the specified position.void
addLayer(QGisLayer layer)
Adds a new layer to the layers list.void
changeWorkingDirectory(String workingDir)
org.locationtech.jts.geom.Envelope
getEnvelope()
List<QGisLayer>
getLayers()
String
getProjectname()
SRS
getSRS()
String
getTitle()
QGisConstants.units
getUnit()
String
getWorkingDir()
void
setEnvelope(org.locationtech.jts.geom.Envelope envelope)
Sets the starting view on the map when opening the project file.void
setProjectname(String projectname)
void
setTitle(String title)
void
setUnit(QGisConstants.units unit)
void
write(String filename)
-
-
-
Constructor Detail
-
QGisWriter
public QGisWriter(String crs, String workingDir)
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 methodaddLayer
. If no layers were added, the writer creates an empty project file. After calling the constructor you have to set the envelope (starting view) manually.- Parameters:
crs
- coordinate reference system of the network / spatial dataworkingDir
- the directory in which all generated files (shapefiles, qgs file) are put.
-
-
Method Detail
-
addLayer
public void addLayer(QGisLayer layer)
Adds a new layer to the layers list.- Parameters:
layer
- the layer you want to add
-
addLayer
public void addLayer(int position, QGisLayer layer)
Adds a new layer to the layers list at the specified position.- Parameters:
position
- the index you want to add the layer atlayer
- the layer you want to add
-
write
public void write(String filename)
- Specified by:
write
in interfaceorg.matsim.core.api.internal.MatsimWriter
-
changeWorkingDirectory
public void changeWorkingDirectory(String workingDir)
-
getEnvelope
public org.locationtech.jts.geom.Envelope getEnvelope()
-
getWorkingDir
public String getWorkingDir()
-
setEnvelope
public void setEnvelope(org.locationtech.jts.geom.Envelope envelope)
Sets the starting view on the map when opening the project file.- Parameters:
envelope
- with minx, miny, maxx and maxy coordinates of the starting view
-
getSRS
public SRS getSRS()
- Returns:
- The spatial reference system that was created for the project file
-
getUnit
public QGisConstants.units getUnit()
-
setUnit
public void setUnit(QGisConstants.units unit)
-
getProjectname
public String getProjectname()
-
setProjectname
public void setProjectname(String projectname)
-
-