Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ test:
mocha \
--reporter $(REPORTER) \
--require should \
--compilers coffee:coffee-script \
--compilers coffee:coffee-script/register \
$(TESTS)

.PHONY: build clean test
38 changes: 35 additions & 3 deletions binding.gyp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
'variables': { 'target_arch%': 'ia32' },
'variables': { 'target_arch%': 'ia32'},

'target_defaults': {
'default_configuration': 'Debug',
Expand Down Expand Up @@ -48,7 +48,7 @@

'targets': [
{
'target_name': 'spatialite',
'target_name': 'mod_spatialite',
'type': 'shared_library',
'direct_dependent_settings': {
'include_dirs': [
Expand All @@ -67,9 +67,12 @@
'src/spatialite/deps/freexl/binding.gyp:freexl'
],
'sources': [
'src/spatialite/src/connection_cache/generator/code_generator.c',
'src/spatialite/src/connection_cache/alloc_cache.c',
'src/spatialite/src/dxf/dxf_writer.c',
'src/spatialite/src/gaiaaux/gg_sqlaux.c',
'src/spatialite/src/gaiaaux/gg_utf8.c',
'src/spatialite/src/gaiaexif/gaia_exif.c',
'src/spatialite/src/gaiaexif/gaia_exif.c',
'src/spatialite/src/gaiageo/gg_advanced.c',
'src/spatialite/src/gaiageo/gg_endian.c',
'src/spatialite/src/gaiageo/gg_ewkt.c',
Expand All @@ -82,23 +85,47 @@
'src/spatialite/src/gaiageo/gg_kml.c',
'src/spatialite/src/gaiageo/gg_lwgeom.c',
'src/spatialite/src/gaiageo/gg_relations.c',
'src/spatialite/src/gaiageo/gg_relations_ext.c',
'src/spatialite/src/gaiageo/gg_shape.c',
'src/spatialite/src/gaiageo/gg_transform.c',
'src/spatialite/src/gaiageo/gg_vanuatu.c',
'src/spatialite/src/gaiageo/gg_voronoj.c',
'src/spatialite/src/gaiageo/gg_wkb.c',
'src/spatialite/src/gaiageo/gg_wkt.c',
'src/spatialite/src/gaiageo/gg_xml.c',
'src/spatialite/src/geopackage/gaia_cvt_gpkg.c',
'src/spatialite/src/geopackage/gpkgAddGeometryColumn.c',
'src/spatialite/src/geopackage/gpkgBinary.c',
'src/spatialite/src/geopackage/gpkgCreateBaseTables.c',
'src/spatialite/src/geopackage/gpkgCreateTilesTable.c',
'src/spatialite/src/geopackage/gpkgCreateTilesZoomLevel.c',
'src/spatialite/src/geopackage/gpkgGetImageType.c',
'src/spatialite/src/geopackage/gpkgInsertEpsgSRID.c',
'src/spatialite/src/geopackage/gpkgMakePoint.c',
'src/spatialite/src/geopackage/gpkg_add_geometry_triggers.c',
'src/spatialite/src/geopackage/gpkg_add_spatial_index.c',
'src/spatialite/src/geopackage/gpkg_add_tile_triggers.c',
'src/spatialite/src/geopackage/gpkg_get_normal_row.c',
'src/spatialite/src/geopackage/gpkg_get_normal_zoom.c',
'src/spatialite/src/md5/gaia_md5.c',
'src/spatialite/src/md5/md5.c',
'src/spatialite/src/shapefiles/shapefiles.c',
'src/spatialite/src/shapefiles/validator.c',
'src/spatialite/src/spatialite/extra_tables.c',
'src/spatialite/src/spatialite/mbrcache.c',
'src/spatialite/src/spatialite/metatables.c',
'src/spatialite/src/spatialite/spatialite.c',
'src/spatialite/src/spatialite/spatialite_init.c',
'src/spatialite/src/spatialite/statistics.c',
'src/spatialite/src/spatialite/virtualdbf.c',
'src/spatialite/src/spatialite/virtualfdo.c',
'src/spatialite/src/spatialite/virtualnetwork.c',
'src/spatialite/src/spatialite/virtualshape.c',
'src/spatialite/src/spatialite/virtualspatialindex.c',
'src/spatialite/src/spatialite/virtualXL.c',
'src/spatialite/src/spatialite/virtualbbox.c',
'src/spatialite/src/spatialite/virtualgpkg.c',
'src/spatialite/src/spatialite/virtualxpath.c',
'src/spatialite/src/srsinit/epsg_inlined_00.c',
'src/spatialite/src/srsinit/epsg_inlined_01.c',
'src/spatialite/src/srsinit/epsg_inlined_02.c',
Expand Down Expand Up @@ -140,6 +167,11 @@
'src/spatialite/src/srsinit/epsg_inlined_38.c',
'src/spatialite/src/srsinit/epsg_inlined_39.c',
'src/spatialite/src/srsinit/epsg_inlined_40.c',
'src/spatialite/src/srsinit/epsg_inlined_41.c',
'src/spatialite/src/srsinit/epsg_inlined_42.c',
'src/spatialite/src/srsinit/epsg_inlined_43.c',
'src/spatialite/src/srsinit/epsg_inlined_44.c',
'src/spatialite/src/srsinit/epsg_inlined_45.c',
'src/spatialite/src/srsinit/epsg_inlined_extra.c',
'src/spatialite/src/srsinit/epsg_inlined_prussian.c',
'src/spatialite/src/srsinit/epsg_inlined_wgs84_00.c',
Expand Down
20 changes: 2 additions & 18 deletions lib/spatialite.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,6 @@ var sqlite3 = module.exports = exports = require('sqlite3');
var fs = require('fs');

sqlite3.Database.prototype.spatialite = function(callback) {
var base_path = __dirname + '/../build/Release/spatialite';
var linux_path = base_path + '.so';
var osx_path = base_path + '.dylib';
var windows_path = base_path + '.dll';

var extension_path = null;

if (fs.existsSync(linux_path)) {
extension_path = linux_path;
} else if (fs.existsSync(osx_path)) {
extension_path = osx_path;
} else if (fs.existsSync(windows_path)) {
extension_path = windows_path;
} else {
throw new Error("Unable to find spatialite extension.");
}

this.loadExtension(extension_path, callback);
var base_path = __dirname + '/../build/Release/mod_spatialite';
this.loadExtension(base_path, callback);
};
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"url": "git://github.com/zhm/node-spatialite.git"
},
"dependencies": {
"sqlite3": "*"
"sqlite3": "^3.0.5"
},
"devDependencies": {
"coffee-script": "*",
Expand All @@ -32,6 +32,10 @@
"scripts": {
"test": "make test"
},
"licenses": [{ "type": "BSD" }],
"licenses": [
{
"type": "BSD"
}
],
"main": "./lib/spatialite"
}
15 changes: 12 additions & 3 deletions src/config/linux/ia32/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@
#define PACKAGE_NAME "libspatialite"

/* Define to the full name and version of this package. */
#define PACKAGE_STRING "libspatialite 4.0.0"
#define PACKAGE_STRING "libspatialite 4.2.0"

/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "libspatialite"
Expand All @@ -181,7 +181,7 @@
#define PACKAGE_URL ""

/* Define to the version of this package. */
#define PACKAGE_VERSION "4.0.0"
#define PACKAGE_VERSION "4.2.0"

/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
Expand All @@ -193,7 +193,7 @@
/* #undef TM_IN_SYS_TIME */

/* Version number of package */
#define VERSION "4.0.0"
#define VERSION "4.2.0"

/* Must be =64 in order to enable huge-file support. */
#define _FILE_OFFSET_BITS 64
Expand All @@ -216,3 +216,12 @@
/* Define to empty if the keyword `volatile' does not work. Warning: valid
code using `volatile' can become incorrect without. Disable with care. */
/* #undef volatile */

/* Define target cpu */
#define TARGET_CPU "x86_64-pc-linux-gnu"

/* make library loadable */
#define LOADABLE_EXTENSION 1

/* enable gpkg */
#define ENABLE_GEOPACKAGE 1
16 changes: 13 additions & 3 deletions src/config/linux/x64/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@
#define PACKAGE_NAME "libspatialite"

/* Define to the full name and version of this package. */
#define PACKAGE_STRING "libspatialite 4.0.0"
#define PACKAGE_STRING "libspatialite 4.2.0"

/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "libspatialite"
Expand All @@ -181,7 +181,7 @@
#define PACKAGE_URL ""

/* Define to the version of this package. */
#define PACKAGE_VERSION "4.0.0"
#define PACKAGE_VERSION "4.2.0"

/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
Expand All @@ -193,7 +193,7 @@
/* #undef TM_IN_SYS_TIME */

/* Version number of package */
#define VERSION "4.0.0"
#define VERSION "4.2.0"

/* Must be =64 in order to enable huge-file support. */
#define _FILE_OFFSET_BITS 64
Expand All @@ -216,3 +216,13 @@
/* Define to empty if the keyword `volatile' does not work. Warning: valid
code using `volatile' can become incorrect without. Disable with care. */
/* #undef volatile */
/* Define target cpu */

/* Define target cpu */
#define TARGET_CPU "x86_64-pc-linux-gnu"

/* make library loadable */
#define LOADABLE_EXTENSION 1

/* enable gpkg */
#define ENABLE_GEOPACKAGE 1
15 changes: 12 additions & 3 deletions src/config/mac/x64/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@
#define PACKAGE_NAME "libspatialite"

/* Define to the full name and version of this package. */
#define PACKAGE_STRING "libspatialite 4.0.0"
#define PACKAGE_STRING "libspatialite 4.2.0"

/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "libspatialite"
Expand All @@ -181,7 +181,7 @@
#define PACKAGE_URL ""

/* Define to the version of this package. */
#define PACKAGE_VERSION "4.0.0"
#define PACKAGE_VERSION "4.2.0"

/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
Expand All @@ -193,7 +193,7 @@
/* #undef TM_IN_SYS_TIME */

/* Version number of package */
#define VERSION "4.0.0"
#define VERSION "4.2.0"

/* Must be =64 in order to enable huge-file support. */
#define _FILE_OFFSET_BITS 64
Expand All @@ -216,3 +216,12 @@
/* Define to empty if the keyword `volatile' does not work. Warning: valid
code using `volatile' can become incorrect without. Disable with care. */
/* #undef volatile */

/* Define target cpu */
#define TARGET_CPU "x86_64-apple-darwin14.1.0"

/* make library loadable */
#define LOADABLE_EXTENSION 1

/* enable gpkg */
#define ENABLE_GEOPACKAGE 1
15 changes: 12 additions & 3 deletions src/config/win/ia32/config-msvc.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@
#define PACKAGE_NAME "libspatialite"

/* Define to the full name and version of this package. */
#define PACKAGE_STRING "libspatialite 4.0.0"
#define PACKAGE_STRING "libspatialite 4.2.0"

/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "libspatialite"
Expand All @@ -186,7 +186,7 @@
#define PACKAGE_URL ""

/* Define to the version of this package. */
#define PACKAGE_VERSION "4.0.0"
#define PACKAGE_VERSION "4.2.0"

/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
Expand All @@ -198,7 +198,7 @@
/* #undef TM_IN_SYS_TIME */

/* Version number of package */
#define VERSION "4.0.0"
#define VERSION "4.2.0"

/* Must be =64 in order to enable huge-file support. */
#define _FILE_OFFSET_BITS 64
Expand All @@ -221,3 +221,12 @@
/* Define to empty if the keyword `volatile' does not work. Warning: valid
code using `volatile' can become incorrect without. Disable with care. */
/* #undef volatile */

/* Define target cpu */
#define TARGET_CPU "msvc-32"

/* make library loadable */
#define LOADABLE_EXTENSION 1

/* enable gpkg */
#define ENABLE_GEOPACKAGE 1
11 changes: 10 additions & 1 deletion src/config/win/x64/config-msvc.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@
#define PACKAGE_NAME "libspatialite"

/* Define to the full name and version of this package. */
#define PACKAGE_STRING "libspatialite 4.0.0"
#define PACKAGE_STRING "libspatialite 4.2.0"

/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "libspatialite"
Expand Down Expand Up @@ -221,3 +221,12 @@
/* Define to empty if the keyword `volatile' does not work. Warning: valid
code using `volatile' can become incorrect without. Disable with care. */
/* #undef volatile */

/* Define target cpu */
#define TARGET_CPU "msvc-32"

/* make library loadable */
#define LOADABLE_EXTENSION 1

/* enable gpkg */
#define ENABLE_GEOPACKAGE 1
23 changes: 23 additions & 0 deletions src/spatialite/Android_4.2.0.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# -------------------
# Android_4.2.0.mk
# ndk-build clean
# ndk-build
# -------------------
LOCAL_PATH := $(call my-dir)
JSQLITE_PATH := javasqlite-20120209
SPATIALITE_PATH := libspatialite-4.2.0-rc1
GEOS_PATH := geos-3.4.2
PROJ4_PATH := proj-4.8.0
SQLITE_PATH := sqlite-amalgamation-3080403
ICONV_PATH := libiconv-1.13.1
XML2_PATH := libxml2-2.9.1
LZMA_PATH := xz-5.1.3alpha

include $(LOCAL_PATH)/iconv-1.13.1.mk
include $(LOCAL_PATH)/sqlite-3080403.mk
include $(LOCAL_PATH)/proj4-4.8.0.mk
include $(LOCAL_PATH)/geos-3.4.2.mk
include $(LOCAL_PATH)/libxml2-2.9.1.mk
include $(LOCAL_PATH)/lzma-xz-5.1.3a.mk
include $(LOCAL_PATH)/spatialite-4.2.0.mk
include $(LOCAL_PATH)/jsqlite-20120209.mk
Loading