ThinkGeo.com    |     Documentation    |     Premium Support

How to load georeferenced images like .bmp

I’m trying to load a geo-referenced .bmp file. You can get the file here: https://www.dropbox.com/s/lsfpamt97ciw2or/WholeEarth56.bmp?dl=0

I tried using NativeImageRasterLayer but no luck. In the future I might want to load jpgs as layers as well, and geo tiffs. What’s the correct way to do this?

Hi Dan_Weaver,

We created one sample to show you how to image file. Please refer below attachment.

NativeImageRasterLayer needs a world file which contains image extent info. If the world file doesn’t exist, you need to apply a image extent to layer.

If you have any questions, please feel free to contact us.

NativeImageDemo.zip (794.5 KB)

Thanks
Mark

Hey thanks for the response!

Your app works fine, I can’t get it working correctly in my own solution though. It seems to concern projections.

All my shapefiles that I am loading on the map are adhering to the following projection:
Proj4Projection proj4Projection = new Proj4Projection();
proj4Projection.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(4326);
proj4Projection.ExternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(3857);

So the internal projection is a cartesian projection, and the external is a mercator type projection. My mapunit is also in meters.
Attached is a zip file containing the main shape file I’m using.
AppData.zip (2.5 MB)

Hi Dan,

It also works well with your data.

Please try it and see whether it works for you.

WebApplication5.zip (2.4 MB)

Regards,

Ethan

Hey Ethan, I think you misunderstood. I don’t have problem loading the shapefiles. I do have a problem lining up the bitmap with the shapefiles. The bitmap gets all weird when I try projecting it to the same projection as my shapefiles. Also when I try setting the map in meters.

Hi Dan,

I see what’s your target.

Because your image is for 4326, and it’s image, so we cannot make it match the 3857 files.

If you use 4326 projection, it can match like this:

If you want to make the image match 3857, please find another image which is under 3857.

Regards,

Ethan