This project has moved. For the latest updates, please go here.

Ogr Provider error

Topics: SharpMap Project
Jul 16, 2009 at 6:38 AM

I am trying to work on display of s57 data using SharpMAp. I have compiled the Ogr data-provider as part of c# extensions and included its reference in my project. But it is throwing an exception when i execute the following code:

            SharpMap.Map mymap = new SharpMap.Map();
            SharpMap.Layers.VectorLayer vlayer = new   SharpMap.Layers.VectorLayer("OgrSample");
            vlayer.DataSource = new SharpMap.Data.Providers.Ogr("US5TX51M.000");


the exception details are as follows :



Method 'GetGeometriesInView' in type 'SharpMap.Data.Providers.Ogr' from assembly 'SharpMap.Extensions, Version=0.9.3484.21452, Culture=neutral, PublicKeyToken=null' does not have an implementation.


Please guide me on this issule :)

Jul 16, 2009 at 9:22 AM

Hi rubinasultan it sounds like you have mismatched versions of the extensions and sharpmap projects - as you can see from the method is definately implemented. Try building the whole library from source - and reference the resulting dlls or project. hth jd

Jul 17, 2009 at 3:42 AM

Hi johndiss..

I downloaded the Change Set 55102 available at the following linek... which was posted by u in the last abouve post:

1) I tried to compile the solution placed in (Trunk\SharpMap.Sln)

In the file OGCFilter_FE1_1_0.cs, im getting syntax error on the line no: 153
: base(new[] {propertyName, arg})

the error is type expected..

similarly im also getting many syntax errors in tht solution...

2) I tried to compile solution in (Branches\0.9\SharpMap)

Even it is not compiling properly..

Simlilry i tried all other solutin files but they are not compiling successfully...

As I am supposed to render an s57 file , so i think sharpmapv2 is better choice, for that purpose , please help me in successfully compiling the sharpmap.sln files... to get the required dlls

Jul 17, 2009 at 8:42 AM
Edited Jul 17, 2009 at 8:43 AM

Hi Rubina, what version of visual studio are you using? trunk/SharpMap.VS2008.sln definately builds in vs 2008 - I no longer run any instances of VS2005 so I cannot test. I don't think sharpmap v2 will help you with s57 files yet, as no work has yet been done to incorporate Ogr or GDAL hth jd

Jul 17, 2009 at 2:34 PM

Hi John ...


i was using vs2005 to compile sharpmap.sln not sharpmap.vs2008.sln (both placed in trunk)... but now im able to correct all the syntactical errors for sharpmap.sln placed in trunk .. it compiled well ..and i got the required dll's ...


but still im getting exception whn i execute the above program ... one of the other applications based only on gdal/ogr has the *_wrap.dll as well as *_csharp.dll ... other thn tht thy also hv one gdal16.dll placed in debug folder... but for sharpmap i hv installed fwtools 2.2.0 and also placed the csharp and wrap dll's but im not able to locate one additinal dll (gdal16.dll) in bin of fwtools 2.2.0 .... do u know from where to get tht dll from .. .or wht other easy way of configuring gdal for sharpmap

Do u hv any idea wht the issue over here is ? i have also placed the data folder from fwtools 2.2.0 ...


Other thn those compilation issues and exception i hv one more querry ... as u hv mentioned earlier tht sharpmapv2 has no work on suport of ogr.. can i display s57 using the changset 55102(sharpmap.sln or sharmap.vs2008.sln placed in trunk) ? I am making these efforts to display the vector data of s57 format... is it possible to tht using sharpmap ?


best regards



Jul 17, 2009 at 3:27 PM

Hi again, I don't really use GDAL/ OGR and I have no experience of s57 but afaik if OGR can read it, sharpmap can read it.. However you will have to stick to the sharpmap trunk on codeplex as other versions do not yet have GDAL or OGR implemented hth jd