Show shp and tiff file on same map

Mar 3, 2015 at 12:13 AM
Hi guys

Im totaly new to DotSpatial so i apologize in advance if this is a silly question.
is it possible to show both shp and tiff files on Map object at once?
I succeded at showing only one type at once (depends which type i load first).

Thanks!
Developer
Mar 3, 2015 at 6:47 AM
Yes normally you can show both file types on a Map.
Mar 3, 2015 at 7:21 AM
Edited Mar 3, 2015 at 7:21 AM
Well then i am doing something wrong.

Image

As you can see on this image. First i added RL0533C shp image and it is showing fine on the map as you can see.

But when i add image file like P10004.TIF it can't be shown even if i uncheck shp file.

Same thing happens when i load TIF file first.
Then SHP files are not shown.
Developer
Mar 3, 2015 at 7:55 AM
  1. Are you sure that both layers are in the same region?
  2. Can you see both layers for themselfes if you rightclick them in legend and click on zoom to layer?
  3. Can you see both layers if you add your files to DemoMap?
Mar 3, 2015 at 9:13 AM
Edited Mar 3, 2015 at 9:13 AM
Yes you are correct. "Zoom to layer" solves the problem.
But why is this happening? Why such distance between images and shp files?
Oh and one more thing. For every layer i try to add i get this popup:

Image

Is maybe this responsible for such large distance between images?

Thanks for all your help in advance.
Developer
Mar 3, 2015 at 9:54 AM
Yes that could be the reason for the distance between your files. Your files are most probably based on different coordinate systems.

GIS programs use coordinate systems to figure out where to show files. They prefere every layer to have the same coordinate system.
If that is not the case or if your layer is missing a coordinate system you get the info that the coordinate system is missing/ differs from the map's coordinate system.

DotSpatial gives you the possibility to set the coordinate system if it is missing. That is the window you got.

What you have to do now is to find out what the coordinate systems of your files are and add them to your files!

If you know the coordinate system click on the button with the ... and look whether you can find the coordinate system. Select it if it exists. Afterwards save the layer and look whether you can find a {added filename}.prj - file next to the file you saved the coordinate system for.

If both files have the same coordinate system and are drawn at the correct positions they should be shown as you expected.
If they have different coordinate systems you can either hope that they show up at the correct position or translate one file to the coordinate system of the other file.
Mar 3, 2015 at 5:29 PM
Well i think i solved the problem. I have TIF image file with .tfw file data. Program completely ignores tfw file. When i renamed .tfw file to .wld everything works. Why is that?

Thanks in advance
Developer
Mar 3, 2015 at 6:48 PM
I'm not sure why that happens. If you want send me the tif and tfw to check what happens in code.
Mar 3, 2015 at 7:02 PM
Thanks!
Here is the link:
https://www.dropbox.com/s/90sw71rcy3brpfr/vaja1.rar?dl=0

It's rar file that contains TIFF image (map of Slovenia) and .twf file.
Developer
Mar 3, 2015 at 7:08 PM
Can't download that. I don't have a dropbox account.
Developer
Mar 4, 2015 at 10:40 AM
Your image has an uppercase ending. Those were ignored while getting the correct worldfile ending. This was corrected with changeset #75590.
Marked as answer by jany_ on 3/4/2015 at 3:41 AM