MapPoint Forums

MapForums

Community of MapPoint and Virtual Earth Users and Developers




Data Import

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 ...


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

Today's Posts Twitter Feed 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 05-04-2004
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
Data Import

I am trying to import a comma delimited text file into a mappoint dataset using C#

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
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
data, import


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


All times are GMT -5. The time now is 11:55 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0 RC2
MP2K Magazine
Visitor Map

Sharm El Sheikh Holiday
Enjoy the hot sun and fantastic beaches on your Sharm El Sheikh holiday! Check out the UlookUbook online offers...



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