Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Not issue) But request - extending RSQLite to Spatialite (RSpatialite) for Leaflet #84

Closed
ns-1m opened this issue Feb 14, 2015 · 4 comments

Comments

@ns-1m
Copy link

ns-1m commented Feb 14, 2015

Hi,

This is not issue but a request.

Would it be possible to extend RSQLite to Spatialite - Geo extension for SQLite?

Spatialite
http://www.gaia-gis.it/gaia-sins/

I think Leaffet would very useful for R developer if I can render vector for Spatialite or PostGIS using GeoJSON.

Right now, Leaflet is not so useful for interactive geo visualization from analysis ( SQL quering, etc.). A good geo database provider is needed (e.g. Spatialite).

So useful images to visualize what I meant (e.g. OpenLayers + Spatialite using WKT)

https://plus.google.com/photos/116847891529748214201/albums/5657718868560334001

I think extending RSQLite to RSpatialite would make Leaflet a very good tool for R developers for Geo visualization.

More on GeoJSON and Spatialite in github ( I could not find spatialite in github at the moment).

https://github.com/zhm/node-spatialite

OK. Here's Spatialite in github.

https://github.com/illarionov/SpatiaLite

Just added this link (below), I don't how info be useful.
https://github.com/pschmied/RSQLite.spatialite

Thanks, Noli

@hadley
Copy link
Member

hadley commented Feb 14, 2015

I think the approach taken in RSQLite.spatialite (i.e. an extension package) is the way to go.

cc @jcheng5 since he's been thinking a bit about spatial data

@hadley hadley closed this as completed Feb 14, 2015
@ns-1m
Copy link
Author

ns-1m commented Feb 14, 2015

Now it is closed.

I would like to see some R scripts how to use the spatialite extension, especially how to use " Select * AsGeoSJON ...." and instruction how to compile libspatialite.so that is compatible with the current SQLite use in RSQLite.

@ns-1m
Copy link
Author

ns-1m commented Feb 15, 2015

OK. Try to understand this thing now.

How do I solve this problem (below)?

The downloaded binary packages are in
    /var/folders/fx/vhfzfjq950d9d95k_xlxyft80000gn/T//RtmpvZKigo/downloaded_packages
> library(devtools)
Warning message:
package ‘devtools’ was built under R version 2.15.2 
> install_github(repo="RSQLite.spatialite", username="pschmied")
Installing github repo(s) RSQLite.spatialite/master from pschmied
Installing RSQLite.spatialite.zip from https://github.com/pschmied/RSQLite.spatialite/archive/master.zip
Installing RSQLite.spatialite
pdflatex not found. Not building PDF vignettes.
'/Library/Frameworks/R.framework/Resources/bin/R' --vanilla CMD build  \
  '/private/var/folders/fx/vhfzfjq950d9d95k_xlxyft80000gn/T/RtmpvZKigo/RSQLite.spatialite-master'  \
  --no-manual --no-resave-data --no-vignettes 

* checking for file '/private/var/folders/fx/vhfzfjq950d9d95k_xlxyft80000gn/T/RtmpvZKigo/RSQLite.spatialite-master/DESCRIPTION' ... OK
* preparing 'RSQLite.spatialite':
* checking DESCRIPTION meta-information ... OK
* cleaning src
* checking for LF line-endings in source and make files
* checking for empty or unneeded directories
* building 'RSQLite.spatialite_0.0.1.tar.gz'

'/Library/Frameworks/R.framework/Resources/bin/R' --vanilla CMD INSTALL  \
  '/var/folders/fx/vhfzfjq950d9d95k_xlxyft80000gn/T//RtmpvZKigo/RSQLite.spatialite_0.0.1.tar.gz'  \
  --library='/Library/Frameworks/R.framework/Versions/2.15/Resources/library' --with-keep.source 

* installing *source* package 'RSQLite.spatialite' ...
** libs
*** arch - i386
gcc -arch i386 -std=gnu99 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/i386 -DNDEBUG -DTHREADSAFE=0 -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RSQLite/include"  -DVERSION=\"3.0.1\" -D_LARGE_FILE=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 -DSQLITE_ENABLE_RTREE=1 -DNDEBUG=1 -DSPL_AMALGAMATION=1 -DOMIT_ICONV    -DOMIT_FREEXL  -fPIC  -g -O2  -c spatialite.c -o spatialite.o
gcc -arch i386 -std=gnu99 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/i386 -DNDEBUG -DTHREADSAFE=0 -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RSQLite/include"  -DVERSION=\"3.0.1\" -D_LARGE_FILE=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 -DSQLITE_ENABLE_RTREE=1 -DNDEBUG=1 -DSPL_AMALGAMATION=1 -DOMIT_ICONV    -DOMIT_FREEXL  -fPIC  -g -O2  -c sqlite3.c -o sqlite3.o
sqlite3.c:9562:0: warning: "sqlite3_mutex_alloc" redefined [enabled by default]
sqlite3.c:171:0: note: this is the location of the previous definition
sqlite3.c:9563:0: warning: "sqlite3_mutex_free" redefined [enabled by default]
sqlite3.c:172:0: note: this is the location of the previous definition
sqlite3.c:9564:0: warning: "sqlite3_mutex_enter" redefined [enabled by default]
sqlite3.c:173:0: note: this is the location of the previous definition
sqlite3.c:9565:0: warning: "sqlite3_mutex_try" redefined [enabled by default]
sqlite3.c:174:0: note: this is the location of the previous definition
sqlite3.c:9566:0: warning: "sqlite3_mutex_leave" redefined [enabled by default]
sqlite3.c:175:0: note: this is the location of the previous definition
sqlite3.c:9567:0: warning: "sqlite3_mutex_held" redefined [enabled by default]
sqlite3.c:176:0: note: this is the location of the previous definition
sqlite3.c:9568:0: warning: "sqlite3_mutex_notheld" redefined [enabled by default]
sqlite3.c:177:0: note: this is the location of the previous definition
gcc -arch i386 -std=gnu99 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/usr/local/lib -o RSQLite.spatialite.so spatialite.o sqlite3.o -lgeos_c -lproj -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
ld: warning: ld: warning: ignoring file /usr/local/lib/libgeos_c.dylib, file was built for unsupported file format ( 0xcf 0xfa 0xed 0xfe 0x 7 0x 0 0x 0 0x 1 0x 3 0x 0 0x 0 0x 0 0x 6 0x 0 0x 0 0x 0 ) which is not the architecture being linked (i386): /usr/local/lib/libgeos_c.dylibignoring file /usr/local/lib/libproj.dylib, file was built for unsupported file format ( 0xcf 0xfa 0xed 0xfe 0x 7 0x 0 0x 0 0x 1 0x 3 0x 0 0x 0 0x 0 0x 6 0x 0 0x 0 0x 0 ) which is not the architecture being linked (i386): /usr/local/lib/libproj.dylib

installing to /Library/Frameworks/R.framework/Versions/2.15/Resources/library/RSQLite.spatialite/libs/i386
*** arch - x86_64
gcc -arch x86_64 -std=gnu99 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/x86_64 -DNDEBUG -DTHREADSAFE=0 -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RSQLite/include"  -DVERSION=\"3.0.1\" -D_LARGE_FILE=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 -DSQLITE_ENABLE_RTREE=1 -DNDEBUG=1 -DSPL_AMALGAMATION=1 -DOMIT_ICONV    -DOMIT_FREEXL  -fPIC  -g -O2  -c spatialite.c -o spatialite.o
gcc -arch x86_64 -std=gnu99 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/x86_64 -DNDEBUG -DTHREADSAFE=0 -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RSQLite/include"  -DVERSION=\"3.0.1\" -D_LARGE_FILE=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 -DSQLITE_ENABLE_RTREE=1 -DNDEBUG=1 -DSPL_AMALGAMATION=1 -DOMIT_ICONV    -DOMIT_FREEXL  -fPIC  -g -O2  -c sqlite3.c -o sqlite3.o
sqlite3.c:9562:0: warning: "sqlite3_mutex_alloc" redefined [enabled by default]
sqlite3.c:171:0: note: this is the location of the previous definition
sqlite3.c:9563:0: warning: "sqlite3_mutex_free" redefined [enabled by default]
sqlite3.c:172:0: note: this is the location of the previous definition
sqlite3.c:9564:0: warning: "sqlite3_mutex_enter" redefined [enabled by default]
sqlite3.c:173:0: note: this is the location of the previous definition
sqlite3.c:9565:0: warning: "sqlite3_mutex_try" redefined [enabled by default]
sqlite3.c:174:0: note: this is the location of the previous definition
sqlite3.c:9566:0: warning: "sqlite3_mutex_leave" redefined [enabled by default]
sqlite3.c:175:0: note: this is the location of the previous definition
sqlite3.c:9567:0: warning: "sqlite3_mutex_held" redefined [enabled by default]
sqlite3.c:176:0: note: this is the location of the previous definition
sqlite3.c:9568:0: warning: "sqlite3_mutex_notheld" redefined [enabled by default]
sqlite3.c:177:0: note: this is the location of the previous definition
gcc -arch x86_64 -std=gnu99 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/usr/local/lib -o RSQLite.spatialite.so spatialite.o sqlite3.o -lgeos_c -lproj -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
installing to /Library/Frameworks/R.framework/Versions/2.15/Resources/library/RSQLite.spatialite/libs/x86_64
** R
** preparing package for lazy loading
Warning: package 'RSQLite' was built under R version 2.15.3
Warning: package 'DBI' was built under R version 2.15.3
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
*** arch - i386
Warning: package 'RSQLite' was built under R version 2.15.3
Warning: package 'DBI' was built under R version 2.15.3
Error in dyn.load(file, DLLpath = DLLpath, ...) : 
  unable to load shared object '/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RSQLite.spatialite/libs/i386/RSQLite.spatialite.so':
  dlopen(/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RSQLite.spatialite/libs/i386/RSQLite.spatialite.so, 6): Symbol not found: _GEOSArea
  Referenced from: /Library/Frameworks/R.framework/Versions/2.15/Resources/library/RSQLite.spatialite/libs/i386/RSQLite.spatialite.so
  Expected in: flat namespace
 in /Library/Frameworks/R.framework/Versions/2.15/Resources/library/RSQLite.spatialite/libs/i386/RSQLite.spatialite.so
Error: loading failed
Execution halted
*** arch - x86_64
Warning: package 'RSQLite' was built under R version 2.15.3
Warning: package 'DBI' was built under R version 2.15.3
ERROR: loading failed for 'i386'
* removing '/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RSQLite.spatialite'
Error: Command failed (1)

@github-actions
Copy link

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants