Thinking in GIS

a blog about GIS from a urban geogeek working for humanitarian emergencies

Feed, Categories, Archives


The PostGIS cookbook is here!

Posted: January 24, 2014
Categories: python, PostgreSQL, GIS, PostGIS
Feedback: View Comments

After 18 months of hard work in our spare time, the PostGIS cookbook has been finally published!The book, in a friendly tutorial fashion, covers a plethora of PostGIS related topics such as:Importing and exporting dataVectorial and Raster management and analysis functionsUsing desktop clients such as QGIS, OpenJump, gvSIG and UDigpgRouting and how to use the Nth dimensionwriting PostGIS programs with Pythonusing PostGIS to do web GIS with web mapping engines and frameworks such as MapServer, GeoServer, OpenLayers, Leaflet and GeoDjangomaintenance, optimization and performance tuningThanks to the other authors - Steve, Bborie and Thomas - for the huge effort done in...
Read the full post

The power of GDAL virtual formats

Posted: March 08, 2012
Categories: python, qgis, mapserver, GIS, GDAL
Feedback: View Comments

GDAL is most likely the most powerfull GIS toolset out there, with very geekish features that may seem complicated at first, but become extremely powerful and simple at the same time once you master them. One of these features I most like is the virtual format concept, valid both for raster data sources (GDAL) and for vectorial data sources (OGR).Basically GDAL gives to the user a very simple mechanism to create virtual formats from some different sources.Let's analyze this feature, with a couple of samples derived from real world scenarios I have been envolved in the last weeks.GDAL gives the...
Read the full post

Python for geospatial developers

Posted: February 03, 2012
Categories: geodjango, GIS, shapely, python, owslib, pyproj, qgis, mapserver, mapnik, fiona, geopy, GDAL
Feedback: View Comments

There is a recurring question at GIS mailing lists, forum and at some extent in my mailbox: what is the best way to master Python for developing geospatial applications?I myself had this question far away in 2006 when I started switching from proprietarysoftware to Open Source, and had identified in Python the way to go.In this post I will try to quickly summarize what is the best way to go in my opinion.If you are completely new to Python, first things to check out, are some very basic and popular resources, like these ones:the official Python tutorialthe "Dive into Python...
Read the full post

Playing with the Esri File Geodatabase and the Google Fusion Tables GDAL drivers

Posted: January 10, 2012
Categories: GIS, GFT, GDAL
Feedback: View Comments

Today in the GDAL mailing list Frank Warmerdam has announced that GDAL 1.9.0 has finally been released.Being a major new release, it offers many new features, but what I was waiting for is the support for Esri File GDB and Google Fusion Table.So I couldn't resist to install it and giving a try.For using the File Geodatabase driver I had to dowload the Esri File Geodatabase API (you need to be registered for downloading it).It was then just a matter of setting the value of the library path in the LD_LIBRARY_PATH variable, and using the --with-fgdb GDAL configuration option when...
Read the full post

Managing documentation's translations with Open Source tools

Posted: January 05, 2012
Categories: Sphinx, GIS, po4a, reST
Feedback: View Comments

Today together with Paolo Cavallini, I have been trying to figure out a workflow for managing documentation's translations for QGIS.There are many tools for managing documentation workflows out there: a common approach to which I have been exposed by following both the Python and the OSGeo communities is to keep the documentation source files in the reStructured Text markup format, and to generate the end user documentation with tools like docutils and Sphinx to a bunch of different formats (i.e. html, odt, pdf, latex... just to name a few).Python documentation itself and two wide spread GIS projects like MapServer and...
Read the full post

PostGIS in action

Posted: April 25, 2011
Categories: books, GIS, Postgres, PostGIS
Feedback: View Comments

PostGIS in action has landed: finally a book about PostGIS, we were all missing it!A software project that has a public visibility since almost 10 years, with a large community and a long series of use cases, finally has its deserved book.I started using PostGIS in 2006 in a situation where the company I were working for at that time had to cut the cost of licenses and maintenance. Opting for FOSS gave us also the possibility to eliminate long administrative times needed to change any of the requirements in the licenses.But above all, we knew to select a technology...
Read the full post

A quick look at the WFS GDAL Driver

Posted: March 23, 2011
Categories: Python, WFS, GIS, GDAL, OGR
Feedback: View Comments

If you have ever tried to interact with a WFS (via a browser, or curl, or OpenLayers or whatever), you are fully aware that it has alway been a pain to interact with, and until now the only Python library that made life simpler was the excellent OWSlib by Sean Gillies (that, BTW, will deserve itself another post at this blog in the next weeks).But since some weeks, from the release of the GDAL version 1.8.0, a new toolset is available to GIS users and developers via the new included GDAL WFS Driver (that will now make good company to...
Read the full post

Compiling GDAL with Oracle Spatial support

Posted: March 22, 2011
Categories: Oracle Spatial, GeoDjango, GIS, GDAL
Feedback: View Comments

These are my quick notes for installing Oracle Instant Client on a Linux box (currently I have tested this on a Ubuntu 10.10 64 bit box and with Oracle 11.2 and GDAL 1.8.0), and then configuring GDAL for using Oracle (OCI and GeoRaster drivers support).Finally I will show how to configure GeoDjango to use an Oracle spatial database by using the Cx_Oracle Python library.First download Oracle Client files from here or here if you are on a 64 bit architecture.You need to download the following 3 zip archives:~/software/oracle$ lsinstantclient-basic-linux-x86-64-11.2.0.2.0.zip instantclient-sdk-linux-x86-64-11.2.0.2.0.zip instantclient-sqlplus-linux-x86-64-11.2.0.2.0.zipThen extract the archives to a location...
Read the full post

Why I have moved my blog to Blogofile

Posted: March 09, 2011
Categories: Python, blogofile, GIS
Feedback: View Comments

So, after five years of blogging I have sent my Wordpress blog to pension and I have moved my blog to Blogofile.You may wonder why I have moved my blog from a spread and fully featured platform to an almost unknown exotic one.Basically I wanted to have the following advantages:Python framework, with the possibility to write in this language plugins and extensionsability to write my blog posts offline, in a markup format like REST or Markdown, with viblog system able to generate static content from the posts written in the markup language, in a Sphinx fashion, without the overhead of...
Read the full post

After the GFOSS Day 2010, the Italian FOSS4G event

Posted: November 29, 2010
Categories: GIS, Shapely, conferences, Python, GeoAlchemy, GeoDjango, GDAL, Uncategorized
Feedback: View Comments

Last week I have been attending the GFOSS Day 2010 in Foligno, basically the FOSS4G Italian Event that is held every year.The conference was split in two days: in the first days a good number of workshop and tutorials were given, related to a number of geospatial technologies.In the second day there were the instutional talks, mostly related on the open data theme.This year I myself gave two talks at the conference: in the first day, togheter with Alessandro Pasotti, we have been giving an extended tutorial about developing geospatial software with Python, here are the slides:Developing Geospatial software with...
Read the full post

Geocoding in web applications: OpenLayers and geoPy to the rescue!

Posted: September 17, 2010
Categories: jQuery, GIS, Python, Django, OpenLayers, Tutorials, geopy, Uncategorized
Feedback: View Comments

In many situations, in your web applications, you will need a feature for geocoding an address, a city, a country...A possible approach is to use the Javascript API of the main geocoding services (Google Maps, Yahoo! Maps, GeoNames...).But as I have showed in a previous post, if you are using Python, there is an excellent API that will take care of this, without Javascript headaches: GeoPy.In this post I will show how to use geoPy, OpenLayers and a bit of JQuery to assemble a simple but nice tool for geocoding within OpenLayers.In my server code I will use Django but...
Read the full post

FOSS4G 2010 in Barcelona

Posted: September 11, 2010
Categories: GIS, conferences, Uncategorized
Feedback: View Comments

This year I was enough lucky to have the possibility to attend at the FOSS4G World conference in Barcelona (thanks to my company for having send me there!) - that has been run just this week, as many of you may already know.I just came back home yesterday night and until my impression are still very clear, I were thinking it is a good idea to post them here.The conference, as you may know, is held every year and is organized by OSGeo. They try to organize it every year in a different continent, and this year was the time...
Read the full post

The unity of all the sciences is found in Geography

Posted: February 02, 2010
Categories: GIS, Uncategorized
Feedback: View Comments

In Italy, recently, a new law is being discussed and if approved it will substantially reduce the hours Geography is taught in schools.My blog, together with other Italian mayor GIS related blogs, is going to support this petition by AIIG, Associazione Italiana Insegnanti Geografia (Geographic Teachers Italian Association):SCHOOLS WITHOUT GEOGRAPHYDoing geography at school means educating citizens of Italy and the world to be aware, independent, critical and responsible, to know how to live their lives within their environment, and how to change it in a creative and sustainable way, with an eye to the future.In the new curricula...
Read the full post

The Pinax Tutorial #5: Adding a comment system

Posted: December 21, 2009
Categories: Python, Django, devs, The Pinax Tutorial, Pinax, Tutorials, Uncategorized
Feedback: View Comments

In this part we will improve the Bookstore application: what I am going to show is how easy it is to add support for enabling comments for a book without writing from scratch another comment system (as you may already now, avoid rewriting things is the core philosophy of Pinax and Django).Basically, you could add this feature by using one of these two approaches (there may be other ones, but these are the most common):Django comments frameworkthe django-threadedcomments system, that - as suggested by its name - it offers support for comments in a threaded fashionYou will implement a commenting...
Read the full post

The Pinax Tutorial #4: Using avatars, pagination and profiles

Posted: December 19, 2009
Categories: Python, Django, devs, The Pinax Tutorial, Pinax, Tutorials, Uncategorized
Feedback: View Comments

In this part we will improve the Bookstore application and we will see how easy it is to add support for three core features that any web 2.0 sites is supposed to offer:support for avatarssupport for paginationsupport for user profilesIn Pinax you may use two kind of avatars for your users (in both case you may manage them from the Avatar page: http://localhost:8000/avatar/change/):gravatarscustom avatarsIn the first case Pinax will render your avatar using the gravatar you have associated to your email from the Gravatar web service. In the latter Pinax will use a custom avatar you have uploaded to the...
Read the full post

The Pinax Tutorial #3: Internationalization of the application

Posted: December 18, 2009
Categories: Python, Django, devs, The Pinax Tutorial, Pinax, Tutorials, Uncategorized
Feedback: View Comments

(Note that, if you completed the other parts of this tutorial before the date of this post, you need to move the PROJECT_ROOT/templates/bookstore directory in PROJECT_ROOT/bookstore/templates: so now you will have a PROJECT_ROOT/bookstore/templates/bookstore directory. I did so for a better deployment experience, and doing so I am following the Django best practices. If you are reading the pdf version of the tutorial or the REST documentation, then this documentation is already updated with the templates directory in the right place).In this part of the tutorial I will show how easy it is to enable your application for internationalization with Pinax.Enabling...
Read the full post

Using MongoDb to store geographic data

Posted: December 06, 2009
Categories: GIS, NoSQL, Python, MongoDb, devs, GDAL, Uncategorized
Feedback: View Comments

In the last months there has been a plenty of activity in the non relational (NoSQL) database world.NoSQL database tries to solve 3 main RDBMS problems:Scalability, for example the ability to automatically partitioning data across multiple machinesPerformance, in some case RDBMS can be very slowFixed schema: RDBMS have nice goodness (referential integrity, relationships, triggers...) but force you to store any object to a fixed schema (migrations are a pain!)Basically there are several different kinds of NoSQL database:Key/Value (Scalaris, Tokio Cabinet, Voldemort): store data in key/value pairs: very efficient for performance and higly scalable, but difficult to query and to implement...
Read the full post

The Pinax Tutorial #2: Developing the basic application and plugging it in Pinax

Posted: November 29, 2009
Categories: Python, Django, devs, The Pinax Tutorial, Pinax, Tutorials, Uncategorized
Feedback: View Comments

In this part of the tutorial you are going to create the core of the bookstore application, with all the pages that gives access to the CRUD (Create, Read, Update, Delete) features. And you are goint to plugin this basic application into Pinax.After finishing with this part you will have the core of the bookstore application working as desired. You will be able to:see a list with all the books in the bookstoreadd a new bookupdate and delete your bookssee a list of all books added by yousee a list of all books added by a userIn the following parts...
Read the full post

Geocoding with GeoPy

Posted: October 14, 2009
Categories: google, GIS, geonames, Python, yahoo, devs, geopy, Uncategorized
Feedback: View Comments

There are now may geocoding web services out there, like Google geocoder, Yahoo geocoder, geocoder.us (only for US address), Microsoft MapPoint, GeoNames and MediaWiki.Normally you may access this web services API directly with HTTP REST request, and get a response in common formats like , JSON, KML.For example you may geocode with the Google geocoder an address like this one: "1071 5th Avenue, New York, NY" with a request like this one:http://maps.google.com/maps/geo?q=1071+5th+Avenue,+New+York,+NY&output=json&oe=utf8&sensor=true_or_false=&key=your_apy_keyIn this case we are querying the Google geocoder web service to get a response in json via the output parameter in the query string. This is the...
Read the full post

The Pinax Tutorial #1: Installing Pinax and making basic customisation

Posted: October 10, 2009
Categories: Python, Django, devs, The Pinax Tutorial, Pinax, Tutorials, Uncategorized
Feedback: View Comments

I will assume you are installing Pinax v0.7 on a Ubuntu 9.04 box, but this procedure - with a few modifications, should work well on every Linux box. For Windows please refer to the Pinax official site or - rather I highly reccomend to use VirtualBox, and to create an Ubuntu 9.04 Virtual Machine, so you will be able to follow step by step this tutorial.There are ready images like this one, to make things even easier.As suggested from the official installation procedure, the release bundle has everything you need for running Pinax.What is not included is:Python;Python Imaging Library (PIL);SQLite.Ubuntu...
Read the full post

The Pinax Tutorial, Introduction for Web Designers

Posted: October 03, 2009
Categories: Python, Django, devs, The Pinax Tutorial, Pinax, Tutorials, Uncategorized
Feedback: View Comments

In the last weeks I was studing Pinax , an Open Source platform for building Django applications. While I enjoyed a lot learning how to develop software with this framework, and I am going to happily use it for a series of projects, I found a bit difficult to get documentation about it, if not reading the source code and the (few - at this time) documentation on the project web site.When I started, I decided to write a test application for understanding the Pinax philosophy before going for real development projects. I thought it would be very useful for...
Read the full post

A day with GeoDjango

Posted: April 01, 2009
Categories: OpenStreetMap, Python, PostGIS, Django, OpenLayers, GeoDjango, GDAL, Uncategorized
Feedback: View Comments

This time i will introduce a really brilliant framework that every serious Web/GIS developers should be aware of: GeoDjango.Django is a Python Web framework for agile developers. It implements best web frameworks practices like coding by convention, MVC, ORM, REST, URL dispatcher and so on. Django is for Python what Rails is for Ruby, Grails is for Java, and MonoRail (and now ASP.NET MVC) is for .NET.GeoDjango is a Django application that is now included in the Django trunk with a lot of excellent stuff for developing GIS web application.GeoDjango Building BlocksGeoDjango installation is based on Python, Django and two...
Read the full post

A day with TileCache: generating KML Super-Overlays

Posted: August 06, 2008
Categories: TMS, GIS, SharpMap, WMS, Python, MetaCarta, kml, FeatureServer, devs, Apache, MapServer, TileCache, OpenLayers, GeoServer, Tutorials, GDAL, Uncategorized
Feedback: View Comments

My friend Diego Guidi is the smartest GIS/.NET developer I personally know here in Italy. He is the developer of NetTopologySuite, the port in the .NET world of the popular Java's JTS Topology Suite from VIVID Solutions. I wanted, sooner or later, write some stuff here about WMS and TMS, and now I am very happy that Diego asked me to publish this brilliant article about this topic.First of all, let me thanks Paolo for hosting this post! I hope that this article can be interesting and useful like other stuff that you can find here...IntroductionThere are a lot of...
Read the full post

Spatial Database for Postgres and ArcGis users: how to choose

Posted: June 06, 2008
Categories: GeoServer, GIS, ArcIMS, QGIS, FeatureServer, uDig, ArcObjects, PostGIS, gvSIG, ArcGis Desktop, ZigGis, ArcSde
Feedback: View Comments

As many of you can have already read, ArcSDE for Postgres is coming out at ArcGIS 9.3 (it is currently in the release candidate state). It will let you store geometries in two formats, Esri geometry and PostGIS geometry, in the same fashion ArcSde for Oracle is letting Esri or Oracle geometries be stored. I have seen some interest in the GIS community about this new, and i was reading interesting posts by Bill Dollins, Paul Ramsey, James Fee and Dave Bouwman, so I thought i would post here my opinion. Plus, as some of you may already know, zigGis...
Read the full post

A day with FeatureServer #2

Posted: May 03, 2008
Categories: OpenStreetMap, Web2.0, GIS, WMS, Windows, Twitter, PostGIS, devs, Python, OpenLayers, FeatureServer, Ubuntu, WFS, Flickr, Uncategorized
Feedback: View Comments

In the previous post we have seen an introduction to FeatureServer, and we were just playing with the base edit sample, with the scribble layer.Now it is time to use FeatureServer with our datasets: I am assuming that you will want to create FeatureServer services for shapefiles, PostGIS layers, OpenStreetMap, Twitter and Flickr.Data preparation for this demo1) shapefilesIf you want to follow my steps, you can download the sample shapefiles of New York I was using to assemble this demo here: select New York as a state and then as a county, and download the Block Groups and the Roads,...
Read the full post

Next Page ยป