MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




DisplayDataMap

This is a discussion on DisplayDataMap within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hi all, have imported a set of records and want to show it using DisplayDataMap() as a multiple symbol map (...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-28-2006
Junior Member
Yellow Belt
 
Join Date: Dec 2004
Posts: 23
DisplayDataMap

Hi all,

have imported a set of records and want to show it using DisplayDataMap() as a multiple symbol map (geoDataMapTypeMultipleSymbol). The problem is I need exactly one symbol per record (primary key) , no combination. Which value for the showDataBy argument should I use? I've tried geoShowByLatLong and geoShowByStreetAddress and the results are okay if really all values are given and different. This may be invalidatet in further use of my application. Also the tooltip texts of the symbols are like "Amount for street adress" but it shold be "Amount by object number" where "object number" is the primary key attribute of the dataSet.
Any hints?

TIA

Chris Werner
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 02-28-2006
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,017
Hi Chris,

Sorry I dont understeand your question. BTW: English is not my mother's tonque.

Can you enlighten your problem with a few lines of code, maybe this will help me understean.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 03-01-2006
Junior Member
Yellow Belt
 
Join Date: Dec 2004
Posts: 23
Thanks!

Hi Wilfried,

thanks for your interest. Our communication problems may stem from the language of my mother too - it's also not English but German. What I want to achieve is showing 1 pushpin for 1 imported record and avoid cummulation of multiple records into 1 symbol. The function dataSet.DisplayDataMap() have the parameter showDataBy to control this (I believe). If I understand that right a value of geoShowByRegion will combine all records with the same Region into one pushpin. But geoShowDataBy have no possible value to show the data record by record. The most similar possibilities are geoShowByLatLong and geoShowByStreetAdress. But what if I have 2 ore more records with the same street adress or geocoordinates?
What I do is:

Code:
lole_dataSet = this.object.activeMap.dataSets.importData(
    as_fn, 
    ls_field, 
    94, 
    9)

lole_field = lole_dataSet.fields.item(8)

lole_dataSet.displayDataMap(	
		geoDataMapTypeMultipleSymbol, 
		lole_field, 
		geoShowByLatLong, 
		geoCombineByDefault, 
		geoRangeTypeDefault, 
		geoRangeOrderDefault,  
		geoColorSchemeDefault			
		)
The field 8 of the imported data is a status, it should control the color of the symbol: 'READY' -> green, 'FAIL' -> red and so on. My problem is how to code this.

Thanks again,

Chris Werner
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 03-01-2006
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,017
Hi Chris,

I edit your code with the "code" tags to make it more readable. Please do in future

Yes wy dont we all learn Esperanto. It exists for so long and no country's gouverment is interested to learn it in school Oh whell they are maybe just stupid...

About your problem. You use methods I have never used and not direct interested in to use. Therefore difficult to advice. Mostly I try out some things to learn from it myself, but I'm short in time at moment. If you dont get out of it then please reply to this topic and then it will come in front again so I see it again. If I have some more time I can try to experiment with it to get solution for you.

As short answer for the moment I have always control all pushpins myself without mappoint doing this. But maybe this is not solution for you.

I hope you dont mind...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5 (permalink)  
Old 06-16-2006
Junior Member
White Belt
 
Join Date: Oct 2005
Posts: 9
Hi Chris,

I think you can try setting some parameter in DisplayDataMap function:

I think 'DataRangeCount' value to 2 and 'ArrayOfPushpinSymbols', the last parameter, to your desired pushpin symbols.

Byeee
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6 (permalink)  
Old 06-16-2006
Member
Green Belt
 
Join Date: Mar 2005
Posts: 96
Hi Chris, Fabio and Wilfried,

If your main purpose is
Quote:
What I want to achieve is showing 1 pushpin for 1 imported record
why don't you add your recrords as PushPins ( AddPushPin method ) one by one and select the symbol ID or picture you want for each one.
To change a PushPin Color, you have to get his object location and choose the symbol you want.

For that purpose, I won't use Importada wizard, neither DisplayDataMap method.

For more details about Pushpins, customized symbols look at this topic:

http://www.mp2kmag.com/mappoint/disc...ghlight=symbol

Ciao
__________________
Mohamed
www.AtlasCouscous.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7 (permalink)  
Old 09-20-2006
Junior Member
White Belt
 
Join Date: Aug 2006
Posts: 3
Multiple Symbol Map

I encountered lots of problems with the DataSet.DisplayDataMap() method. I am using MapPoint 2006 and C# with VS 2005, but I will write here what I learned. I got the all-explaining "The parameter is incorrect." message, but I believe I know what causes it for the multiple symbol map.

Firstly, all of the arrays must be properly sized. If you pass the parameter stating that there are 5 ranges, then in the array where you define the ranges (myranges[] below), it must have 6 numbers (array size = 6) to create the bounds on the 5 ranges. In that case, you must then pass an array of size 5 for the range names (myrangenames[]) and an array of size 5 for the symbols (symbols[]). If these sizes are off, it may throw the "parameter is incorrect" message, or it might just not work as you think. If you want 8 ranges, the symbols[] and myrangenames[] arrays should be size=8 and the myranges[] array should be size=9.

In addition, the myranges[] array MUST be ascending order. If it is in descending order (I didn't test no order), it does not throw an error, but it does not work properly either.

Also, if possible, step through the debugger and make sure the 2nd parameter to the method, the field parameter, is a proper MapPoint.Field object. This can also cause the "parameter is incorrect" message.

This applies to a 5 column CSV file. I encountered problems when my fieldSpecifications array did not have the proper dimensions (for a 10 column CSV file, it should be size = [10][2]) that matched the CSV file. In addition, I made sure the headings in the first column of my csv file matched the names I gave in the fieldSpecifications, but that is probably not necessary.

Here's my CSV file I'm importing:
Latitude,Longitude,Field1,Field2,Field3
32.90,-117.2,1152558003,10,100
32.91,-117.3,1152558004,11,101
...

Code:
//Define field specification
object[,] fieldSpecifications = {
            {"Latitude", MapPoint.GeoFieldType.geoFieldLatitude},
            {"Longitude", MapPoint.GeoFieldType.geoFieldLongitude},
            {"Field1", MapPoint.GeoFieldType.geoFieldData},
            {"Field2", MapPoint.GeoFieldType.geoFieldData},
            {"Field3", MapPoint.GeoFieldType.geoFieldData}
};

// Import the CSV file
MapPoint.DataSet objDataSet = map.DataSets.ImportData(
                                "c:\\tmp.csv",
                                fieldSpecifications,
                                 MapPoint.GeoCountry.geoCountryUnitedStates,
                                MapPoint.GeoDelimiter.geoDelimiterDefault,
                                0
);

//Define data map columns
// This will be the index for "Field2"
object fieldIndex = 4;

//Now get fields
MapPoint.Field datafield;
datafield = objDataSet.Fields.get_Item(ref fieldIndex);

// This creates 5 ranges
// -100 through -90, -90 through -80, and so on
object[] myranges = new object[6] { -100, -90, -80, -70, -60, 0 };

// This names the 5 ranges
object[] myrangenames = new object[5] { "-100 to -90",
                                        "-90 to -80",
                                        "-80 to -70",
                                        "-70 to -60",
                                        "-60 to 0"
};

// This creates symbols for the 5 ranges in order
// These are the symbol IDs
// Symbol 16 applies to the range -100 to -90
object[] symbols = new object[5] {  
                                    16,
                                    17,
                                    18,
                                    19,
                                    20  
};

//Now display datamap
try
{
    // Display the imported data set using this mapping technique
    MapPoint.DataMap datamap = objDataSet.DisplayDataMap(
                            MapPoint.GeoDataMapType.geoDataMapTypeMultipleSymbol,
                            datafield,
                            MapPoint.GeoShowDataBy.geoShowByLatLong,
                            MapPoint.GeoCombineDataBy.geoCombineByDefault,
                            MapPoint.GeoDataRangeType.geoRangeTypeDefault,
                            MapPoint.GeoDataRangeOrder.geoRangeOrderDefault,
                            MapPoint.GeoDataConstants.geoColorSchemeDefault,
                            5,              // This should be the # of ranges        
                            myranges,       // Should be an array of size(# of ranges +1)    
                            myrangenames,   // An array of range names size(# of ranges)
                            System.Reflection.Missing.Value,
                            System.Reflection.Missing.Value,
                            symbols         // Array of symbols corresponding to the ranges
        );

    // Legend name
    datamap.LegendTitle = "My Legend: Field2";

    // Display legend pane
    datamap.Application.PaneState = MapPoint.GeoPaneState.geoPaneLegend;

    // Zoom to the imported data set
    objDataSet.ZoomTo();
}
catch (Exception except)
{
    MessageBox.Show(except.ToString());
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8 (permalink)  
Old 09-20-2006
Junior Member
White Belt
 
Join Date: Aug 2006
Posts: 3
I tested my code above on a imported data set of a little more than 4000 distinct values. To import and color the data differently based on field2's value took about 2-4 seconds in debug mode.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9 (permalink)  
Old 09-21-2006
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,017
Hi,

Thanks for feedback. It will benefit others.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
DisplayDatamap and ArrayOfCustomValues PGLRepDev MapPoint 2006/2009 Discussion 5 06-21-2006 03:35 PM
DisplayDataMap method c# fletch MapPoint 2006/2009 Discussion 1 04-08-2005 06:26 AM
DisplayDataMap in Delphi 7 Anonymous MapPoint 2006/2009 Discussion 0 12-17-2004 05:59 AM
DisplayDataMap with delphi ? seb24 MapPoint 2006/2009 Discussion 0 01-29-2004 09:49 AM
DisplayDataMap and C# Anonymous MapPoint 2006/2009 Discussion 0 07-04-2003 01:15 PM


All times are GMT -5. The time now is 11:18 PM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5
MP2K Magazine
Visitor Map

Menorca Flights
Visit the unspoilt Mediterranean island of Menorca. Menorca flights are low cost flights when you book with Holiday Hypermarket.

City Break Europe
Take a city break in Europe. Travel Counsellors can help plan and book your European city break.

Holiday to Thailand
Want to go somewhere new? Book a low cost holiday to Thailand at dealchecker.co.uk. See the stunning national parks and uninhabited islands.

Cuba Holidays
Cuba holidays offer an exciting cultural and wonderful culinary experience. Book with The Holiday Place for a great deal.

Cheap Cyprus Holidays
Finding cheap Cyprus holidays can be difficult unless you know where to look and where to book. With ulookubook.com you can conduct a simple search to find the latest holiday deals to your particular destination.

Holiday
For the holiday of your life, that is easy to plan, visit Travel.co.uk to see all the options.

Holidays to Lanzarote
Not been to the Canary Islands yet? What are you waiting for! Get information on holidays to Lanzarote at On The Beach.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47