VERIFIED SOLUTION i
X

How to open a ESRI Shapefile with MapXtreme

UPDATED: November 28, 2017


To open an ESRI Shapefile without using a TAB file in MapXtreme®:

  • Create a new instance of the TableInfoShapefile,
  • Set the TablePath property to the pathname of the SHP file,
  • Add a GeometryColumn and specifying all the attribute columns that appear in the associated dBase file.

The following example illustrates how to open an ESRI Shapefile without using a TAB file:

public static void MapInfo_Data_TableInfoShapefile() {
    TableInfoShapefile ti = new TableInfoShapefile("EsriShape");
    ti.TablePath = @"c:\Data\ESRI\Countries_region.shp";
    ti.PersistentCache = true;
    CoordSysFactory CSysFactory = Session.Current.CoordSysFactory;
    CoordSys coordSys = CSysFactory.CreateCoordSys("mapinfo:coordsys 12,62,7,0"); // data is stored in Robinson
    ti.Columns.Add(ColumnFactory.CreateFeatureGeometryColumn(coordSys));

    ti.Columns.Add(ColumnFactory.CreateStringColumn("Country", 30));
    ti.Columns.Add(ColumnFactory.CreateStringColumn("Capital", 30));
    ti.Columns.Add(ColumnFactory.CreateDecimalColumn("Pop_1994", 11, 0));

    ti.Columns.Add(ColumnFactory.CreateDoubleColumn("Pop_Grw_Rt"));
    ti.Columns.Add(ColumnFactory.CreateDoubleColumn("Pop_Male"));
    ti.Columns.Add(ColumnFactory.CreateStyleColumn());
    ti.DefaultStyle = new AreaStyle(

Environment Details

Products Affected: MapXtreme.NET

Downloads

  • No Downloads