3. hence I love maps and mapping.
I work at Research Solutions Africa
(RSA) as a location analyst this is just
telling people more about a place that
they don’t know especially businesses.
On most platforms @kamalogudah
About Me
12. Definition of Terms
• GIS: Geographical Information System
• Layers: just like the layers in Photoshop,
but they're georeferenced.
• Projection: algorithm for flatting the
globe
• Geometry: the core data type in a
Geospatial application
15. Exposing physical space as a first-order
programming concept.
Has Rich, built-in support for shapes,
space, and the relationship of physical
objects to one another.
Describes objects spatially eg Locations
on the earth, shapes of buildings etc.
16. Coordinate System
Coordinate system defines the location
of a point on a planar or spherical surface.
Geographic coordinate system is a 3D
reference system that locates points on the
Earth’s surface.
A point has two coordinate values:
latitude and longitude which measure
angles.
17. Types of Coordinate System
1. Geocentric coordinate systems are 3D coordinate
systems with the origin located at the earth's center.
Geocentric coordinates measure X, Y, and Z distances
from the center of the earth.
18. Types of Coordinate System
2. Geographic coordinate systems are the familiar
latitude-longitude systems identifying points on the
earth's surface in terms of degrees. most common, eg
"WGS 84". used by GPS and most mapping apps.
19. Types of Coordinate System
3.Projected coordinate systems involve taking a
portion of the earth's surface and "flattening" it.
Planar and generally Cartesian for easy display and
computation; introduces distortion.
21. Spatial Data Types
Store shapes like points,lines, and
polygons in geometry columns.
Represents a binary representation of
a shapes in a db row (with location).
24. Spatial Functions
Spatial functions (in SQL) help query
spatial properties and relationships.
Normal Db has functions for
manipulating data in a query.
These include mathematical functions,
date, functions to work on Strings.
A spatial Db adds more to these “base
functions” these include those to operate
on geometries.
25. Spatial Functions
1. Conversion. Text representation of a point
(ST_AsText), (ST_GeomFromText).
2. Retrieval. Length of a road? (ST_Length),
perimeter of a Kenya (ST_Perimeter).
3. Comparison. Is Nairobi next to Turkana?
(ST_Touches), ST_Contains.
4. Generation. Calculate a 20km exclusion limit
around a point (ST_Buffer), Consolidate
Nairobi, Machakos, Kiambu and Kajiado
counties (ST_Union)
26. Spatial Index
Indexes make using a spatial db for
large data sets possible.
Otherwise, any search for a feature
would require a “sequential scan” of
every record in the database.
Indexing speeds up searching by
organizing the data into a search tree.
This can be quickly traversed to find a
particular record.
30. PostGIS Anatomy.
There are more than 700+ PostGIS functions.
One table (spatial_ref_sys) and two views
(geometry_columns and
geography_columns).
Spatial_ref_sys. Defines the spatial reference
systems known to the database (SRID).
They are known by an ID number, such as
4326 (for WGS 84 Lat/Lon)
31. Geometry Columns
The geometry_columns view defines
the dimension, geometry, and spatial
reference system for each spatial table
in the PostGIS database that contains a
geometry type.
33. Geography Column
• The geography_columns view defines
the dimension, geometry, each spatial
table in the PostGIS database that
contains a geography type.
35. 1. Database – PostgreSQL with
PostGIS extension (Preferably
and works).
36. Ruby
rgeo --- a geospatial data library for Ruby.
rgeo-shapefile --- RGeo component for reading ESRI
shapefiles
rgeo-geojson --- RGeo component for reading and writing
GeoJSON
Rgeo-activerecord –- is an optional RGeo module providing
spatial extensions for ActiveRecord.
squeel --- ActiveRecord enhancement for query writing
activerecord-postgis-adapter --- ActiveRecord adapter for
PostGIS
ruby geocoder --- Integration with geocoding services
37. CLIENT SIDE
heatmap.js --- A heatmap implementation for
Javascript
thermo.js --- Another heatmap implementation for
Javascript
heatcanvas.js --- Yet another heatmap
implementation for Javascript
OpenLayers --- An open-source map/visualization
tool; an alternative to Google Maps.
Mapbox, Leafletjs etc.
38. OTHERS
libgeos --- C library for geometric
analysis
libproj --- C library for coordinate
transforms
libgdal --- C library for rasters
39.
40. rails new rubyconf --database=postgresql
Create new app
In Gemfile add activerecord-postgis-adapter