Hi.
I want to understand if there is an relation between the zoom scale and the resolution of and image.
The image is my map (LayerOverlay)
Lets explain my situation.
- I run the map in a screen with 1024x768 resolution
- I have JPG image that is my map (I use the class GdiPlusRasterLayer to load the JPG file to a LayerOverlay)
- The image have 1300x720 pixels resolution
- MapGeo - ZoomLevelSet - ZoomLeve01 - Scale = 590591790.0 - I think this is the default
- When I run and center the map to show all map , the parameters of the maps are:
- level 17
- current scale - 9011,72
So, with this, I know the lowest level for an image with 1300x720 is "level 17".
But if I have other map with others resolution, I have to first test the map to know the lowest level .
So what I am looking for is, if it is possible know what is the lowest zoom level, before show show the map.
And with this information set the map removing the levels that is not necessary.
Relation between Zoom Scale and JPEG Image Resolution
Hi Ricardo,
I think you should have a world file(.jgw) for your JPG file.
en.wikipedia.org/wiki/World_file
And you can find the suitable extent in this file.
Then, you can calculate current scale by ExtentHelper.GetScale function and remove the levels that’s not necessary.
Regards,
Don
Hi Don.
There is a reason for I uses JPG file.
Is because the maps i am using are plant of building (for example a flor of a building). And the objects (points, ,lines, …) in the map do not have coordinate in the real world.
Maybe this is not the right approach, but it is what is being used in my project.
If this is not the best approach, could you please advise me what is it? For in the future I change this.
Hi Ricardo,
Please allow me to do some explanations on the map suite scale and image resolution:
In a map application, in order to know an image position and display it on a map, we have to need to know what’s the scale and its extent in a real world. The scale means one pixel is equal to how many current map unit. In general, an map image always has a world file(.jpw) standing with it, the world file includes the information of its scale and its start or end point. With this world file, it would be easy to get its real extent.
In map suite, there are several ways to let map suite engine to know what’s the exact extent and then draw it on the map. For instance, we have an image named “world.jpg”:
1. have the “world.jpw” file. we can use the below line and then we should know its real extent:
GdiPlusRasterLayer rasterLayer = new GdiPlusRasterLayer(@“D:\TestData\imageData\world.jpg”);
rasterLayer.Open();
wpfMap1.CurrentExtent = rasterLayer.GetBoundingBox();
2. without world file, but we know its image extent.
GdiPlusRasterLayer rasterLayer = new GdiPlusRasterLayer(@“D:\TestData\imageData\world.jpg”, new RectangleShape(-10877.4060102612, 244139.832715426, 46832.4060102612, 198354.167284574));
Let’s back to your scenario, would you let me know if each images have its world file or not? if yes, then I have no idea why we need to get the lowest level? If no, its means we don’t care its coordinates, so we can pick up any world file as its and then can display it. Another question I am confusing is if there is no world file, would you let me know how you get the its scale and the level?
Hope those information is useful and any question please feel free to let us know.
Troy
Hi Troy
Thanks for your explanations.
I realised what I wanted do not make sense.
About your questions: each images have its world file or not?
- no would you let me know how you get the its scale and the level?
- to show each map, I set the following configurations: ZoomLevelSet to have 20 levels and to start in scale 590591790.0, and each zoom are equal the zoom before divided by 2 (zoom = zoom_before /2)
After run the map and click to center the map in Pan Bar, the map is updated for zoom level 17 (scale = 9011,72
).
Hi Ricardo,
I think the most important question is how you will place your images.
You know any image will be “pin” on a location of the map, but our map control don’t know this location.
So you need to provide this location, for example give a extent for one image, so our map engine will pin the image and shows it when you pan or zoom to target area.
We want to know your purpose, you want to shows all the images in any extent? Or you want to show them on a specified zoomlevel and scale, and give them a location?
Regards,
Don