Thinking in GIS
a blog about GIS from a urban geogeek living at the countryside
PostGIS in action
Posted: April 25, 2011Categories: 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
Read the full post
A day with GeoDjango
Posted: April 01, 2009Categories: 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
Read the full post
Spatial Database for Postgres and ArcGis users: how to choose
Posted: June 06, 2008Categories: 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
Read the full post
A day with FeatureServer #2
Posted: May 03, 2008Categories: 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
Read the full post
Do you get errors in the mapscript c# tutorial?...
Posted: February 29, 2008Categories: GIS, Windows, .NET, PostGIS, devs, MapServer, Tutorials
Feedback: View Comments
...well, this is the solution to your problems (at least I hope so).I am continuing receiving emails from people in despair that cannot successfully use this tutorial. I am sorry but I cannot answer to all this emails, so I thought to write this post in order to allow people to configure it correctly.BTW, this demo is still working since 2 years without any problems, and the code there is just the same you can download from this blog. So it must work also for you ;-)So if you just cannot use it, this is a check list:If you receive...
Read the full post
Read the full post
A day with FeatureServer #1
Posted: February 21, 2008Categories: Python, GIS, gvSIG, WMS, Windows, uDig, PostGIS, devs, QGIS, FeatureServer, Ubuntu, Apache, WFS
Feedback: View Comments
Some friends already spoke me well about FeatureServer by Metacarta in the last weeks, so I already was waiting for having a bit of time to get started with it. Then James posted this on his blog, and my curiosity was definitely fired.So I decided to spend a day for installing and testing it, without thinking of the lack of documentation (FeatureServer is still a young project, so no wonder here if the only way to get infos is digging in the source code and posting to the mailing list). The day I considered to spend on it then spawned...
Read the full post
Read the full post
Installing PostGIS on Ubuntu
Posted: January 30, 2008Categories: GIS, gvSIG, QGIS, uDig, PostGIS, devs, Ubuntu
Feedback: View Comments
With this post I will show how to install PostGIS 1.2.1 on Postgres 8.2.5 in Ubuntu 7.10 (but this procedure should work also for previous PostGIS/Postgres/Ubuntu versions) from repositories.I will also show you how to load and secure GIS data and how to access them with some cool OS GIS Client (QGIS, UDig and gvSIG).If you use this instructions together with my previous post, you will have a fully functional GIS Server Open Source Ubuntu workstation!-1- Install PostgresIf you haven't Postgres, you need to install it (PostGIS runs on top of it). Open an Ubuntu terminal, and type:sudo apt-get install...
Read the full post
Read the full post
Union of two geometries in PostGIS
Posted: March 30, 2007Categories: devs, PostGIS
Feedback: View Comments
For people not familiar with the Spatial SQL, I post this quick sample showing its beauty and simplicity at the same time.We will go using PostGIS, but this could be performed in a similiar way with any GIS Database compliant with OGC Simple Feature Access - SQL Option.The geomunion functionThe geomunion Open GIS function make it possible to combine two geometries and getting from these a single geometry.FUNCTION geomunion(geometry, geometry) RETURNS geometryIt is very easy to generate a geoprocessed layer from an original layer, making an union of its polygons based on a common attribute.I will show you how...
Read the full post
Read the full post
zigGis 1.2 released
Posted: March 21, 2007Categories: ArcGis Desktop, ZigGis, GIS, PostGIS
Feedback: View Comments
zigGIS 1.2, the Open Source ArcGIS Desktop's connector to PostGIS, has just been released and you can download it here.This is a major release, as far it implements new important features like selections and rendering. At this time editing is still not supported (so it is still a read only connector).Also ArcMap documents persistence is now fully supported, meaning that you can save your mxd document with your PostGIS layer in them, and then open them again without problems.zigGIS should correctly work with ArcGis 9.0 (sp3), 9.1 and 9.2. Before installing it don't forget to install .NET support for ArcGis.Here...
Read the full post
Read the full post
PostGis WorkspaceFactory
Posted: February 21, 2007Categories: GIS, .NET, ArcObjects, devs, PostGIS, ArcGis Desktop, ZigGis, COM
Feedback: View Comments
In my previous post I have showed you how to install and using zigGIS for adding PostGIS data into ArcMap.From the ArcMap user interface you just need to press the zigGIS button and an "Add PostGIS data" dialog will be shown to you. From there you can set a zig File path, where PostGIS connections settings are stored, and then a PostGIS layers list will be shown and you can check which layer(s) add to the map.In this post I will show how to programmatically use zigGIS and ArcObjects to add PostGIS data into ArcMap.zigGIS is a Microsoft .NET 2.0...
Read the full post
Read the full post
Installing zigGIS 1.1 for connecting ArcMap to PostGIS layers
Posted: February 14, 2007Categories: GIS, .NET, ArcObjects, devs, PostGIS, ArcGis Desktop, ZigGis, COM
Feedback: View Comments
zigGIS is an Open Source PostGIS connector for ArcGIS Desktop, that enables ArcMap to add PostGIS layers in the map.Differently from other kinds of connectors, like for example PgArc, the very nice feature of zigGIS is the direct-read of PostGIS data, without the needs of proxy shapefiles. This meaning that the PostGIS features are directly readed and displayed in ArcMap from the PostGIS data source without a previous conversion to a Shapefile or personal GDB.This is a very interesting project, but still in a very early phase, in fact there are still important issues that are planned to be solved...
Read the full post
Read the full post
Full OSS solution vs OSS/commercial solution mix
Posted: January 19, 2007Categories: Java, .NET, ArcObjects, devs, PostGIS, GIS, ZigGis, CMS
Feedback: View Comments
I wanted to leave a comment in this Bill Dollin's post, but after that it came out to my mind to leave a trackback to it, and going with a my own post on this subject as far as I have several things to discuss about.In the OSS jungle, it looks there are in the last times more and more solutions and projects based on commercial closed-code software. For example zigGIS, the Open Source ArcGIS connector for PostGIS, in which I am involved, is by itself an OS project tied to proprietary frameworks (Microsoft and Esri). This is many times...
Read the full post
Read the full post
MapServer Tutorial for C# mapscript (ASP .NET)
Posted: September 20, 2006Categories: GIS, .NET, PostGIS, devs, MapServer, Tutorials, Uncategorized
Feedback: View Comments
This tutorial will try to guide you step by step in implementing a GIS (Geographic Information Systems) web solution, based on Open Source software (MapServer), within the .NET Framework.The tutorial is designed to work with Visual Studio 2003 and .NET 1.1, but you will easily be able to perform all the necessary steps to complete it using another version of Visual Studio (ie: Visual Studio 2005) or other IDEs (like Visual Web Developer 2005 Express Edition or even the notepad). It will work also using .NET 2 as c# mapscript is .NET 2 compatible.The tutorial is focused to people with...
Read the full post
Read the full post
Adapting C# code to work indifferently with shapefile or PostGIS layers (c# mapscript tutorial, part 8)
Posted: September 14, 2006Categories: GIS, .NET, PostGIS, devs, MapServer, Tutorials
Feedback: View Comments
In this section we will adapt the ASP .Net Tutorial to work both with shapefiles or with PostGIS layers.The only c# code that needs to be modified is only the code that updates the point layer.The tutorial is composed of basically 2 methods that update a point layer:the first method adds a point and its attributes to the point layer (AddPoint method)the second method delete all the points from the point layer (butClear_Click)After you will terminate this step the tutorial will work both with shapefiles and PostGIS layers.Adding a reference to PostgreSQL .NET dll to the Visual Studio solutionYou will...
Read the full post
Read the full post
Connection MapFile layer to PostGIS (c# mapscript tutorial, part 7)
Posted: August 01, 2006Categories: GIS, .NET, PostGIS, devs, MapServer, Tutorials
Feedback: View Comments
First I am going to show the difference between connecting the MapFile to a Shapefile layer and to a PostGIS layer, then I will show how to adapt your MapFile to work with PostGIS.Shapefile ConnectionHere is a sample connection from MapFile to a shapefile called "compfun".First you need to declare the path to the shape data (SHAPEPATH).Then for each shapefile layer you have to set the shapefile's data source (DATA) that is the name of the shapefile.Here the shapefile is named compfun.shp so DATA is set to "compfun".Note that NAME can be anything, it means how in your MapFile want...
Read the full post
Read the full post
Migrating shapefiles to PostGIS (c# mapscript tutorial, part 6)
Posted: July 27, 2006Categories: GIS, .NET, PostGIS, devs, MapServer, Tutorials
Feedback: View Comments
What is PostGISPostGIS is an extension for PostgreSQL RDBMS that spatially enables it for storing GIS content.It could be considered something similiar to Esri ArcSDE or Oracle Spatial.In fact PostGIS is for PostgreSQL what is Esri ArcSDE for Oracle, MS SQL Server, Informix, DB2.PostGIS is OGC compliant and is Open Source, released under the GNU General Public License.For more info about PostGIS you can take a look here.PostGIS InstallationFirst, if it is not on your RDBMS Server, you have to download and install PostgreSQL. Refer to the PostgreSQL's Web Site for doing so.After you have succesfully installed PostgreSQL, you...
Read the full post
Read the full post
Implementing the C# mapscript code (c# mapscript tutorial, part 5)
Posted: July 26, 2006Categories: GIS, .NET, PostGIS, devs, MapServer, Tutorials
Feedback: View Comments
Add reference to mapscriptAdd the reference to mapscript_csharp.dll (browse to the mapscrip installation folder, for example C:ms4wApachecgi-binmapscriptcsharp):{{:MapServer:tutorial:add_reference.jpg|:mapserver:tutorial:add_reference.jpg}}Remember that if you didn't set PATH environment variable to the MapServer dlls you will need to manually copy them under the bin folder of this ASP .NET application.moreThe c# code for Default.aspx pageThis is the complete code to add for the Default.aspx page:using System;using System.Collections;using System.ComponentModel;using System.Data;using System.Drawing;using System.Web;using System.Web.SessionState;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.HtmlControls;using System.Data.OleDb; //for dbf connectionusing System.IO; //for copying the point shapefilenamespace TutorialMapServer{ /// /// User Interface for c# MapServer Tutorial ///...
Read the full post
Read the full post
Designing the tutorial user interface (c# mapscript tutorial, part 4)
Posted: July 26, 2006Categories: GIS, .NET, PostGIS, devs, MapServer, Tutorials
Feedback: View Comments
Create an ASP .NET C# ProjectOpen Visual Studio, create a new ASP .NET C# Project called TutorialMapServer:Insert application key value in web.configOpen web.config and add the following appSettings section under configuration section:<configuration> <appSettings> <!-- Path to MapFile --> <add key="mapFilePath" value = " C:\training\mapServerTutorial\data\csharptutorial.map" /> </appSettings> <!-- ........ --></configuration>For the key mapFilePath be sure to put the right path to the map file (also a relative path is valid).Create the main web formAdd a WebForm called...
Read the full post
Read the full post
Creating the MapFile and data configuration (c# mapscript tutorial, part 3)
Posted: July 03, 2006Categories: GIS, .NET, PostGIS, devs, MapServer, Tutorials
Feedback: View Comments
Creating the MapFileFor what is a MapFile and a reference about it you can view the MapFile Reference at MapServer web site. Here you can download the data, map file and fonts needed for this tutorial. Extract data.zip wherever you think in your hard disk, for example at c:trainingmapserverTutorialdata. Open the map file named csharp_tutorial.map: MAPNAME "Zone Samples"SHAPEPATH "C:\training\mapServerTutorial\data"SIZE 400 400STATUS ONEXTENT 1143759 4417539 1146436 4420390UNITS METERS FONTSET "fonts\fonts.list" WEB IMAGEPATH "C:\Inetpub\wwwroot\temp" IMAGEURL "C:\Inetpub\wwwroot\temp"ENDSYMBOL NAME "circle" TYPE ellipse FILLED true POINTS 1 1 ENDENDLAYER NAME "compfun" TYPE...
Read the full post
Read the full post
Installing MapServer (c# mapscript tutorial, part 2)
Posted: July 03, 2006Categories: GIS, .NET, PostGIS, devs, MapServer, Tutorials
Feedback: View Comments
Download MapServerDownload precompiled binaries here. For the purpose of this tutorial is indifferent if you download the MS4W for PHP4 or PHP5. (As an alternative you could download an installation toolkit like this and compile yourself MapServer, but it is more difficult).InstallationAll you need to do is to extract the zip file, for example at: C:ms4w.Here we will not mention how to install cgi MapServer, because we are using the other modality (MapScript).After doing that take a look at the structures of the directories created under C:ms4w. All the references we need in our C# ASP .NET (or Windows) application...
Read the full post
Read the full post
Introduction to MapServer Web GIS development environment (c# mapscript tutorial, part 1)
Posted: July 02, 2006Categories: GIS, .NET, PostGIS, devs, MapServer, Tutorials
Feedback: View Comments
What is MapServer?According to MapServer official site:MapServer is an Open Source development environment for building spatially-enabled internet applications. MapServer is not a full-featured GIS system, nor does it aspire to be. Instead, MapServer excels at rendering spatial data (maps, images, and vector data) for the web.MapServer was originally developed by the University of Minnesota (UMN) ForNet project in cooperation with NASA and the Minnesota Department of Natural Resources (MNDNR). Presently, the MapServer project is hosted by the TerraSIP project, a NASA sponsored project between the UMN and consortium of land management interests.The software is maintained by a growing number of...
Read the full post
Read the full post
MapScript C# Tutorial - Programming MapServer in the ASP .NET Framework
Posted: July 01, 2006Categories: GIS, .NET, PostGIS, devs, MapServer, Tutorials, Uncategorized
Feedback: View Comments
In the next stops I will write a tutorial about programming MapServer with .NET c#.This tutorial will try to guide you step by step in implementing a GIS (Geographic Information Systems) web solution, based on Open Source software (MapServer and PostGIS), within the .NET Framework.How to download the tutorialThe tutorial's data needed to complete this tutorial are downloadable here. In any case the tutorial is made in a way that you can easily adapt to use your own data (shapefiles).Here you can find a complete working Visual Studio 2003 solution (ASP .NET 1.1) with the whole tutorial's solution. moreTake...
Read the full post
Read the full post