Example #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldFindByTableAndCode()
        internal virtual void ShouldFindByTableAndCode()
        {
            assertThat(CoordinateReferenceSystem.Get(1, 4326), equalTo(CoordinateReferenceSystem.Wgs84));
            assertThat(CoordinateReferenceSystem.Get(1, 4979), equalTo(CoordinateReferenceSystem.Wgs84_3d));
            assertThat(CoordinateReferenceSystem.Get(2, 7203), equalTo(CoordinateReferenceSystem.Cartesian));
            assertThat(CoordinateReferenceSystem.Get(2, 9157), equalTo(CoordinateReferenceSystem.Cartesian_3D));
        }
Example #2
0
        private static CoordinateReferenceSystem FindSpecifiedCRS(PointBuilder fields)
        {
            string crsValue  = fields.Crs;
            int    sridValue = fields.Srid;

            if (!string.ReferenceEquals(crsValue, null) && sridValue != -1)
            {
                throw new InvalidValuesArgumentException("Cannot specify both CRS and SRID");
            }
            else if (!string.ReferenceEquals(crsValue, null))
            {
                return(CoordinateReferenceSystem.ByName(crsValue));
            }
            else if (sridValue != -1)
            {
                return(CoordinateReferenceSystem.Get(sridValue));
            }
            else
            {
                return(null);
            }
        }
Example #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldFailToGetWithIncorrectCode()
        internal virtual void ShouldFailToGetWithIncorrectCode()
        {
            InvalidValuesArgumentException exception = assertThrows(typeof(InvalidValuesArgumentException), () => CoordinateReferenceSystem.Get(42));

            assertEquals("Unknown coordinate reference system code: 42", exception.Message);
        }
Example #4
0
 public static CoordinateReferenceSystem Crs(CRS crs)
 {
     return(CoordinateReferenceSystem.Get(crs));
 }