Giter VIP home page Giter VIP logo

gis's Introduction

Tarantool/GIS

Tarantool/GIS is a full-featured geospatial extension for Tarantool Database. It's like PostGIS, but for Tarantool.

  • Point, LineString, Polygon, MultiPoint, GeometryCollection and other geometric primitives.
  • Overlaps, Contains, Touches, Distance, Length, Area and other geometric functions.
  • Database of more than 5000 spatial reference systems (SRS) and conversion routines.
  • Aims to implement ISO 19125-1:2004 and ISO/IEC 13249-3 standards.
  • Full interoperability with ``WKT, WKB and GeoJSON formats.
  • Fast in-memory spatial indexes using Tarantool's RTREE.

Tarantool/GIS is in an alpha stage. All feautures are documented and fully covered by unit and functional tests.

[Build Status] (https://travis-ci.org/tarantool/gis)

Example

Here is an example how to work with geometric primitives in Tarantool:

gis = require('gis')
gis.install() -- create system tables
-- https://source.opennews.org/en-US/learning/choosing-right-map-projection/
wgs84 = 4326 -- WGS84 World-wide Projection (Lon/Lat)
nationalmap = 2163 -- US National Atlas Equal Area projection (meters)
calif5 = 2770 -- California zone 5 projection (meters)
nevada = gis.Polygon({{
    {-120.000000, 42.000000};
    {-114.000000, 42.000000};
    {-114.000000, 34.687427};
    {-120.000000, 39.000000};
    {-120.000000, 42.000000};
}}, wgs84)

nevada:wkt()
=> "POLYGON ((-120 42, -114 42, -114 34.687427, -120 39, -120 42))"

lasvegas = gis.Point({-115.136389, 36.175}, wgs84)
losangeles = gis.Point({-118.25, 34.05}, wgs84)

nevada:contains(lasvegas)
=> true
nevada:contains(losangeles)
=> false
line = gis.LineString({lasvegas, losangeles}, wgs84)
line:transform(calif5):length()
=> 368.94277529796 - km
nevada:transform(nationalmap):area() * 1e-6
=> 293496.74070953 -- km^2

Tarantool/GIS allows to store any kinds of geometric objects in Lua table and Tarantool spaces, perform kNN, OVERLAPS and other queries using the high-speed in-memory indexes.

Please follow [Getting Started] guide for further instructions. [Getting Started]: https://tarantool.github.io/gis/getting_started.html

See Also


Tarantool/GIS - manage geographics primitives as a professional with the speed of Tarantool!

gis's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gis's Issues

proj_api.h

cmake can't find file proj_api.h, which was removed in the proj version 8.0.0. how to solve this problem

Get segmentation fault in Polygon (Tarantool 1.7.6-24)

When using tarantool-gis:

luarocks install https://raw.githubusercontent.com/tarantool/gis/master/rockspecs/gis-scm-1.rockspec

gis = require('gis')
gis.install()
gis = require('gis')
wgs84 = 4326 -- WGS84 World-wide Projection (Lon/Lat)
gis.Polygon({{
    {37.884120, 55.613116 },
    {37.899055, 55.612244 }, 
    {37.899398, 55.606184 },
    {37.878627, 55.604972 },
}}, wgs84)


---
- error: '/usr/share/tarantool/gis/ST.lua:58: IllegalArgumentException: Points of
    LinearRing do not form a closed linestring'
...

/var/log/messages

Jul 11 09:13:08 localhost tarantoolctl: Segmentation fault
Jul 11 09:13:08 localhost tarantoolctl: code: SEGV_MAPERR
Jul 11 09:13:08 localhost tarantoolctl: addr: 0x21
Jul 11 09:13:08 localhost tarantoolctl: context: 0x7fa471e3f0c0
Jul 11 09:13:08 localhost tarantoolctl: siginfo: 0x7fa471e3f1f0
Jul 11 09:13:08 localhost tarantoolctl: rax      0x19d5e30          27090480
Jul 11 09:13:08 localhost tarantoolctl: rbx      0x19eb950          27179344
Jul 11 09:13:08 localhost tarantoolctl: rcx      0x0                0
Jul 11 09:13:08 localhost tarantoolctl: rdx      0x0                0
Jul 11 09:13:08 localhost tarantoolctl: rsi      0x19c53c0          27022272
Jul 11 09:13:08 localhost tarantoolctl: rdi      0x19c53c0          27022272
Jul 11 09:13:08 localhost tarantoolctl: rsp      0x7fa471e3f648     140344262129224
Jul 11 09:13:08 localhost tarantoolctl: rbp      0x7fa471e3f670     140344262129264
Jul 11 09:13:08 localhost tarantoolctl: r8       0x0                0
Jul 11 09:13:08 localhost tarantoolctl: r9       0x0                0
Jul 11 09:13:08 localhost tarantoolctl: r10      0x200              512
Jul 11 09:13:08 localhost tarantoolctl: r11      0x41116738         1091659576
Jul 11 09:13:08 localhost tarantoolctl: r12      0x0                0
Jul 11 09:13:08 localhost tarantoolctl: r13      0x2                2
Jul 11 09:13:08 localhost tarantoolctl: r14      0x415131c8         1095840200
Jul 11 09:13:08 localhost tarantoolctl: r15      0x41116738         1091659576
Jul 11 09:13:08 localhost tarantoolctl: rip      0x21               33
Jul 11 09:13:08 localhost tarantoolctl: eflags   0x10206            66054
Jul 11 09:13:08 localhost tarantoolctl: cs       0x33               51
Jul 11 09:13:08 localhost tarantoolctl: gs       0x0                0
Jul 11 09:13:08 localhost tarantoolctl: fs       0x0                0
Jul 11 09:13:08 localhost tarantoolctl: cr2      0x21               33
Jul 11 09:13:08 localhost tarantoolctl: err      0x14               20
Jul 11 09:13:08 localhost tarantoolctl: oldmask  0x0                0
Jul 11 09:13:08 localhost tarantoolctl: trapno   0xe                14
Jul 11 09:13:08 localhost tarantoolctl: Current time: 1531300388
Jul 11 09:13:08 localhost tarantoolctl: Please file a bug at http://github.com/tarantool/tarantool/issues
Jul 11 09:13:08 localhost tarantoolctl: Attempting backtrace... Note: since the server has already crashed,
Jul 11 09:13:08 localhost tarantoolctl: this may fail as well
Jul 11 09:13:08 localhost tarantoolctl: #0  0x4df359 in print_backtrace+9
Jul 11 09:13:08 localhost tarantoolctl: #1  0x40f027 in _ZL12sig_fatal_cbiP9siginfo_tPv+c7
Jul 11 09:13:08 localhost tarantoolctl: #2  0x7fa47e5db130 in _L_unlock_13+34
Jul 11 09:13:08 localhost tarantoolctl: #3  0x21 in +34
Jul 11 09:13:08 localhost tarantoolctl: #4  0x539eff in lj_ccall_func+3bf
Jul 11 09:13:08 localhost tarantoolctl: #5  0x54e3f6 in lj_cf_ffi_meta___call+36
Jul 11 09:13:08 localhost tarantoolctl: #6  0x4f4ca7 in lj_BC_FUNCC+34
Jul 11 09:13:08 localhost tarantoolctl: #7  0x4f6db1 in gc_call_finalizer+71
Jul 11 09:13:08 localhost tarantoolctl: #8  0x4f6f13 in gc_finalize+133
Jul 11 09:13:08 localhost tarantoolctl: #9  0x4f7947 in gc_onestep+97
Jul 11 09:13:08 localhost tarantoolctl: #10 0x4f8024 in lj_gc_step+54
Jul 11 09:13:08 localhost tarantoolctl: #11 0x535d1c in lj_trace_exit+2fc
Jul 11 09:13:08 localhost tarantoolctl: #12 0x4f6853 in lj_vm_exit_handler+e1
Jul 11 09:13:08 localhost tarantoolctl: #13 0x7fa452128f44 in +e1
Jul 11 09:13:08 localhost tarantoolctl: config	table: 0x417ccac0	loading config 	/etc/xxx/conf-3301.lua
Jul 11 09:13:08 localhost systemd: [email protected]: main process exited, code=killed, status=6/ABRT
Jul 11 09:13:08 localhost tarantoolctl: Stopping instance xxx-3301...
Jul 11 09:13:08 localhost tarantoolctl: Can't kill process 20600: No such process
Jul 11 09:13:08 localhost systemd: [email protected]: control process exited, code=exited status=1
Jul 11 09:13:08 localhost systemd: Unit [email protected] entered failed state.
Jul 11 09:13:09 localhost systemd: [email protected] holdoff time over, scheduling restart.
Jul 11 09:13:09 localhost systemd: Stopping Tarantool Database Server...
Jul 11 09:13:09 localhost systemd: Starting Tarantool Database Server...
Jul 11 09:13:09 localhost tarantoolctl: Starting instance xxx-3301...

Version

CentOS Linux release 7.1.1503 (Core)
tarantool 1.7.6.24-1.el7.centos
tarantool-gis.x86_64 0.1.16-1.el7.centos
geos.x86_64 3.4.2-2.el7
geos-devel 3.4.2-2.el7
proj.x86_64 4.8.0-4.el7
proj-devel 4.8.0-4.el7

Fix builds on centos 6

Currently centos 6 builds are broken:

[el-6]     filelist: Can't mix "%doc" with relative path and files with absolute path starting with: "/usr/share/doc/tarantool-gis-0.1.0.6"

Installation problem on CentOS7

Can't install gis module on CentOS7 (in VirtualBox on Mac). Steps:

  1. enable epel
    $ wget http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-8.noarch.rpm
    $ rpm -ivh epel-release-7-8.noarch.rpm
  2. install gis module:
    $ sudo yum tarantool-gis proj-devel geos-devel
  3. launch tarantool with an app requiring gis module (game.lua app from https://github.com/Sulverus/pokemon):
    $ tarantool game.lua
    Error at launch: symbol lookup error: /usr/lib64/tarantool/gis/lib.so: undefined symbol: GEOS_init_r
  4. install devel modules:
    $ sudo yum proj-devel geos-devel
  5. launch my tarantool instance again:
    $ tarantool game.lua
    Error at launch: symbol lookup error: /usr/lib64/tarantool/gis/lib.so: undefined symbol: GEOS_init_r

Fix builds on Fedora 24

Builds on Fedora 24 fail as follows:

[fedora-24] make[1]: *** No rule to make target 'doc-html'.  Stop.

Failed to install from LuaRocks

$ luarocks install gis-scm-1.rockspec --local
[CUT]
Scanning dependencies of target lib
[ 75%] Building C object gis/CMakeFiles/lib.dir/lib.c.o
[100%] Linking C shared library lib.so
[100%] Built target lib
[ 50%] Built target generate_cdefs
[100%] Built target lib
Install the project...
-- Install configuration: "Debug"
CMake Error at gis/cmake_install.cmake:36 (file):
  file cannot create directory: /usr/local/share/tarantool/gis.  Maybe need
  administrative privileges.
Call Stack (most recent call first):
  cmake_install.cmake:37 (include)


Makefile:116: recipe for target 'install' failed
make: *** [install] Error 1

missing declaration for symbol ''pj_get_errno'''

docker и linux ubuntu
 second = gis.Point({43.035657, 131.891867}, 4326)
first = gis.Point({43.165000, 131.906750}, 4326)
linec = gis.LineString({first, second}, 4326)
linec:length()
---
- 0.13019644902224
...
linec_1 = linec:transform(32644)
---
- error: '/home/tarantool/.rocks/share/tarantool/gis/projection.lua:46: missing declaration
    for symbol ''pj_get_errno'''

Ubuntu 18.04.2 LTS
Release:  18.04
Codename:  bionic

geos-config --version
3.6.2
proj
4.9.3

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.