Quantcast
Channel: SharpMap Wiki & Documentation Rss Feed
Viewing all 90 articles
Browse latest View live

New Comment on "Tutorial - Creating a Form with a MapControl"

$
0
0
I have a problem at this line: this.mapBox1 = new SharpMap.Forms.MapBox(); There is an TypeInitializationException, and the InnerException says: "Could not load file or assembly 'GeoAPI, Version=1.7.0.0,..." Anyone could help?

New Comment on "Add a Label layer"

$
0
0
i'm get error: An entry with the same key already exists.

New Comment on "Tutorial - Creating a Form with a MapControl"

$
0
0
@YaoTheMing Read the info about remapping GeoAPI in the comments sections of the release fo RC2 Add this to your app.config <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="GeoAPI" publicKeyToken="a1a0da7def465678" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-1.7.1.0" newVersion="1.7.1.0" /> </dependentAssembly> </assemblyBinding> </runtime>

New Comment on "Tutorial - Creating a Form with a MapControl"

$
0
0
sharpMap.Map type initializer threw an exception

New Comment on "Configure GDAL OGR FWTools (as of revision 57193)"

$
0
0
I followed the steps above and my code compiles and displays my image in the correct location over a .shp vector map in the VS2010 c# debugger. However, when I launch the executable outside VS2010 it just dies before displaying anything. I comment out the raster layer and it runs properly when launching the executable and displays the .shp. Am I missing something??

Updated Wiki: Configure GDAL/OGR based on Nuget packages

$
0
0

Configure GDAL/OGR based on Nuget packages

  1. Add a reference to SharpMap.Extensions project
  2. Add a reference to GDAL.Native nuget package
    1. Open the NuGet Package Manager Consoloe
    2. Type and execute install-package GDAL.Native -version 1.9.2
  3. (Optional) Add a reference to GDAL.Plugins nuget package
    1. Open the NuGet Package Manager Consoloe
    2. Type and execute install-package GDAL.Plugins -version 1.9.2

If you install GDAL.Plugins, you must either
  • have an Oracle Client installed or
  • manually remove ogr_OCI.dll from the gdal\[x86|x64] folders in the output directory.

Updated Wiki: Configure GDAL OGR FWTools (as of revision 57193)

$
0
0

Important notice:

The information provided in this document targets the use of GDAL via FWTools. This approach is obsolete and only valid for SharpMap v0.9 based on changesets prior to revision 100922. Nowadays we use the GDAL binaries and CSharp bindings provided by Tamas Szekeres. The tutorial for setting up these is here: Configure GDAL/OGR based on Nuget packages.

Configuring GDAL OGR FWTOOLS as of revision 57193

  • 2 In the [app|web].config of your app you must add the following key value pair to your appSettings element

<addkey="FWToolsBinPath"value="path to the *bin* folder where you unpacked fwtools 2.4.7"/>

if you do not have an [app|web].config file you must create one

e.g:

<configuration><appSettings><addkey="FWToolsBinPath"value="c:\FWTools2.4.7\bin"/></appSettings></configuration>

Additional settings for GDAL OGR FWTools (as of revision 64184)

If you want to take the most out of GDAL/OGR you can supply the following settings as well:
<addkey="FWToolsProjLib"value="c:\FWTools2.4.7\proj_lib"/><addkey="FWToolsGeoTiffCsv"value="c:\FWTools2.4.7\data"/><addkey="FWToolsGdalData"value="c:\FWTools2.4.7\data"/><addkey="FWToolsGdalDriver"value="c:\FWTools2.4.7\plugins"/>
Certainly you need to provide the paths that fit your environment.
If you use another FWTools version, you must replace the csharp bindings and must update the above settings to your installation

Updated Wiki: Configure GDAL/OGR based on Nuget packages

$
0
0

Configure GDAL/OGR based on Nuget packages

  1. Add a reference to SharpMap.Extensions project
  2. Add a reference to GDAL.Native nuget package
    1. Open the NuGet Package Manager Console
    2. Type and execute install-package GDAL.Native -version 1.9.2
  3. (Optional) Add a reference to GDAL.Plugins nuget package
    1. Open the NuGet Package Manager Console
    2. Type and execute install-package GDAL.Plugins -version 1.9.2

If you install GDAL.Plugins, you must either
  • have an Oracle Client installed or
  • manually remove ogr_OCI.dll from the gdal\[x86|x64] folders in the output directory.

New Comment on "Tutorial - Creating a Form with a MapControl"

$
0
0
Hello, I have a same problem like yangzhonlin, sharpMap.Map type initializer threw an exception Can anybody provide helps?

Updated Wiki: Home

$
0
0
SharpMap is an easy-to-use mapping library for use in web and desktop applications. It provides access to many types of GIS data, enables spatial querying of that data, and renders beautiful maps. The engine is written in C# and based on the .Net 4.0 framework. SharpMap is released under GNU Lesser General Public License.
rule.png

SharpMap on NuGet

The SharpMap-Team proudly presents NuGet packages for SharpMap.
ComponentNuGet command
SharpMap CoreInstall-Package SharpMap
SharpMap WinForms User interfaceInstall-Package SharpMap.UI
SharpMap WebServer componentsInstall-Package SharpMap.Web
Additional SharpMap providers and layersInstall-Package SharpMap.Extensions

rule.png
 

New:SharpMap automatic builds, automated tests and more.
rule.png
Tutorial for beginners
If you are new to SharpMap we have added some tutorial-material to get you starting, see the Documentation page or directly: SharpMap Tutorial
rule.png
Provider for Esri's File Geodatabase
A new provider has been added to access feature data stored in Esri's File Geodatabase. It is at an early stage and you are invited to test it. It uses Esri's File Geodatabase API SDK, so it is limited to file geodatabases of version 1.2 (created with ArcGIS 10)
rule.png
Use SqlServer Spatial Objects with SharpMap
The new project SharpMap.SqlServerSpatialObjects offers a converter between SqlGeometry and SharpMap.Geometries. Also included are static classes for SpatialRelation- and SpatialOperation functions.
rule.png
General interest: a new mailing list for people doing geo-spatial on .net / mono platforms with oss tools http://lists.osgeo.org/mailman/listinfo/dotnet
rule.png
Please visit our SharpMap Supporters page.
rule.png

Getting Started Learning More About the Project
* Screenshots * Extensions * Roadmap
* Features * Data provider comparisons * Data formats supported
* Requirements * IRC chat
* FAQ
* How to...
* Architecture, v1.0 (UML) TableSpacer3Column.pngTableSpacer3Column.pngTableSpacer3Column.png


Useful External Resources

Updated Wiki: Home

$
0
0
SharpMap is an easy-to-use mapping library for use in web and desktop applications. It provides access to many types of GIS data, enables spatial querying of that data, and renders beautiful maps. The engine is written in C# and based on the .Net 4.0 framework. SharpMap is released under GNU Lesser General Public License.
rule.png

SharpMap on NuGet

The SharpMap-Team proudly presents NuGet packages for SharpMap.
ComponentNuGet command
SharpMap CoreInstall-Package SharpMap
SharpMap WinForms User interfaceInstall-Package SharpMap.UI
SharpMap WebServer componentsInstall-Package SharpMap.Web
Additional SharpMap providers and layersInstall-Package SharpMap.Extensions

rule.png

SharpMap continuous integration

 

SharpMap automatic builds, automated tests and more.
rule.png

Tutorial for beginners

If you are new to SharpMap we have added some tutorial-material to get you starting, see the Documentation page or directly: SharpMap Tutorial
rule.png

Provider for Esri's File Geodatabase

A new provider has been added to access feature data stored in Esri's File Geodatabase. It is at an early stage and you are invited to test it. It uses Esri's File Geodatabase API SDK, so it is limited to file geodatabases of version 1.2 (created with ArcGIS 10)
rule.png

Use SqlServer Spatial Objects with SharpMap

The new project SharpMap.SqlServerSpatialObjects offers a converter between SqlGeometry and SharpMap.Geometries. Also included are static classes for SpatialRelation- and SpatialOperation functions.
rule.png
!!General interest
A mailing list for people doing geo-spatial on .net / mono platforms with oss tools http://lists.osgeo.org/mailman/listinfo/dotnet
rule.png
Please visit our SharpMap Supporters page.
rule.png

Getting Started Learning More About the Project
* Screenshots * Extensions * Roadmap
* Features * Data provider comparisons * Data formats supported
* Requirements * IRC chat
* FAQ
* How to...
* Architecture, v1.0 (UML) TableSpacer3Column.pngTableSpacer3Column.pngTableSpacer3Column.png


Useful External Resources

New Comment on "Tutorial - Example 4: Adding a Tiled layer as Background"

$
0
0
Most of the ProjNet.CoordinateSystem classes have been moved into the GeoAPI library. If VS isn't recognizing the class, try replacing ProjNet with GeoAPI. You'll also have to add a reference to GeoAPI.dll.

New Comment on "Roadmap"

$
0
0
Can you Introduce other renderers More ? Such as opengl or DirectX ?

New Comment on "Ask for help"

New Comment on "Tutorial - Example 4: Adding a Tiled layer as Background"

$
0
0
Could somebody please update the sample code so that it works as is today??

Updated Wiki: Logging / Tracing SharpMap

$
0
0
SharpMap uses Common.Logging http://netcommon.sourceforge.net for logging purposes. This makes it possible to integrate sharpmap logging/tracing with other logging-frameworks such as log4Net and NLog.

For applications that does not provide any logging configuration no debug or trace messages will be output.

To get SharpMap to output log-information you could configure that with the app.config file

Configuration that outputs logging information to Console

This configuration tells SharpMap to trace all information to Console during execution.

You can change the log-level by changing from DEBUG to INFO, WARN, or ERROR to restrict logging only to important messages
  • DEBUG - Most information outputed, will make execution slower since some debug-information need to be calculated
  • INFO - Less information outputed, mostly informal messages about execution
  • WARN - Only warnings and Errors outputed
  • ERROR - Only error messages are outputed

<configSections>
<sectionGroup name="common">
<section name="logging" type="Common.Logging.ConfigurationSectionHandler, Common.Logging" />
 </sectionGroup>
</configSections>
<common>
    <logging>
      <!--Log to Console_-->
      <factoryAdapter type="Common.Logging.Simple.ConsoleOutLoggerFactoryAdapter, Common.Logging">
        <arg key="level" value="DEBUG" />
        <arg key="showLogName" value="true" />
        <arg key="showDateTime" value="true" />
        <arg key="dateTimeFormat" value="yyyy/MM/dd HH:mm:ss:fff" />
      </factoryAdapter>
    </logging>
  </common>

Log with Log4Net

For projects using Log4Net or NLog already it's an easy task to redirect SharpMap logging to those frameworks be adding a configuration like this

You need additional assemblies to be able to log to Log4Net or NLog, please see the Common.Logging web for information

Configure sections for Common.Logging and Log4Net
<configSections>
    <sectionGroup name="common">
      <section name="logging" type="Common.Logging.ConfigurationSectionHandler, Common.Logging" />
</sectionGroup>
    <section name="log4net"
         type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/>
  </configSections>

Configure Common.Logging to log to Log4Net
<common>
    <logging>
      <!-- Log with Log4Net -->
      <factoryAdapter type="Common.Logging.Log4Net.Log4NetLoggerFactoryAdapter, Common.Logging.Log4Net">
        <arg key="configType" value="INLINE" />
      </factoryAdapter>
    </logging>
  </common>

Configure Log4Net to output ALL messages to a textfile called log.txt
<!-- configures log4net to write into a local file called "log.txt" -->
  <log4net>
    <appender name="MainAppender" type="log4net.Appender.FileAppender">
      <param name="File" value="log.txt" />
      <param name="AppendToFile" value="true" />
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%date [%thread] %-5level %logger - %message%newline" />
      </layout>
    </appender>
    <root>
      <level value="ALL" />
      <appender-ref ref="MainAppender" />
    </root>
  </log4net>

Updated Wiki: Render a set of points from a database with X and Y columns

$
0
0

Rendering X and Y columns from a database as points

The OleDbPoint provider is used for rendering point data from an OleDb compatible datasource

The data source will need to have two double-type columns, xColumn and yColumn that contains the coordinates of the point, and an integer-type column containing a unique identifier for each row.

To get good performance, make sure you have applied indexes on ID, xColumn and yColumn in your datasource table.

//Connection stringstring connStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=database.mdb";
//Name of table in databasestring tablename = "pointsTable"; 
//Name of object ID column - MUST be integer!string oid = "ID"; 
//Name of X coordinate column - MUST be double!string xColumn = "X";
//Name of Y coordinate column - MUST be double!string yColumn = "Y";

//Initialize map object
SharpMap.Map myMap = new SharpMap.Map(new System.Drawing.Size(500,250));
//Create layer
SharpMap.Layers.VectorLayer layAddresses = new SharpMap.Layers.VectorLayer("Addresses"); 
//Set the datasource to the database
layAddresses.DataSource = 
    new SharpMap.Data.Providers.OleDbPoint(connStr, tablename, oid, xColumn, yColumn);
//Add layer to map
myMap.Layers.Add(layAddresses); 

//Zoom to extents
myMap.ZoomToExtents();

System.Drawing.Image img = myMap.GetMap(); //Render map

Updated Wiki: Documentation

$
0
0

Available documentation

I am new to SharpMap

If you are new to SharpMap, please follow these rules:
  1. Get the latest source code from Trunk, either by some client or by clicking here.
  2. Open the solution using VisualStudio 2010 or MonoDevelop.
  3. Compile, complain if it does not build.
  4. Build your Application using SharpMap within the SharpMap solution, or add the necessary SharpMap projects to your solution.
You will be rewarded with the latest SharpMap version and a series of example code snipplets / applications to get you started.

Tutorials for new users to SharpMap

We've created a tutorial for those who are new to SharpMap to get started
SharpMap Tutorial

Common pitfalls

Error: The type or namespace name 'SharpMap' could not be found
You probably have the wrong target-framework set in your project. You need to target the Full .NET 4.0 framework (default in Visual Studio new projects are targetted .NET 4 Client Framework)
Error: TypeLoadException in SharpMap.UI when Map is shown/initialized
This can happen if NetTopologySuite-dll is not loaded (and thereby sets the GeomeryServicesProvider in GeoAPI).
A workaround is that you in your code set
GeoApi.GeometryServicesProvider.Instance = new NetTopologySuite.NtsGeometryServicesProvider();
before the map is loaded

Why don't you provide signed assemblies

We are not providing signed assemblies for various reasons. If you need signed assemblies for your application to work properly, please sign them yourself. This is not a violation of the GPL and thus it applies, from our point of view, to the LGPL as well.

Logging / Tracing SharpMap

SharpMap supports logging to existing logging frameworks as NLog and Log4Net in addition to tracing directly to the Console.
See Logging / Tracing SharpMap for information about how to configure SharpMap to output trace/log messages

More How to...

Extensions

Updated Wiki: Documentation

$
0
0

Available documentation

Tutorials for new users to SharpMap

We've created a tutorial for those who are new to SharpMap to get started
SharpMap Tutorial

Common pitfalls

Error: The type or namespace name 'SharpMap' could not be found
You probably have the wrong target-framework set in your project. You need to target the Full .NET 4.0 framework (default in Visual Studio new projects are targetted .NET 4 Client Framework)
Error: TypeLoadException in SharpMap.UI when Map is shown/initialized
This can happen if NetTopologySuite-dll is not loaded (and thereby sets the GeomeryServicesProvider in GeoAPI).
A workaround is that you in your code set
GeoApi.GeometryServicesProvider.Instance = new NetTopologySuite.NtsGeometryServicesProvider();
before the map is loaded

Why don't you provide signed assemblies

We are not providing signed assemblies for various reasons. If you need signed assemblies for your application to work properly, please sign them yourself. This is not a violation of the GPL and thus it applies, from our point of view, to the LGPL as well.

Logging / Tracing SharpMap

SharpMap supports logging to existing logging frameworks as NLog and Log4Net in addition to tracing directly to the Console.
See Logging / Tracing SharpMap for information about how to configure SharpMap to output trace/log messages

More How to...

Extensions

Updated Wiki: Documentation

$
0
0

Available documentation

Tutorials for new users to SharpMap

We've created a tutorial for those who are new to SharpMap to get started
SharpMap Tutorial

Common pitfalls

Error: The type or namespace name 'SharpMap' could not be found

You probably have the wrong target-framework set in your project. You need to target the Full .NET 4.0 framework (default in Visual Studio new projects are targetted .NET 4 Client Framework)

Error: TypeLoadException in SharpMap.UI when Map is shown/initialized

This can happen if NetTopologySuite-dll is not loaded (and thereby sets the GeomeryServicesProvider in GeoAPI).
A workaround is that you in your code set
GeoApi.GeometryServicesProvider.Instance = new NetTopologySuite.NtsGeometryServicesProvider();
before the map is loaded

Why don't you provide signed assemblies

We are not providing signed assemblies for various reasons. If you need signed assemblies for your application to work properly, please sign them yourself. This is not a violation of the GPL and thus it applies, from our point of view, to the LGPL as well.

Logging / Tracing SharpMap

SharpMap supports logging to existing logging frameworks as NLog and Log4Net in addition to tracing directly to the Console.
See Logging / Tracing SharpMap for information about how to configure SharpMap to output trace/log messages

More How to...

Extensions

Viewing all 90 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>