This project has moved and is read-only. For the latest updates, please go here.

show raster(WGS84) in google map tiles(WebMercator)

Topics: SharpMap Project
Apr 11, 2013 at 9:37 AM
Edited Apr 11, 2013 at 9:58 AM
HI list

Here are what I have done:
  1. downloaded GoogleMap "PNG" tiles using filechache to My local PC;
  2. built a winform to show those tiles using filetileprovider;
  3. added some shapefiles and rasterfiles to the winform;
My question is:

I have rasters in WGS84 CS (lat/lon form), the GoogleMap tiles are in EPSG:9009013 CS ,how can I use those rasters in GoogleMap .

I think I have two options . change the rasters' CS or change the tiles' CS . I have read this thread . it seems that it is impossible to reproject a raster on the fly (?). AS to change the CS of the GoogleMap tiles on the fly , change the way the files are organized ? change the way I cache those tiles? how can I do it

I'm using sharpmap 1.0

Apr 11, 2013 at 12:33 PM
You are right, tiles cannot be reprojected

You can assign a CoordinateTransformation to the GdalRasterLayer. I suppose it might transform your raster image, I must admit, I havn't tried. If it does it is probably terribly slow.

If you are familiar with GDAL command line tools, you can use gdal_warp to reproject your image to the desired projection, beforehand. That's what I would do.

Hth FObermaier
Apr 11, 2013 at 2:18 PM
Edited Apr 11, 2013 at 2:53 PM
thanks FObermaier

I am wondering if I build a WGS84 Schema to generate the tiles can I solve this problem?

I'll try the GDAL in c# to reproject the raster ,

another question is that I have several images which only the center of the image has coordinate, can I use those images to build a rater layer
Apr 12, 2013 at 8:21 AM
The TmsTileSchema is using the [-180, 180], [-90, 90] envelope