Load a map from file?

Topics: General
Jun 6, 2012 at 9:56 PM

I have an app which will not have access to the internet. Can GMapControl load a geolocated map file from the hard drive?

Coordinator
Jun 6, 2012 at 11:31 PM

yes, cache is enabled by default

Jun 6, 2012 at 11:53 PM

So, what mode do I want for the map control, server & cache? And how dose this work, exactly. I have to load the map(s) up connected to the internet, then when disconnected from the internet, the maps will load? I have had trouble with this work 100%, not all of the tiles display and I get an error that the tile is not available.



Coordinator
Jun 7, 2012 at 10:49 AM

use tile prefetcher integrated in demos

Jun 7, 2012 at 3:44 PM

I have not seen any demos on this site - can you tell me where I can see an exmaple of using tile prefetcher?

Many Thanks.

Coordinator
Jun 7, 2012 at 4:15 PM

DOWNLOAD AND SEE

Jun 7, 2012 at 4:43 PM

OK, I found some code to prefetch:

http://greatmaps.codeplex.com/discussions/285159

Jun 7, 2012 at 4:52 PM

Radioman - It would be useful to have the project & code for the demo. I looked at the GMap.NET.WindowsPresentation download, the executable is there and some XML files, but no solution file (.sln). Without the .sln its not possible to open the project in Visual Studio. Is that available?

Thanks again.

Jun 7, 2012 at 5:43 PM

Maybe you should try to where the code is:

http://greatmaps.codeplex.com/SourceControl/list/changesets

and there LATEST VERSION.

It’s all included samples and source of the Control!

This is where each project on CodePlex has its sources…..

From: dgoulian [email removed]
Sent: Thursday, June 07, 2012 6:52 PM
To: m.moehle@mbd-team.de
Subject: Re: Load a map from file? [greatmaps:358641]

From: dgoulian

Radioman - It would be useful to have the project & code for the demo. I looked at the GMap.NET.WindowsPresentation download, the executable is there and some XML files, but no solution file (.sln). Without the .sln its not possible to open the project in Visual Studio. Is that available?

Thanks again.

Jun 7, 2012 at 5:52 PM

Got it now, thanks.

Rick Goulian
Software Engineer

STARA Technologies, Inc.

www.staratechnologies.com

Cell:480-225-1146

Office: 480-307-6732 x405
email:
Rick.goulian@staratechnologies.com

Description: Description: Description: Description: STARAConnect_small

CONFIDENTIALITY NOTICE:

This e-mail and any attachments contain information from STARA Technologies, Inc., and are intended solely for the use of the named recipient or recipients. This e-mail may contain privileged STARA communications or work product. Any dissemination of this e-mail by anyone other than intended recipient is strictly prohibited. If you are not a named recipient, you are prohibited from any further viewing of the e-mail or any attachments or from making any use of the e-mail or attachments. If you believe you have received this e-mail in error, notify the sender immediately and permanently delete the e-mail, any attachments, and all copies thereof from any drives or storage media and destroy any printouts of the e-mail or attachments.

From: MBDTeam [email removed]
Sent: Thursday, June 07, 2012 10:44 AM
To: Rick Goulian
Subject: Re: Load a map from file? [greatmaps:358641]

From: MBDTeam

Maybe you should try to where the code is:

http://greatmaps.codeplex.com/SourceControl/list/changesets

and there LATEST VERSION.

It’s all included samples and source of the Control!

This is where each project on CodePlex has its sources…..

From: dgoulian [email removed]
Sent: Thursday, June 07, 2012 6:52 PM
To: [email removed]
Subject: Re: Load a map from file? [greatmaps:358641]

From: dgoulian

Radioman - It would be useful to have the project & code for the demo. I looked at the GMap.NET.WindowsPresentation download, the executable is there and some XML files, but no solution file (.sln). Without the .sln its not possible to open the project in Visual Studio. Is that available?

Thanks again.

Jun 12, 2012 at 3:05 PM

Hi radioman,

After working with GMAP.net for a couple of day I am quite impressed. Great work.

Question: If I wanted to write my own map provider that allowed the user to attached their own static geotiff maps, is that possible? If so, is there sample code to me how to do it?

Many thanks,

Rick Goulian
Software Engineer

STARA Technologies, Inc.

www.staratechnologies.com

Cell:480-225-1146

Office: 480-307-6732 x405
email:
Rick.goulian@staratechnologies.com

Description: Description: Description: Description: STARAConnect_small

CONFIDENTIALITY NOTICE:

This e-mail and any attachments contain information from STARA Technologies, Inc., and are intended solely for the use of the named recipient or recipients. This e-mail may contain privileged STARA communications or work product. Any dissemination of this e-mail by anyone other than intended recipient is strictly prohibited. If you are not a named recipient, you are prohibited from any further viewing of the e-mail or any attachments or from making any use of the e-mail or attachments. If you believe you have received this e-mail in error, notify the sender immediately and permanently delete the e-mail, any attachments, and all copies thereof from any drives or storage media and destroy any printouts of the e-mail or attachments.

From: radioman [email removed]
Sent: Thursday, June 07, 2012 9:15 AM
To: Rick Goulian
Subject: Re: Load a map from file? [greatmaps:358641]

From: radioman

DOWNLOAD AND SEE

Coordinator
Jun 12, 2012 at 4:25 PM
there is bunch of providers already, copy/paste and modify > > From: dgoulian > > Hi radioman, > > >> After working with GMAP.net for a couple of day I am quite impressed. >> Great work. > > >> Question: If I wanted to write my own map provider that allowed the >> user to attached their own static geotiff maps, is that possible? If >> so, is there sample code to me how to do it? > > >> Many thanks, > > >> Rick Goulian > Software Engineer > > STARA Technologies, Inc. > > www.staratechnologies.com > > >> Cell:480-225-1146 > > Office: 480-307-6732 x405 > email: Rick.goulian@staratechnologies.com > > >> > > >> CONFIDENTIALITY NOTICE: > > This e-mail and any attachments contain information from STARA > Technologies, Inc., and are intended solely for the use of the named > recipient or recipients. This e-mail may contain privileged STARA > communications or work product. Any >dissemination of this e-mail by > anyone other than intended recipient is strictly prohibited. If you are > not a named recipient, you are prohibited from any further viewing of > the e-mail or any attachments or from making any use of the e-mail or > >attachments. If you believe you have received this e-mail in error, > notify the sender immediately and permanently delete the e-mail, any > attachments, and all copies thereof from any drives or storage media and > destroy any printouts of the e->mail or attachments. > > >> From: radioman [email removed] > Sent: Thursday, June 07, 2012 9:15 AM > To: Rick Goulian > Subject: Re: Load a map from file? [greatmaps:358641] > > > From: radioman > > DOWNLOAD AND SEE > > Read the full discussion online. > > To add a post to this discussion, reply to this email > (greatmaps@discussions.codeplex.com) > > To start a new discussion for this project, email > greatmaps@discussions.codeplex.com > > You are receiving this email because you subscribed to this discussion > on CodePlex. You can unsubscribe or change your settings on codePlex.com. > > Please note: Images and attachments will be removed from emails. Any > posts to this discussion will also be available online at codeplex.com there is bunch of providers already, copy/paste and modify

From: dgoulian

Hi radioman,

After working with GMAP.net for a couple of day I am quite impressed. Great work.

Question: If I wanted to write my own map provider that allowed the user to attached their own static geotiff maps, is that possible? If so, is there sample code to me how to do it?

Many thanks,

Rick Goulian
Software Engineer

STARA Technologies, Inc.

www.staratechnologies.com

Cell:480-225-1146

Office: 480-307-6732 x405
email:
Rick.goulian@staratechnologies.com

Description: Description: Description: Description: STARAConnect_small

CONFIDENTIALITY NOTICE:

This e-mail and any attachments contain information from STARA Technologies, Inc., and are intended solely for the use of the named recipient or recipients. This e-mail may contain privileged STARA communications or work product. Any dissemination of this e-mail by anyone other than intended recipient is strictly prohibited. If you are not a named recipient, you are prohibited from any further viewing of the e-mail or any attachments or from making any use of the e-mail or attachments. If you believe you have received this e-mail in error, notify the sender immediately and permanently delete the e-mail, any attachments, and all copies thereof from any drives or storage media and destroy any printouts of the e-mail or attachments.

From: radioman [email removed]
Sent: Thursday, June 07, 2012 9:15 AM
To: Rick Goulian
Subject: Re: Load a map from file? [greatmaps:358641]

From: radioman

DOWNLOAD AND SEE




Jun 15, 2012 at 7:11 PM

Radioman - I am still trying to figure out how to load a map directly from a file instead of from internet. I see how to add a custom provider from looking at your demo source, but I see nothing that shows how to load the map from a file. All of your providers seem to be internet-based. Am I missing something?

Coordinator
Jun 15, 2012 at 7:29 PM

just replace GetTileImageUsingHttp with File.ReadAllBytes

Jun 15, 2012 at 9:47 PM

Hi Radioman – I added a new method to GMapProvider.cs for my provider to load a map from a file and I am now able to load a satellite image from disk, but it tiles the image repeatedly across the screen and runs very very slowly:

public PureImage GetTileImageFromFile(string url)

{

PureImage ret = null;

ret = TileImageProxy.FromArray(File.ReadAllBytes(url));

ret.Data.Position = 0;

}

Any idea what I’m missing?

Rick Goulian
Software Engineer

STARA Technologies, Inc.

www.staratechnologies.com

Cell:480-225-1146

Office: 480-307-6732 x405
email:
Rick.goulian@staratechnologies.com

Description: Description: Description: Description: STARAConnect_small

CONFIDENTIALITY NOTICE:

This e-mail and any attachments contain information from STARA Technologies, Inc., and are intended solely for the use of the named recipient or recipients. This e-mail may contain privileged STARA communications or work product. Any dissemination of this e-mail by anyone other than intended recipient is strictly prohibited. If you are not a named recipient, you are prohibited from any further viewing of the e-mail or any attachments or from making any use of the e-mail or attachments. If you believe you have received this e-mail in error, notify the sender immediately and permanently delete the e-mail, any attachments, and all copies thereof from any drives or storage media and destroy any printouts of the e-mail or attachments.

From: radioman [email removed]
Sent: Friday, June 15, 2012 12:30 PM
To: Rick Goulian
Subject: Re: Load a map from file? [greatmaps:358641]

From: radioman

just replace GetTileImageUsingHttp with File.ReadAllBytes

Coordinator
Jun 16, 2012 at 7:01 AM

slow disk?

Jun 18, 2012 at 6:25 PM

Perhaps I am going about this the wrong way. Maybe what I really want is to load my "custom" statellite imagery on top of an existing map provider map. Do you do this with an overlay? Are there any examples of how to do this in the demo code?

Jun 18, 2012 at 8:54 PM

I think I need something similar to what google maps provides: the ability to add an overlaywith bounds. Can GMap.Net do this?

action: 'addGroundOverlay',

09.    bounds: [
10.        [40.765641, -74.139235],
11.        [40.716216, -74.213393]
Jun 20, 2012 at 8:19 PM

Hi Radioman – I am still struggling to get a single satellite image to display correctly using my custom map file provider. I think my issue boils down to this: when I read in the image off disk, how do I tell GMAP about its location, i.e. its coordinates in the world? I think GMAP does not know the coordinates, so it has no idea where to place this map and how to tile correctly.

Rick Goulian
Software Engineer

STARA Technologies, Inc.

www.staratechnologies.com

Cell:480-225-1146

Office: 480-307-6732 x405
email:
Rick.goulian@staratechnologies.com

Description: Description: Description: Description: STARAConnect_small

CONFIDENTIALITY NOTICE:

This e-mail and any attachments contain information from STARA Technologies, Inc., and are intended solely for the use of the named recipient or recipients. This e-mail may contain privileged STARA communications or work product. Any dissemination of this e-mail by anyone other than intended recipient is strictly prohibited. If you are not a named recipient, you are prohibited from any further viewing of the e-mail or any attachments or from making any use of the e-mail or attachments. If you believe you have received this e-mail in error, notify the sender immediately and permanently delete the e-mail, any attachments, and all copies thereof from any drives or storage media and destroy any printouts of the e-mail or attachments.

From: radioman [email removed]
Sent: Saturday, June 16, 2012 12:02 AM
To: Rick Goulian
Subject: Re: Load a map from file? [greatmaps:358641]

From: radioman

slow disk?

Jun 22, 2012 at 6:16 PM

Hi Radioman – are there any examples of how to draw a reference scale on the map?

Rick Goulian
Software Engineer

STARA Technologies, Inc.

www.staratechnologies.com

Cell:480-225-1146

Office: 480-307-6732 x405
email:
Rick.goulian@staratechnologies.com

Description: Description: Description: Description: STARAConnect_small

CONFIDENTIALITY NOTICE:

This e-mail and any attachments contain information from STARA Technologies, Inc., and are intended solely for the use of the named recipient or recipients. This e-mail may contain privileged STARA communications or work product. Any dissemination of this e-mail by anyone other than intended recipient is strictly prohibited. If you are not a named recipient, you are prohibited from any further viewing of the e-mail or any attachments or from making any use of the e-mail or attachments. If you believe you have received this e-mail in error, notify the sender immediately and permanently delete the e-mail, any attachments, and all copies thereof from any drives or storage media and destroy any printouts of the e-mail or attachments.

From: radioman [email removed]
Sent: Saturday, June 16, 2012 12:02 AM
To: Rick Goulian
Subject: Re: Load a map from file? [greatmaps:358641]

From: radioman

slow disk?

Coordinator
Jul 16, 2012 at 4:05 PM

yes, it's in the source...

Jul 12, 2013 at 6:12 AM
Hi,

I have the same issue.
I want to read jpg / jgw (tif / tfw) from my hard drive.
The jpg is the image of the area.
The jgw is the image text info :
[
5.36336807534598E-06 -> x resolution per pixel
0
0
-4.46328934455817E-06 -> y resolution per pixel
36.0554995723069 -> image top left point Lon in Geo WGS84
33.7120666921116 -> image top left point Lat in Geo WGS84
]
I can implement a query that will return the right file by wanted coordinate.
How do i read the image as "PureImage" efficiently?
Does your code reads files for each pixel or it takes the iamge for the area in the form window ?

If you will manage to add this option to your code - the Gmap.Net tool will be perfect !!!
Coordinator
Jul 12, 2013 at 7:46 AM
just make your custom map provider
Jul 12, 2013 at 8:13 AM
I understand that i need to create a custom map provider.
but how do i load the jpg as a PureImage Class ?
Coordinator
Jul 12, 2013 at 8:24 AM
in provider use: TileImageProxy.FromArray(...
Jul 12, 2013 at 9:20 AM
ok.
  1. how do i convert a jpg into byte[] ?
  2. will the image go automaticly to cache ?
Coordinator
Jul 12, 2013 at 9:35 AM
File.ReadAllBytes, yes it will go to cache
Jul 12, 2013 at 9:42 AM
very good !!
i'll give it a try ...

another question :
  1. what is the sequence in creating my custom gmdb (Prefetch -> export -> move to my cache folder )?
  2. when i create a gmdb file, do i need to load the exact MapProvider (for example if i used BingMaps for creating gmdb, i need to choose MapProvider=BingMaps) ?
  3. you have done a great work !!!
Coordinator
Jul 12, 2013 at 2:02 PM
it's created automatically, you can prefetch your area if you want, then you can copy/paste the database
Jul 12, 2013 at 2:41 PM
thanks...
Aug 27, 2013 at 2:34 PM
hi elijaelt80,

i've got a simular task: loading geocoded tiff-images (etrs89 / utm32) on the map.

did you implement that custom map provider and can you provide the code?

hi radioman,

wouldn't it be nice to have such a map provider, configurable on coordinate-system, tile-size..., generalized and embedded?
Coordinator
Aug 27, 2013 at 2:56 PM
you can try to use mapcruncher to convert tiles projection to mercator
Aug 31, 2013 at 7:22 PM
Hi,

I didn't finish implementing the custom map provider.

Currently my energy goes else where ...
Sep 26, 2013 at 6:58 AM
radioman,

I am trying to build this "Stand Alone" MapProvider for my app.

I have 2 "LatLng" Corners (Left Up, Right Down) of the my image (LatLng1 and LatLng2)..

How do i load the image as a tile with it geo data (so the ratio will fit Gmap.NET).

Thanks,
Coordinator
Sep 26, 2013 at 2:30 PM
you can try to use mapcruncher to convert image to tiles, projection is mercator
Sep 27, 2013 at 7:08 AM
Hi,

I downloaded macruncher.
I see that they used Gmap.NET to build their app ( RESPECT !!!)
Now i understand the idea of the Tiles - each tile is 256 x 256 for all zoom levels. when "x=0, y=0" is the top left corner of the map.

Questions :
  1. How did they make the map to be continues in the East/West ?
  2. Is their a way to save a chunk of screen in my wanted size to a file ?
Thanks,
Coordinator
Sep 27, 2013 at 7:15 AM
macruncher don't use gmap.net, it's working but dead project, i've just added the sources to the tools directory

..anyway it's used to generate the tiles from any map image using any projection, and then you can import them into gmap.net
Sep 27, 2013 at 7:40 AM
Hi,

The problem with Mapcruncher that it uses a map (Ortophoto) in reference that is limitted to +- 79 degrees in Lat.
I want to make my tiles based on Gmap.Net maps.
I create a graphic layer on top of your maps, i want to save the tiles with the new layer, and make the new data as an inferstructure for a MapProvider.

Now i need a way to generate Tiles inside the Gmap.Net.
The best way to do it is to have a function that automaticly creates tiles :
public Bitmap renderTiles(int zoomLevel, int tileNum_X, int tileNum_Y)
{
... bla bla bla ....
return new Bitmap(...)   -> 256 x 256
}
Coordinator
Sep 27, 2013 at 8:38 AM
why you cant use mapcruncher, are you in the arctic? ;}
Sep 27, 2013 at 9:30 AM
:)
For the scale of the map.
If the lat points are not the same as the source, the map will be distorted...
Coordinator
Sep 27, 2013 at 9:57 AM
you can adjust points to a few meters
Oct 13, 2013 at 4:52 PM
Hello radioman, is there a way to display maps in ecw format?!