Skip to content

Commit

Permalink
feat: add log and error handler to config #63
Browse files Browse the repository at this point in the history
feat: add env param to config to set global gdal configuration
feat: add gdalinfo and ogrinfo apps and add the app results to dataset object
fix: raster/vector type calculation
fix: prevent app from terminating if a warning occurs
fix: support node.js >= 18
chore: update emscripten version to 3.1.50 (temporary disable PDS driver)
feat: list all created files with all param in the outputs of ogr2ogr, gdal_translate, gdalwarp, gdal_rasterize #45
feat: add outputName param to ogr2ogr, gdal_translate, gdalwarp, gdal_rasterize #44
fix: mocha issue causing tests not to start for Chrome
feat: add playground to test
feat: add more info about dataset in gdal3.js gui
  • Loading branch information
bugra9 committed Dec 10, 2023
1 parent 2b0ea6a commit 179ce0e
Show file tree
Hide file tree
Showing 27 changed files with 3,120 additions and 2,479 deletions.
2 changes: 1 addition & 1 deletion .info.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"coverageUrl": "https://gdal3.js.org/coverage",
"nativeDependencies": [
{
"name": "Emscripten 3.1.7",
"name": "Emscripten 3.1.50",
"url": "/~https://github.com/emscripten-core/emscripten",
"licenseUrl": "/~https://github.com/emscripten-core/emscripten/blob/main/LICENSE"
},
Expand Down
11 changes: 10 additions & 1 deletion GDAL_EMCC_FLAGS.mk
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ GDAL_EMCC_FLAGS += -s TOTAL_MEMORY=512MB -s ALLOW_MEMORY_GROWTH=1 -s DISABLE_EXC
GDAL_EMCC_FLAGS += -s WASM=1 -s MODULARIZE=1 -s 'EXPORT_NAME="CModule"'
GDAL_EMCC_FLAGS += -s RESERVED_FUNCTION_POINTERS=200
GDAL_EMCC_FLAGS += -s EXPORTED_FUNCTIONS="[\
'_malloc',\
'_free',\
'_CSLCount',\
'_GDALSetCacheMax',\
'_GDALAllRegister',\
Expand Down Expand Up @@ -102,7 +104,13 @@ GDAL_EMCC_FLAGS += -s EXPORTED_FUNCTIONS="[\
'_GDALGetSpatialRef',\
'_CPLAtof',\
'_OSRSetAxisMappingStrategy',\
'_GDALInvGeoTransform'\
'_GDALInvGeoTransform',\
'_GDALInfo',\
'_GDALInfoOptionsNew',\
'_GDALInfoOptionsFree',\
'_GDALVectorInfo',\
'_GDALVectorInfoOptionsNew',\
'_GDALVectorInfoOptionsFree'\
]"

GDAL_EMCC_FLAGS += -s EXPORTED_RUNTIME_METHODS="[\
Expand All @@ -111,6 +119,7 @@ GDAL_EMCC_FLAGS += -s EXPORTED_RUNTIME_METHODS="[\
'ccall',\
'cwrap',\
'stringToUTF8',\
'UTF8ToString',\
'lengthBytesUTF8',\
'FS',\
'ENV',\
Expand Down
14 changes: 9 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,22 @@ GDAL_SRC = $(SRC_DIR)/gdal-$(GDAL_VERSION)
gdal3.js: $(DIST_DIR)/gdal3WebAssembly.js
gdal: $(ROOT_DIR)/lib/libgdal.a

$(DIST_DIR)/gdal3WebAssembly.js: $(ROOT_DIR)/lib/libgdal.a
$(DIST_DIR)/gdal3WebAssembly.js: $(ROOT_DIR)/lib/libgdal.a $(ROOT_DIR)/lib/gdalinfo_lib.cpp.o
mkdir -p $(DIST_DIR); \
cd $(DIST_DIR); \
EMCC_CORES=4 $(EMCC) $(ROOT_DIR)/lib/libgdal.a \
EMCC_CORES=4 $(EMCC) $(ROOT_DIR)/lib/libgdal.a $(ROOT_DIR)/lib/gdalinfo_lib.cpp.o $(ROOT_DIR)/lib/ogrinfo_lib.cpp.o \
$(ROOT_DIR)/lib/libproj.a $(ROOT_DIR)/lib/libsqlite3.a $(ROOT_DIR)/lib/libz.a $(ROOT_DIR)/lib/libspatialite.a \
$(ROOT_DIR)/lib/libgeos.a $(ROOT_DIR)/lib/libgeos_c.a $(ROOT_DIR)/lib/libwebp.a $(ROOT_DIR)/lib/libexpat.a $(ROOT_DIR)/lib/libwebpdemux.a \
$(ROOT_DIR)/lib/libtiffxx.a $(ROOT_DIR)/lib/libtiff.a $(ROOT_DIR)/lib/libgeotiff.a \
$(ROOT_DIR)/lib/libgeos.a $(ROOT_DIR)/lib/libgeos_c.a $(ROOT_DIR)/lib/libwebp.a $(ROOT_DIR)/lib/libsharpyuv.a $(ROOT_DIR)/lib/libwebpdemux.a \
$(ROOT_DIR)/lib/libexpat.a $(ROOT_DIR)/lib/libtiffxx.a $(ROOT_DIR)/lib/libtiff.a $(ROOT_DIR)/lib/libgeotiff.a \
$(ROOT_DIR)/lib/libiconv.a \
-o $@ $(GDAL_EMCC_FLAGS) \
--preload-file $(ROOT_DIR)/share/gdal@/usr/share/gdal \
--preload-file $(ROOT_DIR)/share/proj@/usr/share/proj;

$(ROOT_DIR)/lib/gdalinfo_lib.cpp.o: $(ROOT_DIR)/lib/libgdal.a
cp "$(GDAL_SRC)/build/apps/CMakeFiles/appslib.dir/ogrinfo_lib.cpp.o" $(ROOT_DIR)/lib/ogrinfo_lib.cpp.o; \
cp "$(GDAL_SRC)/build/apps/CMakeFiles/appslib.dir/gdalinfo_lib.cpp.o" $(ROOT_DIR)/lib/gdalinfo_lib.cpp.o;

$(ROOT_DIR)/lib/libgdal.a: $(GDAL_SRC)/build/Makefile
cd $(GDAL_SRC)/build; \
$(EMMAKE) make -j4 install;
Expand All @@ -78,7 +82,7 @@ $(GDAL_SRC)/build/Makefile: $(ROOT_DIR)/lib/libsqlite3.a $(ROOT_DIR)/lib/libproj
rm -rf $(ROOT_DIR)/lib/cmake; \
mkdir build; \
cd build; \
$(EMCMAKE) cmake .. $(PREFIX_CMAKE) -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DBUILD_APPS=OFF \
$(EMCMAKE) cmake .. $(PREFIX_CMAKE) -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DBUILD_APPS=OFF -DGDAL_ENABLE_DRIVER_PDS=OFF \
-DCMAKE_PREFIX_PATH=$(ROOT_DIR) -DCMAKE_FIND_ROOT_PATH=$(ROOT_DIR) \
-DGDAL_USE_HDF5=OFF -DGDAL_USE_HDFS=OFF -DACCEPT_MISSING_SQLITE3_MUTEX_ALLOC=ON \
-DSQLite3_INCLUDE_DIR=$(ROOT_DIR)/include -DSQLite3_LIBRARY=$(ROOT_DIR)/lib/libsqlite3.a \
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ GNU Lesser General Public License v2.1 or later
See [LICENSE](/~https://github.com/bugra9/gdal3.js/blob/master/LICENSE) to see the full text.

**Compiled with**
- [Emscripten 3.1.7](/~https://github.com/emscripten-core/emscripten) [(License)](/~https://github.com/emscripten-core/emscripten/blob/main/LICENSE)
- [Emscripten 3.1.50](/~https://github.com/emscripten-core/emscripten) [(License)](/~https://github.com/emscripten-core/emscripten/blob/main/LICENSE)
- [Gdal 3.8.1](/~https://github.com/OSGeo/gdal) [(License)](/~https://github.com/OSGeo/gdal/blob/master/gdal/LICENSE.TXT)
- [Proj 9.3.1](/~https://github.com/OSGeo/PROJ) [(License)](/~https://github.com/OSGeo/PROJ/blob/master/COPYING)
- [Geos 3.12.1](/~https://github.com/libgeos/geos) [(License)](/~https://github.com/libgeos/geos/blob/master/COPYING)
Expand Down
Loading

0 comments on commit 179ce0e

Please sign in to comment.