GIS on Rails by Oleksandr Kychun

Preview:

Citation preview

GIS on RailsIntegrate GIS into your Rails application using OpenGeo

Suite

GIS

Data representation

Raster vs Vector● Points

● Lines

● Polygons

● Ubuntu 12.04, 14.04

● Mac OS X● Red Hat

Enterprise Linux and CentOS.

● Windows

Problem: Store and serve data that comes in shapefiles

Postgis Geoserver OpenLayers

provides spatial objects for PostgreSQL

provides advanced web mapping capabilities

powerful map and feature server for sharing,

analyzing, and editing geospatial data

GeoServer Web interface

Typically, to create layer that could be presented to the end user, you’ll need to complete 3 steps

● Create a workspace. ● Create storage.(Shapefile vs Postgis)● Publish a layer

Public APIGeoserver Configuration Api Composer Api

Postman probes

Requirements

● simple curl based communicator○ wrapper around curb gem

● postgresql client○ pg gem

● background processing lib○ resque gem

● unzipper○ rubyzip and zip-zip gems

● shapefile import tool○ shp2pgsql

Import process

● submit form● active record saves the object and triggers callback after commit● callback adds GeoserverTask to the queue ● resque worker initializes the handler(layer_creator)● handler processes the request

○ creates workspace○ creates storage○ creates database if missing○ unpacks zip file○ imports data from shapefile to created table○ publishes layer

Results