Skip to content

Commit

Permalink
address gdal/ogr related atexit crashes - ref mapnik#251
Browse files Browse the repository at this point in the history
  • Loading branch information
Dane Springmeyer authored and diorahman committed Jun 12, 2014
1 parent 82893a0 commit 6eb487f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions src/node_mapnik.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
#include <libxml/parser.h>
#include <libxml/xmlversion.h>

#include <gdal_priv.h>
#include <ogr_api.h>

// mapnik
#include <mapnik/config.hpp> // for MAPNIK_DECL
#include <mapnik/version.hpp>
Expand Down Expand Up @@ -98,6 +101,8 @@ static NAN_METHOD(shutdown)
google::protobuf::ShutdownProtobufLibrary();
// http://lists.fedoraproject.org/pipermail/devel/2010-January/129117.html
xmlCleanupParser();
GDALDestroyDriverManager();
OGRCleanupAll();
NanReturnUndefined();
}

Expand Down
6 changes: 3 additions & 3 deletions test/vector-tile.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ describe('mapnik.VectorTile ', function() {
}
]
};
vtile.fromGeoJSON(JSON.stringify(geojson),"layer-name")
vtile.addGeoJSON(JSON.stringify(geojson),"layer-name")
var out = vtile.toGeoJSON(0);
assert.equal(out.type,'FeatureCollection');
assert.equal(out.features.length,1);
Expand Down Expand Up @@ -524,7 +524,7 @@ describe('mapnik.VectorTile ', function() {
}
]
};
vtile.fromGeoJSON(JSON.stringify(geojson),"layer-name");
vtile.addGeoJSON(JSON.stringify(geojson),"layer-name");
// console.log(JSON.stringify(vtile.toGeoJSON(0),null,1));
// at z0 we need a large tolerance because of loss of precision in point coords
// because the points have been rounded to -121.9921875,47.98992166741417
Expand Down Expand Up @@ -564,7 +564,7 @@ describe('mapnik.VectorTile ', function() {

// currently skipping since this segfaults at exit
// https://github.com/mapnik/node-mapnik/issues/251
it.skip('should be able to resample and encode (render) a geotiff into vector tile', function(done) {
it('should be able to resample and encode (render) a geotiff into vector tile', function(done) {
var vtile = new mapnik.VectorTile(0, 0, 0);
// first we render a geotiff into an image tile
var map = new mapnik.Map(256, 256);
Expand Down

0 comments on commit 6eb487f

Please sign in to comment.