Affichage des articles dont le libellé est Qgis. Afficher tous les articles
Affichage des articles dont le libellé est Qgis. Afficher tous les articles

dimanche 9 juin 2013

OpenLayers : A great plug-in to display Google Maps (and others) in QGis

I just found a plug-in extension for QGis that would allow me to  add a number of image services to your map canvas :



Installing the Plugin

The OpenLayers plugin is installed like all other Python plugins. From the the Plugins menu in QGIS, choose Fetch Python Plugins. This brings up the plugin installer. To find the plugin, enter openlayers in the Filter box, then select OpenLayers Plugin from the list. Once it’s highlighted, click the Install plugin button. This will download the plugin from the repository, install it, and load it into QGIS.
 
Using the Plugin

The OpenLayers Plugin uses your view extent to fetch the data from the service you choose. For this reason you should load at least one of your own layers first. Since each of the services are expecting a request in latitude/longitude your layer either has to be geographic or you must enable on the fly projection.

To add one of the services you have two choices; you can pick the service from the Plugins->OpenLayers plugin menu or you can use the OpenLayers Overview. The Overview opens a new panel that allows you to choose a service from a drop-down list. Click the Enable map checkbox to enable the drop-down list and preview the service you want to add. If you are happy with what you see, you can add it to the map by clicking the Add map button.

samedi 2 mars 2013

How to connect spatial database(PostGIS) with QGIS?



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

  • If PostgreSQL is already installed è Launch ‘Application stack builder’ from startup menu in windows 7.
  • Select the appropriate instance of PGSQL from dropdown list and Click NEXT.
  • Expand ‘Categories’è Expand ‘Spatial Extensions’ è Select appropriate PostGIS version(1.5)  for the already installed PGSQL version(8.4).
  • Follow the instructions to install the PostGIS extension.



Step2:  Loading spatial data into PostGIS
  • Open the PgAdmin window (above installation should install a ‘Shapefile to PostGIS importer’ plugin.)
  • Select the database and click on ‘Plugins’ and select ‘Shapefiel to PostGIS importer’ plugin.
  • If the plugin is not available under the ‘Plugins’. We can also get it from “C:\Program Files (x86)\PostgreSQL\8.4\bin\postgisgui\shp2pgsql-gui.exe”


  • Select the desired shp file to put into PostGIS.
  • We need to put the appropriate SRID for the imported file. SRID column contains datum information of the imported shapefile into the PostGIS. There are unique SRID for the different projection and datum types.
  •  Above step feeds the spatial information into the database with two additional fields, one for vector geometry id and another for vector geometry with datum information.



Step3:  Retrieving spatial data from PostGIS into Web based applications and Desktop based applications.


  • We can view and project above data using Qgis(An open source GIS alternative to ESRI’s ArcGIS) in desktop based environment. Similarly, we can use Geoserver or UMN Mapserver view data in the Web.
  • The core technologies behind Qgis and GRASS are similar. Qgis is easy to use, support GDAL, Python, PostGIS, and has nice GUI. In the same time we can get strength of GRASS by calling GRASS’s functionality form   the QGIS. 
  • Install Qgis 
  • Open the Qgis --> Click layer--> select ‘Add from PostGIS’, which gives you the following windows.






  •  Click connect, you should able to see the shape layer as below.

  • Finally you will able to see the vector layer in the layer and this layer can be treated as an ordinary shp. file added in the ESRI ArcMap.