Raster Layer

Sep 8, 2010 at 3:15 PM

Ciao,

how can i render a Raster Layer?  which is the best approach?

Thanks

Alberto

Coordinator
Sep 8, 2010 at 8:14 PM

Hello Alberto,

use GdalRasterLayer from the SharpMap.Extensions project. To see how it works, see Gdal samples of the WinFormsSamples project.

Hth FObermaier

Sep 8, 2010 at 8:19 PM

Ok FObermaier, i'll try tomorrow moarning @ office...       but anyway...    what about reprojection???   if, suppose, i would like to use the famouse nasa blue marble....    it is "plate carrè" (unprojected... let me say...) .....    but if i want to reproject in a google like projection?     does GDAL support reprojection??

 

and...    do you know elseway if GeoServer does it support reprojection on the fly???  

 

even if....    i'm thinking that we will need a cache tile server in the end.....       too much cpu power needed to make all on the fly no???

 

 

thanks

alberto

Developer
Sep 9, 2010 at 7:45 AM

There are some executables within  FWTools (which you need for the Gdalrasterlayer). One of them is Gdalwarp and this executable is able to reproject. I would suggest to run this executable each time you update your dataset and not to use it on the fly.

Sep 9, 2010 at 9:11 AM

Niceeee....     so with this executable i can project once my raster using my projection then i'll use that brand new raster mhmmm,  it sounds good!!!

 

anyway i found this version of FWTools  2.4.7  is it right to use that one?  

I read some comments regarding x64 operating systems...    what about?    does it runs under windows server 2008 64bit?

Thanks again!

Developer
Sep 9, 2010 at 9:18 AM

If you use the latest source, 2.4.7 will work together with Gdalrasterlayer

I don't have any experience with x64 systems, so I cannot help you with more info on specific problems there.

Sep 9, 2010 at 10:21 AM

ok i'll try this versione!  now i've done an update from svn...   many changes....    wao... . i'll work on win merge now...  eh eh eh

 

what about use of "using" for some WKT transformation stuff?!? should be better to dispose the StringReader! i've done this modify on my version!

 

 

 

     /// <summary>
        /// Converts a Well-known text representation to a <see cref="SharpMap.Geometries.Geometry"/>.
        /// </summary>
        /// <param name="wellKnownText">A <see cref="SharpMap.Geometries.Geometry"/> tagged text string ( see the OpenGIS Simple Features Specification.</param>
        /// <returns>Returns a <see cref="SharpMap.Geometries.Geometry"/> specified by wellKnownText.  Throws an exception if there is a parsing problem.</returns>
        public static Geometry Parse(string wellKnownText)
        {
            Geometry result = null;

            // throws a parsing exception is there is a problem.
            using (StringReader reader = new StringReader(wellKnownText)) {
                result = Parse(reader);
            }

            return result;
        }

Coordinator
Sep 9, 2010 at 12:00 PM

Alberto,

if you are on an x64 platform, be sure to set the platform  target of SharpMap projects to x86/win32, otherwise you'll get exceptions!

Hth FObermaier

 

Sep 10, 2010 at 2:18 PM

Waooo!!  it works... on x86  i'll try then even on an x64!...

 

but now...  what about authoring of a GeoTIFF or a georeferentied raster image???  

Sep 14, 2010 at 11:22 AM

If i set x86 i get error regarding the Oracle.DataAccess libary...

 

I'll try to make a "custom sharpmap extension" class library with just the minimum subset of reference i need...

 

anyone other has ideas?