Jul
27
Migrating shapefiles to PostGIS (c# mapscript tutorial, part 6)
Filed on July 27th, 2006 at 10:34 pm under .NET, devs, GIS, MapServer, PostGIS, Tutorials | 3 Comments
What is PostGIS
PostGIS 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 Installation
First, 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 can add the PostGIS module. For doing so refer to the PostGIS's Web Site.
Jul
26
Implementing the C# mapscript code (c# mapscript tutorial, part 5)
Filed on July 26th, 2006 at 10:28 pm under .NET, devs, GIS, MapServer, PostGIS, Tutorials | 18 Comments
Add reference to mapscript
Add the reference to mapscript_csharp.dll (browse to the mapscrip installation folder, for example C:\ms4w\Apache\cgi-bin\mapscript\csharp):
{{: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.
Jul
26
Designing the tutorial user interface (c# mapscript tutorial, part 4)
Filed on July 26th, 2006 at 10:21 am under .NET, devs, GIS, MapServer, PostGIS, Tutorials | Comments Off
Create an ASP .NET C# Project
Open Visual Studio, create a new ASP .NET C# Project called TutorialMapServer:

Insert application key value in web.config
Open 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).
Jul
3
Creating the MapFile and data configuration (c# mapscript tutorial, part 3)
Filed on July 3rd, 2006 at 10:53 pm under .NET, devs, GIS, MapServer, PostGIS, Tutorials | Comments Off
Creating the MapFile
For 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:\training\mapserverTutorial\data.
Jul
3
Installing MapServer (c# mapscript tutorial, part 2)
Filed on July 3rd, 2006 at 8:49 pm under .NET, devs, GIS, MapServer, PostGIS, Tutorials | 8 Comments
Download MapServer
Download 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).
Installation
All 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 are the dll under:
C:\ms4w\Apache\cgi-bin\mapscript\csharp and the dll under C:\ms4w\Apache\cgi-bin.
The only .NET dll is C:\ms4w\Apache\cgi-bin\mapscript\csharp\mapscript_csharp.dll.
For all the other dlls is enough for them to be accessible for our application. To get this it is possible to operate in two ways:
- for every .NET project manually copy these dll under bin
- or simply put the path to all these dll under PATH Windows environment variable.
Note that not even a dll need to be registered on Windows (with REGSVR32), so when your application will be complete you could easily FTP it to your web server host.
Jul
2
Introduction to MapServer Web GIS development environment (c# mapscript tutorial, part 1)
Filed on July 2nd, 2006 at 6:54 pm under .NET, devs, GIS, MapServer, PostGIS, Tutorials | Comments Off
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 developers (nearing 20) from around the world and is supported by a diverse group of organizations that fund enhancements and maintenance.
Jul
1
MapScript C# Tutorial - Programming MapServer in the ASP .NET Framework
Filed on July 1st, 2006 at 6:28 pm under .NET, devs, GIS, MapServer, PostGIS, Tutorials | 6 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 tutorial
The 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.