MapPoint Forums

MapForums

Community of VE/MapPoint 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

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 07:35 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
MP2K Magazine
Visitor Map

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.


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