Thinking in GIS

a blog about GIS from a urban geogeek living at the countryside

Feed, Categories, Archives


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

Do you get errors in the mapscript c# tutorial?...

Posted: February 29, 2008
Categories: 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

Installing MapServer on Ubuntu

Posted: January 10, 2008
Categories: GIS, devs, MapServer, Ubuntu, Apache, Uncategorized
Feedback: View Comments

With this post I will show hot to install MapServer 4.10.3 in Ubuntu 7.10 (but this procedure should work also for previous Ubuntu versions) from repositories.1) set Ubuntu sources needed for this softwareAdd universe ( http://archive.Ubuntu.com/gutsy/universe ) and multiverse repositories to your sources (by default are not in Ubuntu)sudo gedit /etc/apt/sources.listand uncomment this two lines:deb http://archive.ubuntu.com/ubuntu/ gutsy-security main restricted universe multiversedeb-src http://archive.ubuntu.com/ubuntu/ gutsy-security main restricted universe multiversesave the sources.list file and then then update your sources:sudo apt-get update2) Install MapServernow download and install MapServer:sudo apt-get install cgi-mapserver mapserver-bin mapserver-doc php5-mapscript python-mapscriptMapServer 4.10.3 will be installed (latest of MapServer 4.x serie,...
Read the full post

MapFlashViewer Framework: ASP .NET Implementation (C#)

Posted: October 27, 2006
Categories: devs, MapServer, .NET, GIS, ArcIMS
Feedback: View Comments

It is very easy to get started with the MapFlashViewer Framework in the ASP .NET Implementation (C#) I talked about in this post. This implementation was written using ActiveX Connector for ArcIMS 9.0 and C# MapScript for MapServer 4.10.0. You can easily adapt the code for previous or next versions.Open the solutionYou will find several files in the C# ASP .NET project included with the solution you downloaded:A simple default.aspx web form with the MapControl user control over itA form test.aspx for debugging purpose (you don’t need unleass you are in troubles)the Controller (responsable for translating request/response to the...
Read the full post

MapFlashViewer Framework

Posted: October 26, 2006
Categories: devs, MapServer, .NET, GIS, ArcIMS
Feedback: View Comments

MapFlashViewer Framework is a simple Flash viewer for several (even any, if someone intends to write an implementation) internet map server (at the moment I wrote an implementation for Esri ArcIMS and MapServer).You can view a working demo of MapFlashViewer for Esri ArcIMS here and the same working demo (with same data) for MapServer here.Why using Flash?It has always been a pain writing web user interface for web mapping. The most common approach is to write javascript client code to perform the main GIS actions (zooming, panning, etc etc).There is also some example of Java applet GIS web interface, but...
Read the full post

MapServer Tutorial for C# mapscript (ASP .NET)

Posted: September 20, 2006
Categories: 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

Adapting C# code to work indifferently with shapefile or PostGIS layers (c# mapscript tutorial, part 8)

Posted: September 14, 2006
Categories: 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

Connection MapFile layer to PostGIS (c# mapscript tutorial, part 7)

Posted: August 01, 2006
Categories: 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

Migrating shapefiles to PostGIS (c# mapscript tutorial, part 6)

Posted: July 27, 2006
Categories: 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

Implementing the C# mapscript code (c# mapscript tutorial, part 5)

Posted: July 26, 2006
Categories: 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

Designing the tutorial user interface (c# mapscript tutorial, part 4)

Posted: July 26, 2006
Categories: 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

Creating the MapFile and data configuration (c# mapscript tutorial, part 3)

Posted: July 03, 2006
Categories: 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

Installing MapServer (c# mapscript tutorial, part 2)

Posted: July 03, 2006
Categories: 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

Introduction to MapServer Web GIS development environment (c# mapscript tutorial, part 1)

Posted: July 02, 2006
Categories: 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

MapScript C# Tutorial - Programming MapServer in the ASP .NET Framework

Posted: July 01, 2006
Categories: 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