Code Monkey home page Code Monkey logo

batyr's Introduction

batyr

A server which connects all kinds of vector geodata sources to a PostgreSQL/PostGIS database and provides a structured way to synchronize external data to database tables.

One common situation when dealing with geographic data is repeatedly exporting and importing this data to and from a PostGIS-enabled database. While the export is very well covered by products like Mapserver and GeoServer, importing is a bit more tricky. Common solutions consist mostly of custom scripts wrapping commands like shp2pgsql or ogr2ogr. These solutions often fail or at least need some tricky hacks if single rows of data should be updated instead of deleting and restoring the complete table content. It is also hard to account for slow or interrupted transactions and still make sure that the data stays synchronized as a whole. Using these import scripts requires either command line access or some custom code to hook them up to a job queue or even web interface to make them usable from within other applications.

Flaws like those were the reason for us to create batyr as a reusable solution for similar demands in the future.

Screenshot of the status page of the webinterface

batyr is a single server application providing the following:

  • "Intelligent" writing of data. A synchronization does not consist of a complete truncate and restore of a table anymore. Only features which have any differences to the ones provided by the external datasource are actually updated. New features are only created if they are not already in the database and features get (optionally) removed from the database if they are not part of the datasource any more. All this uses the primary key of the table to identify matching features from the datasource.
  • An integrated web-interface to get an overview on the current state of the server and to optionally start syncronizations manually.
  • A well-documented HTTP-API to easily integrate the batyr into other applications and allow flexible triggering of synchroniszations. Furthermore the HTTP-API provides methods to integrate batyr in existing monitoring systems like Nagios.
  • On-the-fly transformation of geometries to the spatial reference system of the database table. The required reference system is looked up in the PostGIS geometry_columns view/table and the transformation itself is performed by PostGIS.
  • Internally batyr uses the OGR-library to access datasources. So batyr covers all vector formats supported by OGR and connecting to - for example - a WFS is possible. Additionally this allows using OGR Virtual Formats for extended configuration options.
  • Synchronization jobs are internally queued and are handled in parallel using a configurable number of database connections. This takes care of a responsive HTTP-API as well as optimal usage of resources.

With these features it is possible to quickly integrate external geodata into your PostGIS database - without having to spend time creating custom code.

Screenshot of the jobqueue of the webinterface

For the complete manual see the included MANUAL.md file.

batyr's People

Contributors

azuledu avatar lb1c avatar nmandery avatar patrickbr avatar

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

Watchers

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

batyr's Issues

Support for GeometryCollections

Currently the function st_equals is used to compare incoming geoemtries with existing ones, but this function does not support GeometryCollections and will trigger an error in postgres.

To deal with this situation batyr should skip the geometry comparison when at least one of the geometries is a collection

batyrd command not found

Hi,

I have build the system like MANUAL.md, but not working, i was trying to install in debian Jessie with commands:

# apt-get install libpoco-dev libpocofoundation9 libpoconet9 libpocoutil9 libgdal1 libgdal1-dev cmake g++ build-essential libpq-dev discount python
$ cmake .
$ make

After make command is executed:

[  7%] Built target batyrcommon
[  7%] Built target manual-html
Generating header with the static resources
[  7%] Built target web-resources
Scanning dependencies of target batyrd
[ 11%] Building CXX object src/server/CMakeFiles/batyrd.dir/server.cpp.o
[ 15%] Building CXX object src/server/CMakeFiles/batyrd.dir/db/connection.cpp.o
[ 19%] Building CXX object src/server/CMakeFiles/batyrd.dir/broker.cpp.o
[ 23%] Building CXX object src/server/CMakeFiles/batyrd.dir/worker.cpp.o
[ 26%] Building CXX object src/server/CMakeFiles/batyrd.dir/jobstorage.cpp.o
[ 30%] Building CXX object src/server/CMakeFiles/batyrd.dir/http/httprequesthandlerfactory.cpp.o
[ 34%] Building CXX object src/server/CMakeFiles/batyrd.dir/http/statushandler.cpp.o
[ 38%] Building CXX object src/server/CMakeFiles/batyrd.dir/http/handler.cpp.o
[ 42%] Building CXX object src/server/CMakeFiles/batyrd.dir/http/listener.cpp.o
Linking CXX executable batyrd
[100%] Built target batyrd

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.