Register  |  Login
ThinkGeo - GPS Tracking and Mapping Solutions  |  Home  |  Cygnus Track  |   Code Community

Discussion Forums

The online community for users of Map Suite GIS components

Non smooth panning
Last Post 07-23-2009 10:29 PM by Yale. 29 Replies.
Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Page 2 of 2 << < 12
Author Messages
TracyUser is Offline
Level 3
Level 3
Posts:63

--
07-03-2009 10:19 PM

Hi Yale,

Attached two map screenshots, one from msn map and one from thinkgeo web demo. 

 

I tried with google map and yahoo map as well but it seems thinkgeo map is somewhat stretched compared to others.

Thanks,

Tracy

YaleUser is Offline
MVP
MVP
Posts:1212
Avatar

--
07-05-2009 09:09 PM

Tracy, 

Thanks for your post!
 
I do not think there are “somewhat stretched” compare to Google/VE/Yahoo. The only potential difference is that we use different data instead. We use the Tiger data to render our maps in maps.thinkgeo.com, while the others seems using the NavteqData.
 
 
We provide some functionality to use the Google/Yahoo/VE as background and render our own data on top of it in WebEdtion. If you are interested, just have a look at the following samples in WebEdtion to compare the drawing bitmaps.
 
HowDoISamples/Samples/ Overlays/ UseGoogleMap.aspx
HowDoISamples/Samples/ Overlays/ UseVirtualEarth.aspx
HowDoISamples/Samples/ Overlays/ UseYahooMap.aspx
 
We also provide some on-line samples for WebEditon, you can use it if you do not want to install it on your local PC.
 
 
Let me know if you have more problems.
 
Thanks.
 
Yale
code.thinkgeo.com
PatrickUser is Offline
Level 4
Level 4
Posts:260

--
07-06-2009 03:18 AM
Yale,

The difference takes place in the projection.

Usually, when data are in wgs84, tools display them using a perpendicular projection to the center of the map; where MS use a perpendicular projection to the equator; this makes every data streched in the Y axis. I feel this as a MS bug; but anyway a very easy workaround is to projette the map to either:
- a projection that works every where (google projection or miller projection)
- a local projection (I dont' know which projection are relevant for that map.

Hope this helps.
Patrick.
YaleUser is Offline
MVP
MVP
Posts:1212
Avatar

--
07-06-2009 03:39 AM
Thanks for your sharing, Patrick!

I am not sure about this idea about the perpendicular projection up to now; I will do some investigation about it! Thanks for your answer and hints!


Let me know if you have more problems.

Thanks.

Yale
code.thinkgeo.com
TracyUser is Offline
Level 3
Level 3
Posts:63

--
07-07-2009 10:54 PM

Thanks for the idea, Patrick. 

I believe my data is in wgs84 since in the corresponding .prj file, I found the following:

GEOGCS["Lat Long WGS84",DATUM["D_WGS84",SPHEROID["World_Geodetic_System_of_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]]

I did the following but once I added the projection, the map doesn't want to render anymore. 

 

 


private void Form1_Load(object sender, EventArgs e)
        {
            winformsMap1.MapUnit = GeographyUnit.Meter;
            winformsMap1.BackgroundOverlay.BackgroundBrush = new GeoSolidBrush(GeoColor.GeographicColors.DeepOcean);

            LayerOverlay staticOverlay = new LayerOverlay();
            
            RectangleShape recShp = new RectangleShape(0,0,0,0);
            winformsMap1.CurrentExtent = recShp;
            

            ShapeFileFeatureLayer layer = new ShapeFileFeatureLayer(@"C:\WebServiceImageServer\NEW_CAN\Islands_region.shp", ShapeFileReadWriteMode.ReadOnly);

           
            layer.Open();
            winformsMap1.CurrentExtent.ExpandToInclude(layer.GetBoundingBox());
            layer.Close();
            
            layer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
            layer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(AreaStyles.Country1);
            layer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle.OutlinePen.LineJoin = DrawingLineJoin.Round;

            Proj4Projection proj4 = new Proj4Projection();
            proj4.ExternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString();
            proj4.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(4326);
            proj4.Open();
            
            layer.FeatureSource.Projection = proj4;
            winformsMap1.StaticOverlay.Layers.Add(layer);

            winformsMap1.Refresh();
}

Thanks in advance!

YaleUser is Offline
MVP
MVP
Posts:1212
Avatar

--
07-07-2009 11:04 PM

Tracy,

 Try the following code, hopefully it works.
 

private void Form1_Load(object sender, EventArgs e)
        {
            winformsMap1.MapUnit = GeographyUnit.Meter;
            winformsMap1.BackgroundOverlay.BackgroundBrush = new GeoSolidBrush(GeoColor.GeographicColors.DeepOcean);

            LayerOverlay staticOverlay = new LayerOverlay();

            RectangleShape recShp = new RectangleShape(0, 0, 0, 0);
            winformsMap1.CurrentExtent = recShp;


            ShapeFileFeatureLayer layer = new ShapeFileFeatureLayer(@"C:\WebServiceImageServer\NEW_CAN\Islands_region.shp", ShapeFileReadWriteMode.ReadOnly);

            layer.FeatureSource.Projection = proj4;
            layer.Open();
            winformsMap1.CurrentExtent.ExpandToInclude(layer.GetBoundingBox());
            layer.Close();

            layer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
            layer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(AreaStyles.Country1);
            layer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle.OutlinePen.LineJoin = DrawingLineJoin.Round;

            Proj4Projection proj4 = new Proj4Projection();
            proj4.ExternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString();
            proj4.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(4326);
            proj4.Open();

            
            winformsMap1.StaticOverlay.Layers.Add(layer);

            winformsMap1.Refresh();
        }
 
Let me know if you have any problems!
 
Thanks.
 
Yale
code.thinkgeo.com
TracyUser is Offline
Level 3
Level 3
Posts:63

--
07-08-2009 10:26 PM
Hi Yale,

Thank you very much for your reply about the projection. I got it working now.

I need help on the old question about the file size for my webserver. I have about 9 layers I draw by calling mapEngine.DrawStaticLayers(bitMap). I then saved it in a file. It has 3MB when I looked at it in windows explorer. When I just leave one layer in the mapEngine, the file size is still 3MB. When I had 9 layers, the data size in bitmap (number of bytes) is much higher than 1 layer. Do you think 1 layer should give a smaller file size?

Thanks,
Tracy
YaleUser is Offline
MVP
MVP
Posts:1212
Avatar

--
07-08-2009 10:46 PM
Tracy Thanks for your post and I am glad to hear your progress!

The bitmap file size mostly depends on its format, for example, the .png file format will mostly smaller than the .bmp file format.

But for a given format, just like the .bmp file format, the file size will NOT change unless you changed the size of it, for example, if you change the bitmap size from 512 * 512 to 1024 * 1024, it will probably grow 4 times of its size. But when you only add data or remove data for its drawing, its size will not change, because the pixel number of it will not change.

Any more question just let me know!

Thanks.

Yale
code.thinkgeo.com
TracyUser is Offline
Level 3
Level 3
Posts:63

--
07-15-2009 01:32 PM
Hi Yale,

I'm still looking for ways to increase the performance in drawing an image. I'm wondering whether InMemoryFeatureLayer is supposed to be faster than ShapeFileFeatureLayer? I suposed In MemoryFeatureLayer loads data into memory? So, if I load all my shape files into InMemoryFeatureLayers, will it increase the time of drawing?

I also came across this article, http://gis.thinkgeo.com/Support/DiscussionForums/tabid/143/aff/16/aft/5266/afv/topic/Default.aspx, is it something I can use to increase the performance as well? If so, do I just create IndexedInMemoryFeatureLayer and add it to the mapControl static layer to draw?

Thanks,
Tracy
YaleUser is Offline
MVP
MVP
Posts:1212
Avatar

--
07-15-2009 08:41 PM

Tracy,

Thanks for your post!
 
Try the code below to see it works, I think you should set the projection before and then set the current extent of the MapControl.
 
I did not test against it because of lack of data.

winformsMap1.MapUnit = GeographyUnit.Meter;
winformsMap1.BackgroundOverlay.BackgroundBrush = new GeoSolidBrush(GeoColor.GeographicColors.DeepOcean);

LayerOverlay staticOverlay = new LayerOverlay();
Proj4Projection proj4 = new Proj4Projection();
proj4.ExternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString();
proj4.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(4326);
ShapeFileFeatureLayer layer = new ShapeFileFeatureLayer(@"C:\WebServiceImageServer\NEW_CAN\Islands_region.shp", ShapeFileReadWriteMode.ReadOnly);
layer.FeatureSource.Projection = proj4;
           
layer.Open();
winformsMap1.CurrentExtent = layer.GetBoundingBox();
layer.Close();

layer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
layer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(AreaStyles.Country1);
layer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle.OutlinePen.LineJoin = DrawingLineJoin.Round;

winformsMap1.StaticOverlay.Layers.Add(layer);

winformsMap1.Refresh();

Any more questions just let me know.

Thanks.
 
Yale
code.thinkgeo.com
TracyUser is Offline
Level 3
Level 3
Posts:63

--
07-16-2009 01:13 PM
Hi Yale,

I don't get how your last post is related to the InMemoryFeatureLayer and the IndexedInMemoryFeatureLayer. Would you clarify a bit?

Thanks,
Tracy
YaleUser is Offline
MVP
MVP
Posts:1212
Avatar

--
07-16-2009 09:44 PM
Tracy,

I am sorry, Tracy, I think I must have misplaced some else post here! Do not mind it if you are interested.

Sorry for the misunderstanding.

Thanks.

Yale
code.thinkgeo.com
YaleUser is Offline
MVP
MVP
Posts:1212
Avatar

--
07-16-2009 09:44 PM
Posted By Tracy on 07-15-2009 12:32 PM
Hi Yale,

I'm still looking for ways to increase the performance in drawing an image. I'm wondering whether InMemoryFeatureLayer is supposed to be faster than ShapeFileFeatureLayer? I suposed In MemoryFeatureLayer loads data into memory? So, if I load all my shape files into InMemoryFeatureLayers, will it increase the time of drawing?

I also came across this article, http://gis.thinkgeo.com/Support/DiscussionForums/tabid/143/aff/16/aft/5266/afv/topic/Default.aspx, is it something I can use to increase the performance as well? If so, do I just create IndexedInMemoryFeatureLayer and add it to the mapControl static layer to draw?

Thanks,
Tracy
Tracy,
 
Of course, the InMemoryFeatureLayer will be faster than ShapeFileFeatureLayer, but you know the InMemoryFeatureLayer will keep all data in memory, so I DONOT think it is suitable for very large data size application.
 
For IndexedInMemoryFeatureLayer , it will somehow increase some performance at the cost of more memory usage.
 
So, If you data size is very small (for example, less than 1000 features or so), I think you can use InmemoryFeatureLayer for usage for best performance, but I guess it is not your application case.
 
For large data size, I suggest you using the tile cache system with some pre-generating tiles, you know this system is almost finished and it is probably will be available in next release.
 
Let me know if you have more questions.
 
Thanks.
 
Yale



 

code.thinkgeo.com
TracyUser is Offline
Level 3
Level 3
Posts:63

--
07-23-2009 10:20 PM
Hi Yale,

I have a street.shp that is 310,059K. If I divide them into 10 smaller regions equally and they do not overlap at all, each file now has about 31005.9K. Now I create one layer for each smaller shape file but add them all to an overlay still so that I don't lose any map data. Will this method increase the performance compared to having one large layer that is 10 times bigger?

Also I'm considering using MultipleShapeFileFeatureLayer. Is it gonna make any difference if adding 5 shape files to one MultipleShapeFileFeatureLayer instead of adding 5 ShapeFileFeatureLayers?

Thanks,
Tracy




YaleUser is Offline
MVP
MVP
Posts:1212
Avatar

--
07-23-2009 10:29 PM
Tracy,

If you just use it for showing the Map without any spatial query, I think there would be no big difference between a large shape file and split it into multiple shapes.

Besides, personally I think your case is very suitable to sue MultipleShapeFileFeatureLayer, the code would be much cleaner by using MultipleShapeFileFeatureLayer and the data number would be much less.

Let me know if I am not clear enough or any more questions.

Thanks.

Yale
code.thinkgeo.com
You are not authorized to post a reply.
Page 2 of 2 << < 12


Active Forums 4.1