I have a number of Polyline and Point features stored in a SQL Server 2012 database. I am using a website with C# and DotSpatial to create and export a shapefile of any one of these features successfully, however when I import the file into ArcMap, the points are mis-projected onto the map (they are all about 6.6 miles to the northwest of where they should be, to be exact).

I have checked some of the individual points by converting them to lat/lon, and they are exactly what they should be. I've checked the shapefile's projection information (NAD83 State Plane Oklahoma North feet), and it looks good:


I have a different shapefile of the same points that was created using a different third-party tool that is displaying in ArcMap correctly. I've checked the projection information for both files and they both have the above projection information.

Any ideas as to why they aren't projecting right in ArcMap? It seems like the projection may just not be working at all, and not have to do with the specific State Plane coordinate system, because when I use WGS 84 I still have the same problem.

Here is the C# code I use for exporting the shapefile. Thanks!

var featureSet = new FeatureSet(FeatureType.Point);
var dt = _dataAccessLayer.GetTableByFeature(shapeFileName);

// Copy all of the columns from the database table to the feature set
for (int colIdx = 0; colIdx < dt.Columns.Count; colIdx++)
    var col = dt.Columns[colIdx];
    featureSet.DataTable.Columns.Add(new DataColumn(col.ColumnName, 

int rowIndex = 0;
foreach (DataRow row in dt.Rows)
    // Convert the projection from Spherical Mercator to 
    //   NAD1983 State Plane Oklahoma North (feet)
    var vertices = new double[2];
    vertices[0] = Convert.ToDouble(row[COL_X_COORD]);
    vertices[1] = Convert.ToDouble(row[COL_Y_COORD]);
    var z = new double[1];

    Reproject.ReprojectPoints(vertices, z, KnownCoordinateSystems
        .Projected.WorldSpheroid.Mercatorsphere, KnownCoordinateSystems.Projected
        .StatePlaneNad1983Feet.NAD1983StatePlaneOklahomaNorthFIPS3501Feet, 0, 1);
    featureSet.AddFeature(new Feature(new Coordinate(vertices[0], vertices[1])));

    // Add the rest of the attributes to the feature set
    for (int colIdx = 0; colIdx < dt.Columns.Count - colOffset; colIdx++)
        featureSet.DataTable.Rows[rowIndex][colIdx] = row[colIdx + colOffset];

featureSet.Projection = KnownCoordinateSystems.Projected
featureSet.SaveAs(shapefilePath + shapeFileName, true);
  • 2
    Can you identify the same point in both shapefiles and pull its coordinates? The CRS wkt looks fine to me, but 6.6 miles seems like a feet vs meters issue.
    – mkennedy
    Jul 19, 2013 at 17:17
  • Thanks for the reply, and sorry for the delayed response. That sounds like it could definitely be the issue. Here is a point from the original shapefile: (2044241.39049, 220193.458573), and here is that same point from the newly-exported shapefile: (2011671.21719, 232770.630536), both in NAD83 Oklahoma North feet (or at least supposed to be). Am I supposed to be doing a meters-to-feet conversion when reprojecting from Spherical Mercator (which is using meters) to State Plane (which is using feet)?
    – cearly
    Jul 22, 2013 at 15:21

1 Answer 1


Ahh, hooray! Figured it out: The mapping product I'm using to map our data refers to the projection I'm using as "Popular Spherical Mercator", which led me to choose "KnownCoordinateSystems .Projected.WorldSpheroid.Mercatorsphere" as the source projection. However, the correct source projection is actually "KnownCoordinateSystems.Projected.World.WebMercator".

The mapping product uses Bing Maps as it's base imagery and from what I was finding online it seems like there's some kind of a blur between referring to the Bing/Google projections as Web Mercator or as Spherical Mercator. Perhaps someone can still enlighten me more about that, but at least as far as my shapefile is concerned, all is better now that I've switched the projection.

  • 2
    Great. Will you please mark this as the accepted answer (you may have to wait a day) so that future readers will quickly know that this is how to solve it?
    – user3461
    Jul 22, 2013 at 16:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.