I've seen varying questions relating to this question. Except mine revolves around C#. I'm trying to validate that the projection I'm expecting matches what is in all the .shp files I'm reading.


For example I have this prj file, is there anyway to verify that is the SRID that I'm looking for (In the .Net library)?

I'm looking for an answer relating to the .Net Framework: I don't have ArcObjects or any Esri Libraries. Any chance there is something baked in to the .Net Framework?

  • Which .Net library? ArcObjects? Do you have access to any Esri libraries? – mkennedy Jun 25 '13 at 19:56
  • .Net Framework only... I don't have ArcObjects or any Esri Libraries. Any chance there is something baked in to the .Net Framework? – webdad3 Jun 25 '13 at 20:24
  • This isn't a duplicate question. This question was specifically asking about the .Net Framework using C#. The question that is pointed out is dealing with Python. – webdad3 Jun 26 '13 at 12:50
  • All the answers to the duplicate are ways of using a Web service to look up the SRID using a PRJ file, so it looks like what you are really asking is for a C# port of one of those solutions. (That they are in Python or whatever is purely incidental; they have nothing to do with AO or ESRI libraries.) Maybe you will benefit from reading them a little more carefully. (This suggestion is meant in a friendly, constructive way: your comment and your recent edit both suggest you might not have appreciated the value of the answers offered in the duplicate.) – whuber Jun 26 '13 at 13:57
  • 2
    There is nothing inbuilt in .Net. You have two options. Either call one of the web services from your .NET Code, or call GDAL form the .NET bindings. – Devdatta Tengshe Jun 26 '13 at 15:46

If I understand your situation correctly, only if the coordinate reference system that you have, is, or can be converted, to a well-known text (WKT) string that matches the Esri version. That way you could do a string comparison. Newer WKT written by Esri software will include an AUTHORITY keyword which would include the EPSG or Esri well-known ID but this string doesn't have that information.

The example you gave is a WKT string in the Esri format, but there are other ways to create a NAD27 WKT string that uses different names. Both strings / definitions refer to the same 'thing', but have different representations.

A Microsoft .Net framework might have some coordinate reference system support because SQL Server supports geographic coordinate reference systems, but I haven't any details. SQL Server uses EPSG names which is "NAD27."

Without the ability to query the Esri projection engine (or another Esri API that's ultimately calling the projection engine), it will be difficult to look up the SRID / WKID for a particular WKT. If you're using a limited number, you could make a look-up table.

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