Community of VE/MapPoint Users and Developers
This is a discussion on Data Import within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; I am trying to import a comma delimited text file into a mappoint dataset using C# The columns and summary ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Data Import The columns and summary data of the txt file are LinkID, MapID, Long1, Lat1, Long2, Lat2 7871,1,-2.98654,56.4529,-2.09585,57.1432 7872,26,-2.98654,56.4529,-2.09585,57.1432 7873,27,-2.98654,56.4529,-2.09585,57.1432 7874,28,-2.98654,56.4529,-2.09585,57.1432 7875,29,-2.98654,56.4529,-2.09585,57.1432 7876,30,-2.98654,56.4529,-2.09585,57.1432 7877,34,-2.98654,56.4529,-2.09585,57.1432 7878,41,-2.98654,56.4529,-2.09585,57.1432 7879,53,-2.98654,56.4529,-2.09585,57.1432 7880,86,-2.98654,56.4529,-2.09585,57.1432 I have written the following code MapPointApp.Map oMap; //Create an application class MapPointApp.ApplicationClass app = null; app = new MapPointApp.ApplicationClass(); MapPointApp.DataSet oDataSet = null; try { string sDataPath = Path.GetDirectoryName(System.Windows.Forms.Applica tion.ExecutablePath) + Path.DirectorySeparatorChar +"Tlinks.txt"; object[,] aGrid = new object[6,2]; aGrid.SetValue( "LinkID", 0, 0 ); aGrid.SetValue( MapPointApp.GeoFieldType.geoFieldData, 0, 1 ); aGrid.SetValue( "MapID", 1, 0 ); aGrid.SetValue( MapPointApp.GeoFieldType.geoFieldData, 1, 1 ); aGrid.SetValue( "Long1", 2, 0 ); aGrid.SetValue( MapPointApp.GeoFieldType.geoFieldLongitude, 2, 1 ); aGrid.SetValue( "Lat1", 3, 0 ); aGrid.SetValue( MapPointApp.GeoFieldType.geoFieldLatitude , 3, 1 ); aGrid.SetValue( "Long2", 4, 0 ); aGrid.SetValue( MapPointApp.GeoFieldType.geoFieldLongitude, 4, 1 ); aGrid.SetValue( "Lat2", 5, 0 ); aGrid.SetValue( MapPointApp.GeoFieldType.geoFieldLatitude , 5, 1 ); oDataSet = app.ActiveMap.DataSets.ImportData(sDataPath,aGrid, MapPointApp.GeoCountry.geoCountryUnitedKingdom , 0,0); If I simply use LinkID, MapID, Long, Lat as the column headers and the importdata method without the array I do not get any errors and the code works fine If anyone has any ideas why this does not work (mappoint throws an internal error) , i would be grateful Thanks Richard |
![]() |
| Tags |
| data, import |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Spatial data import | Les Wilcock | MapPoint 2006/2009 Discussion | 5 | 05-18-2006 10:22 AM |
| Canada Import Data | Anonymous | MapPoint 2006/2009 Discussion | 3 | 11-01-2003 09:26 AM |
| Import Data From Access | Anonymous | MapPoint 2006/2009 Discussion | 1 | 08-05-2003 08:24 AM |
| Using the Spatial Data Import Com Add-in, I have h.... | Anonymous | MapPoint 2006/2009 Discussion | 1 | 10-25-2001 06:05 PM |
| I wonder if there is a way to import MP2k2 data in.... | Anonymous | MapPoint 2006/2009 Discussion | 1 | 08-20-2001 07:34 AM |
Borovets Ski Holidays
Borovets ski holidays are set amongst stunning scenery with a great selection of restaurants, hotels and nightlife. Borovets ski holidays are great value for money.
Late Deal Holidays
Whatever your travel needs, city breaks, late deal holidays, luxury holidays or family holidays - your personal Travel Counsellor can help
Holidays Thailand
Holidays in Thailand are hugely diverse with wonderful luxury resorts and beaches but also some lovely forested mountains with interesting hill tribes. See dealchecker.co.uk.
Holidays in Egypt
A holiday in Egypt will stimulate your mind, captivate your heart and spark your senses. Visit this exceptional country, book today!
Portugal
As well as providing some great weather Portugal has much to offer culturally. There are numerous museums, monuments and places of historical interest to explore. Despite the rich history there is a buzzing nightlife and great shopping too.
Comparison Holidays
Travel.co.uk is a travel comparison service which makes it easy for you to find and plan the best holidays.
Holidays to Portugal
Want to take your family on a summer holiday? Visit On The Beach for more information on holidays to Portugal.