Posts

Showing posts with the label QGIS

Getting started with Raster and PostGIS - I

Image
Steps for loading a raster in PostGIS (PgSql 9.4/ PostGIS 2.2) and pull it from database to view in QGIS 2.14.17. 1. Generate SQL for raster [NOTE: Do not create PostGIS table name starts with underscore, it creates problem while adding raster to QGIS from PostGIS database using DB Manager]         raster2pgsql -s 4326 -I -C -M -F -t 50x50 -N nan biodiv_ssolnw.tif > biodiv_ssolnw.sql 2. Import generated raster into PostGIS database [Make sure to enable postgis extension in db]          psql -h localhost -U postgres -d ecolservicedb -f biodiv_ssolnw.sql the output is: Processing 1/1: ags_473038164.tif BEGIN CREATE TABLE INSERT 0 1 INSERT 0 1 INSERT 0 1 INSERT 0 1 … … …. CREATE INDEX ANALYZE NOTICE:  Adding SRID constraint CONTEXT:  PL/pgSQL function addrasterconstraints(name,name,name,boolean,boolean,boolean,boolean,boolean,boolean,boolean,boolean,boolean,boolean,boolean,boolean) line 53 at RETURN...

pyKML - a Python library for generating and parsing KML

Image
pyKML   is an open source Python library for generating, parsing, and modifying   KML , the geo-spatial data language used by Google Earth, Google Maps and a number of other GIS platforms. pyKML helps working with large and complex KML documents by leveraging the use of basic programming constructs (looping, branching, etc.). In this regard pyKML is similar to   libkml , Google’s open source C++ library, but takes advantage of the highly readable syntax of the   Python   programming language and the processing capabilities of the popular   lxml   Python library. pyKML v0.1.0 documentation :  http://packages.python.org/pykml/ Source: Google Geo Developers Blog

How to connect spatial database(PostGIS) with QGIS?

Image
In this section, I am showing the 3 basic steps to connect PostGIS database with a widely used open source desktop based gis, QGIS.  Step1: Install PostGIS with Spatial database support extension i.                     If PostgreSQL is already installed è Launch ‘Application stack builder’ from startup menu in windows 7. ii.                   Select the appropriate instance of PGSQL from dropdown list and Click NEXT. iii.                 Expand ‘Categories’ è Expand ‘Spatial Extensions’ è Select appropriate PostGIS version(1.5)  for the already installed PGSQL version(8.4). iv.                     Follow the instructions to inst...