Community of MapPoint and Virtual Earth 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 ...
| |||||||
| Today's Posts | Twitter Feed | 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 |
Sharm El Sheikh Holiday
Enjoy the hot sun and fantastic beaches on your Sharm El Sheikh holiday! Check out the UlookUbook online offers...