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 2 of 2

Almost there..........Plotting wrong thing!!!

This is a discussion on Almost there..........Plotting wrong thing!!! within the MapPoint Desktop Discussion forums, part of the Map Forums category; Hello, Great little community you got going here. I hope you can help me. I'm incredibly new to this stuff.......only ...

  1. #1
    Matthew is offline Junior Member White Belt
    Join Date
    Oct 2007
    Posts
    3

    Almost there..........Plotting wrong thing!!!

    Hello,

    Great little community you got going here. I hope you can help me.

    I'm incredibly new to this stuff.......only been at it for 2 days.



    I've got a series of text files that I want to read into MapPoint one by
    one.

    I've almost done it but.........

    Currently my code does:

    Import text file
    Plot as shaded postcode sectors
    Copy & Pastes map back into excel

    The problem I have is that it does not map the right variable in my data.
    I want it to map PSECTOR_TYPE, but I think it is just mapping CLUB_CODE.

    Or is it mapping all the PSECTORs in the file and the name it gives it is the
    name of the file.

    The data I am trying to map looks like this:
    CLUB_CODE PSECTOR PSECTOR_TYPE
    5400 MK12 6 CORE
    5400 MK13 7 CORE
    5400 MK14 6 CORE
    5400 MK14 7 CORE
    5400 MK16 0 CORE
    5400 MK2 2 CORE
    5400 MK2 3 CORE
    5400 MK3 6 CORE
    5400 MK3 7 CORE
    5400 MK6 2 CORE
    5400 MK6 3 CORE
    5400 MK6 4 CORE
    5400 MK6 5 CORE
    5400 MK10 9 SECONDARY
    5400 MK11 1 SECONDARY
    5400 MK12 5 SECONDARY
    5400 MK13 0 SECONDARY
    5400 MK13 8 SECONDARY
    5400 MK13 9 SECONDARY
    5400 MK14 5 SECONDARY
    5400 MK15 9 SECONDARY
    5400 MK16 8 SECONDARY
    5400 MK16 9 SECONDARY
    5400 MK18 1 SECONDARY
    5400 MK3 5 SECONDARY
    5400 MK4 1 SECONDARY
    5400 MK4 2 SECONDARY
    5400 MK5 6 SECONDARY
    5400 MK5 7 SECONDARY
    5400 MK7 8 SECONDARY
    5400 MK8 0 SECONDARY
    5400 MK8 8 SECONDARY

    <tab-delimited>

    The code as it currently stands:
    HTML Code:
    Sub attempt3()
    Dim objField As MapPoint.Field
    Dim objDataMap As MapPoint.DataMap
    Dim objDataSet As MapPoint.DataSet
    Dim PSECTOR_TYPE As MapPoint.Field
    Set objMapPoint = CreateObject("MapPoint.Application")
    Set objMap = objMapPoint.NewMap
    'objMapPoint.Visible = True
    'objMapPoint.UserControl = True
    Set colDatasets = objMapPoint.NewMap.DataSets
    Set objDataSet = colDatasets.ImportData("C:\Documents and Settings\Matthew Southgate\My Documents\_HOMEWORK\Samples\5400.txt", , geoCountryEurope, geoDelimiterTab)
    objDataSet.ZoomTo
    Set objDataMap = objDataSet.DisplayDataMap(geoDataMapTypeShadedArea, , , , geoRangeTypeUniqueValues, geoRangeOrderLowToHigh, 2)
    objDataMap.LegendTitle = "Core & Secondary Postcode Sectors"
    objMap.SaveAs ("C:\Documents and Settings\Matthew Southgate\My Documents\_HOMEWORK\Saved File.ptm")
    objMap.CopyMap
    ActiveSheet.Paste
    End Sub
    The map currently looks like:


    and I want it to look like:


    Can anyone of you helpful people assist?

  2. #2
    davidb is offline Senior Member Blue Belt
    Join Date
    Oct 2003
    Location
    London
    Posts
    290

    Re: Almost there..........Plotting wrong thing!!!

    Hi there

    As far as I can see you don't set objField to be PSECTOR_TYPE. Also given the format of postcode sectors you'd be better reading them as comma delimited. Finally if you're using MPE2006 read the postcode sector names in lower case because there is a casing bug and you'll get some strange results otherwise.

    Set objDataSet = colDataSets.ImportData("C:\Documents and Settings\xxx\xx\xx.txt", , geoCountryEurope, geoDelimiterComma, geoImportFirstRowIsHeadings)
    Set objField = objDataSet.Fields("PSECTOR_TYPE")
    Set objDataMap = objDataSet.DisplayDataMap(geoDataMapTypeShadedArea , objField)

    Hope this helps
    David
    UK mapping and map analysis services at www.broomanalysis.plus.com

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Recordset exception. What am I doing wrong?
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 3
    Last Post: 01-25-2005, 03:26 PM
  2. What am i doing wrong???
    By alt-088 in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 09-16-2004, 04:37 PM
  3. The Best Thing Since Sliced Bread
    By Anonymous in forum News and Announcements
    Replies: 0
    Last Post: 03-24-2004, 12:02 AM
  4. [Invalid Pointer] : what's wrong ?
    By Vincent BENNER in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 11-18-2002, 12:47 PM
  5. Wrong answer from ConvertToLatLong
    By dpietrocarlo in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 09-20-2002, 04:18 PM

Tags for this Thread

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