Index: src/Common/SharpMap/Converters/WellKnownText/SpatialReference.cs
===================================================================
diff -u -r8f6ae890fed8e8eae3a32f9c0498a10f82e0ddf9 -r5fc71a385897af92ccb092f2f969b5709afab85a
--- src/Common/SharpMap/Converters/WellKnownText/SpatialReference.cs (.../SpatialReference.cs) (revision 8f6ae890fed8e8eae3a32f9c0498a10f82e0ddf9)
+++ src/Common/SharpMap/Converters/WellKnownText/SpatialReference.cs (.../SpatialReference.cs) (revision 5fc71a385897af92ccb092f2f969b5709afab85a)
@@ -15,33 +15,40 @@
// along with SharpMap; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+using System.IO;
+using System.Reflection;
+using System.Xml;
+
namespace SharpMap.Converters.WellKnownText
{
- ///
- /// Converts spatial reference IDs to a Well-Known Text representation.
- ///
- public class SpatialReference
- {
- ///
- /// Converts a Spatial Reference ID to a Well-known Text representation
- ///
- /// Spatial Reference ID
- /// Well-known text
- public static string SridToWkt(int srid)
- {
-
- System.Xml.XmlDocument xmldoc = new System.Xml.XmlDocument();
-
- string file = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().CodeBase) + "\\SpatialRefSys.xml";
- //if (!System.IO.File.Exists(file))
- // throw new ApplicationException("Spatial reference system database not found: " + file);
- xmldoc.Load(file);
- //xmldoc.Load(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("SharpMap.SpatialReference.SpatialRefSys.xml"));
- System.Xml.XmlNode node = xmldoc.DocumentElement.SelectSingleNode("/SpatialReference/ReferenceSystem[SRID='" + srid.ToString() + "']");
- if(node!=null)
- return node.LastChild.InnerText;
- else
- return "";
- }
- }
-}
+ ///
+ /// Converts spatial reference IDs to a Well-Known Text representation.
+ ///
+ public class SpatialReference
+ {
+ ///
+ /// Converts a Spatial Reference ID to a Well-known Text representation
+ ///
+ /// Spatial Reference ID
+ /// Well-known text
+ public static string SridToWkt(int srid)
+ {
+ XmlDocument xmldoc = new XmlDocument();
+
+ string file = Path.GetDirectoryName(Assembly.GetExecutingAssembly().CodeBase) + "\\SpatialRefSys.xml";
+ //if (!System.IO.File.Exists(file))
+ // throw new ApplicationException("Spatial reference system database not found: " + file);
+ xmldoc.Load(file);
+ //xmldoc.Load(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("SharpMap.SpatialReference.SpatialRefSys.xml"));
+ XmlNode node = xmldoc.DocumentElement.SelectSingleNode("/SpatialReference/ReferenceSystem[SRID='" + srid.ToString() + "']");
+ if (node != null)
+ {
+ return node.LastChild.InnerText;
+ }
+ else
+ {
+ return "";
+ }
+ }
+ }
+}
\ No newline at end of file