C# .NET not recognising Sharpmap.Geometry

834 Views Asked by At

I am trying to follow a SharpMap tutorial from the official sharpmap documentation here: http://sharpmap.codeplex.com/wikipage?title=Create%20a%20map&referringTitle=How%20to...

My problem is that Visual Studio underlines the Geometry part of the SharpMap instance as an error. Its says "the type or namespace 'Geometry' does not exist in the namespace 'SharpMap' (are you missing an assembly reference?)"

What can I do to resolve this error? (Please note: I have added all the references available for SharpMap).

enter image description here

3

There are 3 best solutions below

2
On

It clearly says: "Are you missing an assembly reference?".Which possibly means you have to add a reference.

Go to the Solution Explorer and right click on References.

Then click Add Reference and search for SharpMap or Geometry etc.

And then check the References you want and hit OK

0
On

In Sharpmap 1.1

Sharpmap.Geometry

is replaced by

GeoAPI.Geometries.Coordinate

Try it out

0
On

Years later, I thought I'd add what we came up with =)

You need additional references it seems, these are the usings we came up with to replace/complement the previous usings:

using GeoAPI.CoordinateSystems;
using GeoAPI.CoordinateSystems.Transformations;
using GeoAPI.Geometries;
using NetTopologySuite.Geometries;
using ProjNet.CoordinateSystems;
using ProjNet.CoordinateSystems.Transformations;
using SharpMap;
using SharpMap.Data;
using SharpMap.Data.Providers;

And the packages are:

Refactoring needed. For example, Point is replaced with GeoAPI.Geometries.Coordinate.