use of uk.me.parabola.imgfmt.app.ImgFileWriter in project mkgmap by openstreetmap.
the class MDRFile method write.
public void write() {
mdr15.release();
ImgFileWriter writer = getWriter();
writeSections(writer);
// Now refresh the header
position(0);
getHeader().writeHeader(writer);
}
use of uk.me.parabola.imgfmt.app.ImgFileWriter in project mkgmap by openstreetmap.
the class LBLFile method writePost.
public void writePost() {
// Now that the body is written all the required offsets will be set up
// inside the header, so we can go back and write it.
ImgFileWriter writer = getWriter();
getHeader().writeHeader(writer);
// Text can be put between the header and the body of the file.
writer.put(Utils.toBytes(sort.getDescription()));
writer.put((byte) 0);
assert writer.position() == LBLHeader.HEADER_LEN + lblHeader.getSortDescriptionLength();
}
use of uk.me.parabola.imgfmt.app.ImgFileWriter in project mkgmap by openstreetmap.
the class DEMFile method write.
public void write() {
ImgFileWriter w = getWriter();
if (w instanceof BufferedImgFileWriter) {
// increase file size limit to 256MB, no idea what the limit is
((BufferedImgFileWriter) w).setMaxSize(0xfffffff);
}
getHeader().writeHeader(getWriter());
}
use of uk.me.parabola.imgfmt.app.ImgFileWriter in project mkgmap by openstreetmap.
the class TREFile method writeCopyrights.
/**
* Write out the copyrights. This is just a list of pointers to strings
* in the label section basically.
*/
private void writeCopyrights() {
// Write out the pointers to the labels that hold the copyright strings
header.setCopyrightPos(position());
ImgFileWriter writer = getWriter();
for (Label l : copyrights) {
header.incCopyrightSize();
writer.put3(l.getOffset());
}
}
use of uk.me.parabola.imgfmt.app.ImgFileWriter in project mkgmap by openstreetmap.
the class NETFile method writePost.
/**
* Final writing out of net sections.
*
* We patch the NET offsets into the RGN file and create the sorted roads section.
*
* @param rgn The region file, this has to be patched with the calculated net offsets.
*/
public void writePost(ImgFileWriter rgn) {
for (RoadDef rd : roads) rd.writeRgnOffsets(rgn);
ImgFileWriter writer = netHeader.makeSortedRoadWriter(getWriter());
try {
List<LabeledRoadDef> labeledRoadDefs = sortRoads();
for (LabeledRoadDef labeledRoadDef : labeledRoadDefs) labeledRoadDef.roadDef.putSortedRoadEntry(writer, labeledRoadDef.label);
} finally {
Utils.closeFile(writer);
}
getHeader().writeHeader(getWriter());
}
Aggregations