Welcome to MapForums!

Register, sign in, or use Facebook Connect above to join in and participate in the forum.

When you are signed in, this message, the ads in this row, and the red-underlined link ads all go away.

Subscribe to receive our newsletter.
Subscribe Unsubscribe
Results 1 to 6 of 6

DisplayData Map Error

This is a discussion on DisplayData Map Error within the Development forums, part of the MapPoint Desktop Discussion category; Hey all! I've been browsing through this forum during the whole last week and seriusly i've found a lot of ...

  1. #1
    freedyer is offline Junior Member White Belt
    Join Date
    Jul 2012
    Posts
    5

    DisplayData Map Error

    Hey all!
    I've been browsing through this forum during the whole last week and seriusly i've found a lot of usefull tips. But today i'm fighting with a case-sensitive problem caused by my tentatives to select a territory on the map(in my case a region of italy) and color it how i want. So, i've tried multiple things and since now i gained no positive result At the moment i'm tryin' to create a Dataset and import a territory from an excel file :

    territorymap = map.DataSets.ImportTerritories(filename, fieldSpecifications, MapPoint.GeoCountry.geoCountryItaly,
    MapPoint.GeoDelimiter.geoDelimiterDefault);

    territorymap is my dataset, map is the map i associated to the mappointcontrol in my form. The filename is the path to my excel file, fieldspecifications is the array of objects that describes my excel file :

    object[,] fieldSpecifications = new object[7, 2];
    fieldSpecifications[0, 0] = "ID";
    fieldSpecifications[0, 1] = MapPoint.GeoFieldType.geoFieldSkipped;


    fieldSpecifications[1, 0] = "Manager";
    fieldSpecifications[1, 1] = MapPoint.GeoFieldType.geoFieldSkipped;


    fieldSpecifications[2, 0] = "Adress";
    fieldSpecifications[2, 1] = MapPoint.GeoFieldType.geoFieldAddress1;


    fieldSpecifications[3, 0] = "City";
    fieldSpecifications[3, 1] = MapPoint.GeoFieldType.geoFieldTerritory;


    fieldSpecifications[4, 0] = "Country";
    fieldSpecifications[4, 1] = MapPoint.GeoFieldType.geoFieldRegion1;


    fieldSpecifications[5, 0] = "Postal_Code";
    fieldSpecifications[5, 1] = MapPoint.GeoFieldType.geoFieldPostal1;


    fieldSpecifications[6, 0] = "Service";
    fieldSpecifications[6, 1] = MapPoint.GeoFieldType.geoFieldData;
    ---------------------------------------------------------------------------------------------------

    So then i try to use this dataset on my datamap :

    territoryfield[0] = territorymap.Fields.get_Item(City); City is an object with value 3


    territoryfield[1] = territorymap.Fields.get_Item(Postal_Code); Postal is an object with value 5


    dataterritory(this is my datamap) = territorymap.DisplayDataMap(MapPoint.GeoDataMapTyp e.geoDataMapTypeTerritory, territoryfield, MapPoint.GeoShowDataBy.geoShowByTerritory, ColorScheme: 5);

    ------------------So i get an error on this last line as : Invalid parameter or Access denied. Dunno what to do

    I just want to select the territory "Udine" which is the value of the column City from my excel table, and add it as a territory on my map with a color.

    If anyone can help i would be very thankfull
    Thanks in advance,
    George.

  2. #2
    Mattys Consulting's Avatar
    Mattys Consulting is offline Senior Member Black Belt
    Join Date
    Dec 2002
    Posts
    1,040

    Re: DisplayData Map Error

    George,

    MapPoint doesn't offer territory by city; only census tract, postal code, county, state, country are used.
    You can draw a shape and send behind roads.
    Michael R Mattys
    Business Process Developers
    www.mattysconsulting.com

  3. #3
    freedyer is offline Junior Member White Belt
    Join Date
    Jul 2012
    Posts
    5

    Re: DisplayData Map Error

    Quote Originally Posted by Mattys Consulting View Post
    George,

    MapPoint doesn't offer territory by city; only census tract, postal code, county, state, country are used.
    You can draw a shape and send behind roads.
    Hey, first of all thanks for your fast answer!
    So about the territory by postal code, would u please explain how should i pass the arguments to the method? I guess that i should set the postal code column as territory, but i what about the method? i mean:

    dataterritory = territorymap.DisplayDataMap(MapPoint.GeoDataMapTyp e.geoDataMapTypeTerritory, territoryfield, MapPoint.GeoShowDataBy.geoShowByTerritory, ColorScheme: 5);

    the territoryfield is an array of MapPoint.Field type that contains 2 items :
    territoryfield[0] = territorymap.Fields.get_Item(PostalCode);territory field[1] = territorymap.Fields.get_Item(Country);

    I do so in order to set the territory map by postal-code + country --- the problem is that it doesn't work. How should i do in order to get a territory map displayed by postalcode? what am i doing wrong?
    Sorry for this newbie question but this method stresses me insanely with it's "Invalid parameter" error
    Thanks again for your time.

  4. #4
    Mattys Consulting's Avatar
    Mattys Consulting is offline Senior Member Black Belt
    Join Date
    Dec 2002
    Posts
    1,040

    Re: DisplayData Map Error

    You need one field to designate how the territories will be created and one field to label the names:
    Dim arZips(1, 1) As Variant
    arZips(0, 0) = "Zip": arZips(0, 1) = geoFieldPostal1
    arZips(1, 0) = "TerrID": arZips(1, 1) = geoFieldTerritory
    Set oDS = oMap.DataSets.ImportTerritories(strFileName, arZips, geoCountryUnitedStates, , geoImportAccessTable)
    Michael R Mattys
    Business Process Developers
    www.mattysconsulting.com

  5. #5
    freedyer is offline Junior Member White Belt
    Join Date
    Jul 2012
    Posts
    5

    Re: DisplayData Map Error

    Quote Originally Posted by Mattys Consulting View Post
    You need one field to designate how the territories will be created and one field to label the names:
    Dim arZips(1, 1) As Variant
    arZips(0, 0) = "Zip": arZips(0, 1) = geoFieldPostal1
    arZips(1, 0) = "TerrID": arZips(1, 1) = geoFieldTerritory
    Set oDS = oMap.DataSets.ImportTerritories(strFileName, arZips, geoCountryUnitedStates, , geoImportAccessTable)
    Thanks, but the point is that when i use this dataset in order to display a map it gives me an error .
    I've tried to use :

    MapPoint.DataMap datamap = oDs.DisplayDataMap(MapPoint.GeoMapType.GeoMapTypeT erritory, other params)

    and it errors... So i've been told that the displaydatamap doesn't accept the GeoMapTypeTerritory, so how to display the territory i load into my dataset then? How to make it show on the map?

  6. #6
    Mattys Consulting's Avatar
    Mattys Consulting is offline Senior Member Black Belt
    Join Date
    Dec 2002
    Posts
    1,040

    Re: DisplayData Map Error

    I see. According to Winwaed (http://www.mapforums.com/sitemap/t-18539.html) GeoDataMapTypeTerritory isn't valid with DisplayDataMap
    Michael R Mattys
    Business Process Developers
    www.mattysconsulting.com

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 1
    Last Post: 06-10-2009, 09:58 AM
  2. Error: Licensing initialisation error has occurred
    By Winwaed in forum Development
    Replies: 4
    Last Post: 09-24-2008, 08:16 AM
  3. Run-time error 2147467259 80004005 automation error
    By ThomasB in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 02-27-2007, 11:41 AM
  4. displaydata map question visual basic
    By virgilar in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 03-14-2005, 08:14 AM
  5. About ERROR 4-40028-1. Error or Bug ?
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 12
    Last Post: 01-11-2005, 09:32 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


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 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127