MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




importdata to shaded areas

This is a discussion on importdata to shaded areas within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hi, I'm new to Mappoint 2004. I'm trying to use importdata from a query in an access mdb to create ...


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

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read



Click here to register

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-02-2005
Junior Member
White Belt
 
Join Date: Aug 2005
Posts: 3
importdata to shaded areas

Hi,
I'm new to Mappoint 2004. I'm trying to use importdata from a query in an access mdb to create shaded areas with visual basic6. I obtain always a map with pushpin. I'm aggregating regional datas that i'm able to create in a shaded area with manual wizard. Do you know why?

Thanks
Max
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 08-04-2005
calv1ns's Avatar
Member
Green Belt
 
Join Date: Mar 2005
Posts: 91
Two Step Method

Hey Max

In VB to get to where you want to be it is a two step process. One link the data to get it into a DataSet Object and two execute a DisplayDataMap Method on that DataSet Object

This is the syntax:

object.DisplayDataMap([DataMapType], [DataField], [ShowDataBy], [CombineDataBy], [DataRangeType], [DataRangeOrder], [ColorScheme], [DataRangeCount], [ArrayOfCustomValues], [ArrayOfCustomNames], [DivideByField], [ArrayOfDataFieldLabels], [ArrayOfPushpinSymbols])

It takes major fussing with this method to get a DataMap that looks pretty. Look it up in VB Help to get the settings required.

Post your code here and maybe we can see if there is problem with what you are doing.

Ciao,
__________________
Calv1ns
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 08-05-2005
Junior Member
White Belt
 
Join Date: Aug 2005
Posts: 3
The code is something like this, but i always receive "parameter is incorrect" in method DisplayDataMap.

Thanks for help!!


myExampleArray(0, 0) = "tot"
myExampleArray(0, 1) = geoFieldInformation

myExampleArray(1, 0) = "PROVINCIA_AVV"
myExampleArray(1, 1) = geoFieldRegion2

Set objDs = objMap.DataSets.ImportData("C:\Mp.mdb!Query_SinApe ", myExampleArray, geoCountryItaly, geoDelimiterDefault, geoImportAccessQuery)

Set obField = objDs.Fields("provincia_avv")

Set objMap = _
objDs.DisplayDataMap(geoDataMapTypeShadedArea, _
obField, geoShowByCity, geoCombineByDefault, _
geoRangeTypeDiscreteEqualRanges, geoRangeOrderDefault, 15)
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 08-05-2005
Junior Member
White Belt
 
Join Date: Aug 2005
Posts: 3
I wrote geoShowbycity instead of geoShowByRegion2; anyway I have the same result.
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 08-05-2005
calv1ns's Avatar
Member
Green Belt
 
Join Date: Mar 2005
Posts: 91
DataMaps

After a quick look max

1) I always run the subscripts on the Fields Array from 1 to n and not 0 to n-1

2) are you declaring your varriables? Maybe something is set by default to variant when it needs to be a specific type.

Here is some code that does work:

Public Sub example()

Dim this_datamap As MapPoint.DataMap
Dim this_field As MapPoint.Field
Dim wk_DSs As MapPoint.DataSets
Dim wk_ds As MapPoint.DataSet
Dim wk_dbs As Database
Dim wk_dsname As String
Dim wk_fields(1 To 8, 1 To 2) As Variant

wk_fields(1, 1) = "Name"
wk_fields(2, 1) = "EventID"
wk_fields(3, 1) = "wk_DateTime"
wk_fields(4, 1) = "Latitude"
wk_fields(5, 1) = "Longitude"
wk_fields(6, 1) = "AVLID"
wk_fields(7, 1) = "Speed"
wk_fields(8, 1) = "Heading"

wk_fields(1, 2) = geoFieldData
wk_fields(2, 2) = geoFieldData
wk_fields(3, 2) = geoFieldName
wk_fields(4, 2) = geoFieldLatitude
wk_fields(5, 2) = geoFieldLongitude
wk_fields(6, 2) = geoFieldData
wk_fields(7, 2) = geoFieldData
wk_fields(8, 2) = geoFieldData
wk_dsname = "my Truck"

'Opens a map and sets the global myobj as a MapPoint.Map
wk_istat2 = Open_Map("...\My Documents\test.ptm")

Set wk_dbs = CurrentDb()

wk_qry = wk_dbs.Name & "!avlhistory"
Set wk_DSs = myobj.DataSets

Set wk_ds = wk_DSs.LinkData(wk_qry, "eventid", wk_fields, geoCountryCanada, , geoImportAccessQuery)
wk_DSs.item(1).Name = wk_dsname

Set this_field = wk_ds.Fields.item( 8 )
Set this_datamap = wk_ds.DisplayDataMap(geoDataMapTypeShadedArea, _
this_field, geoShowByCensus1, geoCombineByCount, _
geoRangeTypeDiscreteEqualRanges, geoRangeOrderDefault, 3, 4)

End Sub

Ciao,
__________________
Calv1ns
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 10-14-2006
Junior Member
White Belt
 
Join Date: Oct 2006
Posts: 2
Importing Data

Hi,
I am trying to work with the awesome code sample you posted but there is one bit I do not understand. and that is Open_Map("...\My Documents\test.ptm")

Is Open)Map a function you built if so can you post that or explain what sysntax you use to open a map, Thanks

Bruce


Quote:
Originally Posted by calv1ns View Post
After a quick look max

1) I always run the subscripts on the Fields Array from 1 to n and not 0 to n-1

2) are you declaring your varriables? Maybe something is set by default to variant when it needs to be a specific type.

Here is some code that does work:

Public Sub example()

Dim this_datamap As MapPoint.DataMap
Dim this_field As MapPoint.Field
Dim wk_DSs As MapPoint.DataSets
Dim wk_ds As MapPoint.DataSet
Dim wk_dbs As Database
Dim wk_dsname As String
Dim wk_fields(1 To 8, 1 To 2) As Variant

wk_fields(1, 1) = "Name"
wk_fields(2, 1) = "EventID"
wk_fields(3, 1) = "wk_DateTime"
wk_fields(4, 1) = "Latitude"
wk_fields(5, 1) = "Longitude"
wk_fields(6, 1) = "AVLID"
wk_fields(7, 1) = "Speed"
wk_fields(8, 1) = "Heading"

wk_fields(1, 2) = geoFieldData
wk_fields(2, 2) = geoFieldData
wk_fields(3, 2) = geoFieldName
wk_fields(4, 2) = geoFieldLatitude
wk_fields(5, 2) = geoFieldLongitude
wk_fields(6, 2) = geoFieldData
wk_fields(7, 2) = geoFieldData
wk_fields(8, 2) = geoFieldData
wk_dsname = "my Truck"

'Opens a map and sets the global myobj as a MapPoint.Map
wk_istat2 = Open_Map("...\My Documents\test.ptm")

Set wk_dbs = CurrentDb()

wk_qry = wk_dbs.Name & "!avlhistory"
Set wk_DSs = myobj.DataSets

Set wk_ds = wk_DSs.LinkData(wk_qry, "eventid", wk_fields, geoCountryCanada, , geoImportAccessQuery)
wk_DSs.item(1).Name = wk_dsname

Set this_field = wk_ds.Fields.item( 8 )
Set this_datamap = wk_ds.DisplayDataMap(geoDataMapTypeShadedArea, _
this_field, geoShowByCensus1, geoCombineByCount, _
geoRangeTypeDiscreteEqualRanges, geoRangeOrderDefault, 3, 4)

End Sub

Ciao,
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

Tags
areas, importdata, shaded


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
Deleting a dataset and shaded area on a map... Anonymous MapPoint 2006/2009 Discussion 1 04-10-2005 07:25 AM
Adding and Removing Shaded Areas... jonny0311 MapPoint 2006/2009 Discussion 0 04-06-2005 10:44 AM
Pushpin and Shaded Circle Size Anonymous MapPoint 2006/2009 Discussion 1 11-19-2004 09:23 AM
Using the shaded circle map and linked data, can I.... Anonymous MapPoint 2006/2009 Discussion 1 10-10-2001 08:28 AM
When using the shaded circles to plot a sum of net.... Anonymous MapPoint 2006/2009 Discussion 1 09-05-2001 07:08 AM


All times are GMT -5. The time now is 03:42 PM.


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


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