Community of VE/MapPoint Users and Developers
This is a discussion on Almost there..........Plotting wrong thing!!! within the MapPoint 2006/2009 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 ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Almost there..........Plotting wrong thing!!! 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
and I want it to look like: Can anyone of you helpful people assist? |
| |||
| 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 MapPoint Europe Gallery at http://www.broomanalysis.plus.com/gallerylist.html |
![]() |
| ||||
| Posted By | For | Type | Date | |
| Reverse Geocoding with MapPoint 2002 - MapPoint Articles - MP2K Magazine | This thread | Refback | 10-14-2007 01:29 PM | |
| The Magazine for MapPoint - MP2K Magazine | This thread | Refback | 10-10-2007 02:52 PM | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Recordset exception. What am I doing wrong? | Anonymous | MapPoint 2006/2009 Discussion | 3 | 01-25-2005 02:26 PM |
| What am i doing wrong??? | alt-088 | MapPoint 2006/2009 Discussion | 2 | 09-16-2004 03:37 PM |
| The Best Thing Since Sliced Bread | Anonymous | News and Announcements | 0 | 03-23-2004 11:02 PM |
| [Invalid Pointer] : what's wrong ? | Vincent BENNER | MapPoint 2006/2009 Discussion | 1 | 11-18-2002 11:47 AM |
| Wrong answer from ConvertToLatLong | dpietrocarlo | MapPoint 2006/2009 Discussion | 2 | 09-20-2002 03:18 PM |
Bulgaria Ski Holidays
First time skier? Looking for something a little different? Bulgaria Ski holidays could be the perfect remedy to your winter blues. Bulgaria prices are great value.
Flights to Spain
Find and book flights to Spain. Travel Counsellors can help with travel to Spain including flights and accommodation.
Turkey Holidays
Istanbul is Turkey's prime attraction as it has the most beautiful mosques and palaces of the country; it has Byzantine churches and Roman temples. Book Turkey Holidays online.
Dubai Holidays
Dubai holidays provide you with exotic sights, desert safaris and superb cuisine. There is an extensive range of things to do and see!
Turkey
Before booking a holiday to Turkey check out the ULookUBook travel guide. Find out about the rich culture in Turkey before you go there to help you to make the most of your holiday.
Bargain family holidays
We can help you find family holidays at bargain prices when you check out the options at Travel.co.uk
Cheap holidays in Cyprus
Stunning coastline! Beautiful beaches! Cheap holidays in Cyprus, available at On The Beach.