Thanks Frank and I am working with my team to slim down a copy of the database and do you have preferred transfer method when they are done?
I have also provided the code and DB scripts that were used.
VIsual Studio 2017 Code
private void DBLayer_LoadTest()
{
//Clear Map Layers
mapLayerTest.HighlightOverlay.Features.Clear();
mapLayerTest.Popups.Clear();
mapLayerTest.StaticOverlay.Layers.Clear();
mapLayerTest.CustomOverlays.Clear();
//Set Background
mapLayerTest.MapBackground = new GeoSolidBrush(GeoColor.StandardColors.White);
//DecimalDegrees Works
mapLayerTest.MapUnit = GeographyUnit.DecimalDegree;
//mapLayerTest.MapUnit = GeographyUnit.Feet;
//Database Layer
LayerOverlay layerOverlay = new LayerOverlay();
MsSqlFeatureLayer sqlLayer = new MsSqlFeatureLayer();
sqlLayer.ConnectionString = "Data Source=<DBNAME>;User ID=<USERID>;Initial Catalog=<CATALOG>;Persist Security Info=False;Password=<PASSWORD>";
sqlLayer.TableName = "gis.CampusAreaPointLocation_Test";
sqlLayer.FeatureIdColumn = "FeatureID";
sqlLayer.Srid = 4269;
sqlLayer.DatabaseConnectionMode = DatabaseConnectionMode.AutoClose;
//Error with GEOG_Data - geography Data Type
//sqlLayer.CustomGeometryColumnName = "GEOG_Data";
sqlLayer.CustomGeometryColumnName = "GEOM_Data";
GeoSolidBrush symbolBrush = new GeoSolidBrush(GeoColor.SimpleColors.DarkRed);
sqlLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(TextStyles.CreateSimpleTextStyle("AreaName", "Arial", 7, DrawingFontStyles.Regular, GeoColor.StandardColors.Black, GeoColor.StandardColors.White, 5));
sqlLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(new PointStyle(PointSymbolType.Star, symbolBrush, 15));
sqlLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
//Set CUrrent Extents
sqlLayer.Open();
mapLayerTest.CurrentExtent = sqlLayer.GetBoundingBox();
sqlLayer.Close();
//Add to Map Viewer
layerOverlay.Layers.Add("layerTest", sqlLayer);
mapLayerTest.CustomOverlays.Add(layerOverlay);
}
SQL Server 2017 Table Script and Sample Data Insert (Lat/Lon Point)
CREATE TABLE gis.CampusAreaPointLocation_Test
(
FeatureID VARCHAR(15) NOT NULL,
AreaName VARCHAR(45) NOT NULL,
GEOG_Data GEOGRAPHY,
GEOM_Data GEOMETRY
CONSTRAINT pk_CampusAreaPointLocation_Test PRIMARY KEY (FeatureID)
)
–Delete Records
–DELETE gis.CampusAreaPointLocation_Test
–Insert Records
INSERT INTO gis.CampusAreaPointLocation_Test
(
FeatureID,
AreaName,
GEOG_Data,
GEOM_Data
)
SELECT ‘NI1109’, ‘Texas Tech Polo Grounds’, geography::STGeomFromText(‘POINT(-101.824 33.4768)’, 4269), geometry::STGeomFromText(‘POINT(-101.824 33.4768)’, 4269) UNION ALL
SELECT ‘S0377’, ‘S (0377) SYSTEM OFFICE BUILDING’, geography::STGeomFromText(‘POINT(-101.893 33.5812)’, 4269), geometry::STGeomFromText(‘POINT(-101.893 33.5812)’, 4269) UNION ALL
SELECT ‘T0003’, ‘T (0003) MECHANICAL ENGINEERING SOUTH’, geography::STGeomFromText(‘POINT(-101.875 33.588)’, 4269), geometry::STGeomFromText(‘POINT(-101.875 33.588)’, 4269) UNION ALL
SELECT ‘T0004’, ‘T (0004) ELECTRICAL ENGINEERING’, geography::STGeomFromText(‘POINT(-101.876 33.5866)’, 4269), geometry::STGeomFromText(‘POINT(-101.876 33.5866)’, 4269) UNION ALL
SELECT ‘T0005’, ‘T (0005) CHEMISTRY’, geography::STGeomFromText(‘POINT(-101.876 33.5837)’, 4269), geometry::STGeomFromText(‘POINT(-101.876 33.5837)’, 4269) UNION ALL
SELECT ‘T0405’, ‘T (0405) TEXAS TECH PLAZA’, geography::STGeomFromText(‘POINT(-101.87 33.5775)’, 4269), geometry::STGeomFromText(‘POINT(-101.87 33.5775)’, 4269)
–Make Geography/Geometry Data Valid
UPDATE gis.CampusAreaPointLocation_Test
SET
GEOG_Data = GEOG_Data.MakeValid(),
GEOM_Data = GEOM_Data.MakeValid()