SharpTools

February 6, 2007

FwTools 1.2.0 released.

Filed under: Uncategorized — cgraefe @ 11:11 pm

 

Today Frank Wamerdam released its FwTools version 1.2.0 . This release includes full featured Windows binaries of GDAL 1.4.0 . There are also C# bindings for GDAL included, which is from now on my base for getting any SharpMap GDAL/OGR based layer/provider working.

Just some short instructions to getting it working together with SharpMap.

– Download and install FwTools on your machine.

– Add “yourdrive:\program dir\FwTools1.2.0\bin”  to your PATH variable of your system environment. Please keep in mind, that this updated PATH isn’t available immedatly.

– In the SharpMap.Extensions projects just reference the following managed assemblies: gdal_csharp.dll, gdalconst_csharp.dll, ogr_csharp.dll, osr_csharp.dll located in yourdrive:\program dir\FwTools1.2.0\csharp

– Just compile and get happy.

– If are your want to use this in a hosting environment and you are not able to install FwTools as described above, then you have to copy all *.dll files  from yourdrive:\program dir\FwTools1.2.0\bin into the bin folder of web application.

 

regards

Christian

Advertisements

January 17, 2007

HowTo use the Ogr provider with MapInfo files

Filed under: HowTo,SharpMap — cgraefe @ 10:32 pm

 

In my last weblog entry I announced the redesigned Ogr provider for SharpMap.
Now I will describe in short how to use it in your own GIS projects.

1. Compile the latest change set of SharpMap

– Download the latest change set from the SharpMap project page and extract it.
– Also don’t forget to loaded the dependencies for compiling SharpMap.Extensions properly. Dependencies.zip & DependenciesForGdal.zip
– In the folder SharpMap you open the SharpMap.sln with Visual Studio
– The SharpMap.Extensions needs the following references: NetTopologySuite.dll, Npgsql.dll, Mono.Security.dll, PostgreSql.Data.PostgreSqlClient.dll, Oracle.DataAccess.dll, gdal_gdalconst_csharp.dll, gdal_ogr_csharp.dll, gdal_osr_csharp.dll, gdal_gdal_csharp.dll
– Also copy all the other dll’s from Gdal’s dependencies into your Debug/Release folder, because they do the “magic” wrapping work.
– Now should SharpMap compile fine with the extensions included.

 

2. Reference the extensions in your code

– Don’t forget to reference the SharpMap and SharpMap.Extensions assembly we created in the step before. And also copy all not managed dll’s into your Debug/Release folder. This are the Gdal wrapping dlls (*_wrap.dll) and the Gdal14.dll .

 

3. Use the Ogr provider

This is really simple. Just hack it as usual.

SharpMap.Map mymap = new SharpMap.Map(mapImage1.Size);
SharpMap.Layers.VectorLayer vLayer = new SharpMap.Layers.VectorLayer(“OgrSample”);
vLayer.DataSource = new SharpMap.Data.Providers.Ogr(@”D:\GeoData\MapInfo\World.TAB”);

mymap.Layers.Add(vLayer);
mymap.ZoomToExtents();
mapImage1.Map = mymap;

 

4. Enjoy it!

🙂

Best regards
Christian – Mainz/Germany

January 15, 2007

Redesigned OGR vector support in SharpMap!

Filed under: SharpMap — cgraefe @ 6:29 pm

 

Since change set 16268 SharpMap uses the new C# swig bindings of GDAL 1.4 . Tamas Szekeres implemented many important type maps to make the C# swig bindings useable. Thanks for this great work.

Although i don’t like the automatic swig based api, i prefer this way of using GDAL in SharpMap, because i get rid of the old GDALWrapper. This one wasn’t easy to maintain and took a lot of time for me and many others.

The new OGR Provider allows you to read any vector format supported by GDAL. (e.g. GML, MapInfo, MySQL, U.S. Census TIGER/Line, SQLite and many more) Look here for more information .

You can find the files the OGR Provider depends on at the CodePlex project page of SharpMap. See under “Extensions” on the “Home” tab.

If you like to use the binaries for you own GIS projects, just refrence the *_csharp.dlls. But you have to copy the other dlls as well, because they do the magic wrapping stuff.

I will show some examples of using these C# swig bindings in the near future.

Christian

January 14, 2007

My first posting

Filed under: SharpMap — cgraefe @ 11:26 pm

Hello GIS-World!

From now on I will blog regulary about SharpMap, a wounderful GIS mapping engine written in pure C# and I will blog about things I get in touch while working on SharpMap.

Create a free website or blog at WordPress.com.