How to: Automatically Load Cartesian Data to a Geo Map
- 4 minutes to read
To automatically load Cartesian map data from a shapefile to a Geo map, do the following.
- If the shapefile data contains a *.PRJ file with the same name and path as the *.SHP file, Specify the ShapefileDataAdapter.FileUri property. Data will be loaded automatically.
- Otherwise, to load coordinate system information if the file names or paths are different, use the ShapefileDataAdapter.LoadPrjFile method to initialize the SourceCoordinateSystem class descendant object, which should be assigned to the CoordinateSystemDataAdapterBase.SourceCoordinateSystem property of the data adapter.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace LoadGeoShapeData {
static class Program {
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main() {
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}