I am trying to allow users to click on a ship using this code in the WinformsMap1_MapClick() module:
Dim selectedFeatures As Collection(Of Feature) = shipLayer.QueryTools.GetFeaturesWithinDistanceOf(e.WorldLocation, GeographyUnit.DecimalDegree, DistanceUnit.Meter, 500, New String(0) {"NAME"})
It works fine. However, the 500m boundary is too small at large scales & too big at small scales. Is there a way to select within say 4 or 5 pixels of a clicked point?
And also, am I correct in saying that if I have my ships (points) as icons using this kind of code:
Dim rotatedImageStyle As New RotatedImageStyle(New GeoImage("GreenShipIcon.png"), "VCMG")
that there is no way of doing a selection where the user can click anywhere within the outline of the icon to select it, regardless of the size of the icon?
Selecting points - scale issue
David,
Actually we have a Code Community sample that addresses that issue of identifying features represented by icons by user click. I think you are going to find what you are looking for in this sample Identify Point with Icon wiki.thinkgeo.com/wiki/Map_Suite_De..._with_Icon
If you still have doubts, let us know. Thank you.
I don't quite have it working yet:
--Usual problem trying to figure out a C# application when that is not my language.
--Project mentioned has a Reference to WorldMapKitWms which isn't on my computer anywhere (but turns out to be a red herring as it doesn't appear to be needed)
--crash in this line: Dim clickedFeatures As Collection(Of Feature) = shipLayer2.QueryTools.GetFeaturesNearestTo(clickedPointShape, GeographyUnit.DecimalDegree, 1, ReturningColumnsType.AllColumns)
"A .NET Framework error occurred during execution of user-defined routine or aggregate "geography":
Microsoft.SqlServer.Types.GLArgumentException: 24205: The specified input does not represent a valid geography instance because it exceeds a single hemisphere. Each geography instance must fit inside a single hemisphere. A common reason for this error is that a polygon has the wrong ring "
(clicking on any vessel icon in that map will cause that crash)
However, possible answers to my questions are:
1) There doesn't appear to be a function to select within X pixels of a clicked point rather than a distance.
2) It is possible to click on icons and detect this. However,
a) If the icons do not take up the full rectangle and have transparent background, clicking in the rectangle but outside the icon border will still select that particular icon.
b) If the icon is rotated, wrong selection may take place as the rotation of the rectangle isn't taken into account? I haven't been able to test this properly yet.
David,
I think we have encountered this same issue before; I will make sure with our development team as soon as possible.
Could you let me know that the type of the shipLayer2, is it line or polygon? Also, it would be kind enough if you could let me know the Desktop version information, you can get it by calling the following static API:
Dim version As String = WinformsMap.GetVersion()
Any more questions please feel free to let me know.
Thanks.
Yale
ShipLayer2 has only points in it. All WGS-84. There are points in the Northern & Southern (& Eastern & Western) Hemispheres.
MapSuiteCore:4.5.0.0
DesktopEdition:4.5.0.0
David,
Can you give us the code you have for setting up that ShipLayer2 layer with the styling etc? Also it would help to have that GreenShipIcon.png file. Basically you want to be able to click on the icon itself and identify the feature. I think that with the additional data we will get from you, we will be able to find a more concrete solution for your specific case. Thank you.
Layer creation:
Sub MakeShipLayer()
Logdebug(“MakeShipLayer(): Started”, “High”)
Dim FracDay As Single
’ set up the Vessels layer here including showing labels
ShipLayer.Srid = 4326
ShipLayer.Name = “ShipLayer”
'Point Style with rotation - works, but equilateral triangles mean heading info not clear - change to a bitmap instead
'Dim rotatedpointStyle As New RotatedPointStyle(PointStyles.CreateSimpleTriangleStyle(GeoColor.SimpleColors.Red, 15, GeoColor.SimpleColors.Black), “VCMG”, 1)
Dim rotatedImageStyle As New RotatedImageStyle(New GeoImage(“GreenShipIcon.png”), “VCMG”)
ShipLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Clear()
'ShipLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(rotatedpointStyle) ’ no longer use point style, though might use it for trails later
ShipLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(rotatedImageStyle)
’ this gives a custom style to the vessel labels
Dim textStyle As TextStyle = TextStyles.CreateSimpleTextStyle(“Name”, “Arial”, 10, DrawingFontStyles.Regular, GeoColor.StandardColors.Black, GeoColor.FromArgb(100, GeoColor.SimpleColors.Yellow), 2, 0, -8)
ShipLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(textStyle)
textStyle.PointPlacement = PointPlacement.UpperRight
textStyle.OverlappingRule = LabelOverlappingRule.NoOverlapping ’ make user definable later?
textStyle.BestPlacement = True
ShipLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20
TrailLayer.Srid = 4326
TrailLayer.Name = “TrailLayer”
’ blue dot for trails. Later on change this to either arrow/dot matching colour of vessel OR red dot for stopped, green arrow (rotated) for moving
TrailLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle.SymbolPen = New GeoPen(GeoColor.FromArgb(255, GeoColor.StandardColors.Blue), 1)
TrailLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20
’ Set layer up for labels
Logdebug(“MakeShipLayer(): ShipLayer.ConnectionString=” & ShipLayer.ConnectionString, “High”)
Try
ShipLayer.Open()
Catch ea As SqlException
Logdebug(“MakeShipLayer(): Error=” & ea.Message, “High”)
grpSQLServer.BackColor = Color.Red
Debug.Print(ea.Message)
CanStart = False
Exit Sub
End Try
'Creates a VesselLyrOverlay for the InMemoryFeatureLayers (in this case only one InMemoryFeatureLayer)
Dim DynamicLayerOverlay As LayerOverlay = New LayerOverlay()
DynamicLayerOverlay.Name = “DynamicOverlay”
'Adds the InMemoryFeatureLayer with id “ShipLayer”.
DynamicLayerOverlay.Layers.Add(“ShipLayer”, ShipLayer)
DynamicLayerOverlay.Layers.Add(“TrailLayer”, TrailLayer)
'Adds the LayerOvelay to the Overlays collection of the map with id “VesselLyrOverlay”
WinformsMap1.Overlays.Add(“ShipLayerOverlay”, DynamicLayerOverlay)
Dim labelOverlay As New LayerOverlay()
labelOverlay.Name = “LabelOverlay”
labelOverlay.Layers.Add(“Label”, ShipLayer)
WinformsMap1.Overlays.Add(“LabelOverlay”, labelOverlay)
'ShipLayer.Close() ’ should I close this? I cannot Center on Vessel if I do this!
End Sub
Styling code:
Imports System.Collections.Generic
Imports System.Collections.ObjectModel
Imports System.Linq
Imports System.Text
Imports ThinkGeo.MapSuite.Core
’Namespace RotatedImageStyle
Public Class RotatedImageStyle
Inherits Style
Private m_geoImage As GeoImage
Private m_angleColumnName As String
Public Sub New()
Me.New(New GeoImage(), String.Empty)
End Sub
Public Sub New(ByVal geoImage As GeoImage, ByVal angleColumnName As String)
Me.m_geoImage = geoImage
Me.m_angleColumnName = angleColumnName
End Sub
Public Property GeoImage() As GeoImage
Get
Return m_geoImage
End Get
Set(ByVal value As GeoImage)
GeoImage = value
End Set
End Property
Public Property AngleColumnName() As String
Get
Return m_angleColumnName
End Get
Set(ByVal value As String)
AngleColumnName = value
End Set
End Property
Protected Overrides Sub DrawCore(ByVal features As IEnumerable(Of Feature), ByVal canvas As GeoCanvas, ByVal labelsInThisLayer As Collection(Of SimpleCandidate), ByVal labelsInAllLayers As Collection(Of SimpleCandidate))
For Each feature As Feature In features
'Dim angleData As Single = Convert.ToSingle(feature.ColumnValues(m_angleColumnName))
Dim angleData As Single = Convert.ToSingle(IIf(feature.ColumnValues(m_angleColumnName) <> “”, feature.ColumnValues(m_angleColumnName), 0))
Dim pointShape As PointShape = DirectCast(feature.GetShape(), PointShape)
'angleData);
canvas.DrawWorldImageWithoutScaling(m_geoImage, pointShape.X, pointShape.Y, DrawingLevel.LevelFour, 0, 0, _
360 - angleData)
Next
End Sub
Protected Overrides Function GetRequiredColumnNamesCore() As Collection(Of String)
Dim columns As New Collection(Of String)()
If Not columns.Contains(m_angleColumnName) Then
columns.Add(m_angleColumnName)
End If
Return columns
End Function
End Class
Thanks,
Dave
David,
Thanks for your post and questions.
Just let you know that I have sent this issue to our development team and I will try to focus on it as soon as the holiday is over on the middle of the next week, sorry for the inconvenience for now.
Any more questions please feel free to let me know.
Thanks.
Yale
Hi Yale - any developments on this one?
Thanks,
Dave
David,
Thanks for your post and question
I think this issue should have been fixed, while I have a few things to make sure.
1)Is ShipLayer a MsSqlFeatureLayer or a ShapeFileFeatureLayer? I suppose it is a MsSqlFeatureaLayer.
2)When querying against the ShipLayer, we will pass in a rectangle bounding box which will exceed two hemispheres, which will cause the problem, right?
Thanks.
Yale
1) It is a MsSqlFeatureLayer
2) I believe the problem is that ThinkGeo passes a bounding box which exceeds 2 hemispheres (1 hemisphere?) to SQL Server. This happens even when my points are in a limited locale - within a 5° area around Malaysia.
In fact there are a number of tasks that ThinkGeo does that cause that same error or sometimes this error:
“A .NET Framework error occurred during execution of user-defined routine or aggregate “geography”:
System.FormatException: 24201: Latitude values must be between -90 and 90 degrees.”
I am not sure why it does that as none of my items are ‘off the edge of the world’ and all are points so there shouldn’t be a way a point could be in 2 hemispheres at once - unless by ‘geography instance’ it is talking about the bounding box…
Hi David,
Thanks for providing the further information, I think it should be caused by the error Ring orientation of the Polygon or the Linestring which excesses 1 hemisphere, can you give us several demo Sql statement using “ExecutingSqlStatement” event? Or is it possible to give us a demo data for test?
Thanks,
Johnny
There are no polygons or lines in my data set. I can possibly give you a data set though it will be pretty big - I presume you would need an MDF file? And the associated LDF log file?
Maybe this ExecutingSqlStatement is the way to go - what is it an event for? Can't see any samples anywhere on your site.... Do you have a line or 2 of code to help me get the info to you faster than me wading through the API? I do see 1 example here:
gis.thinkgeo.com/Support/DiscussionForums/tabid/143/aff/11/aft/7192/afv/topic/Default.aspx
but am not sure whether that relates to my problem. In my case the crash can even occur trying to execute a ThinkGeo command:
WinformsMap1.Refresh()
Any chance that the code in that link is what I am after? If so, where would I put it, based on the line that is crashing in the original Winforms1_Mousedown routine?
Thanks,
Dave
David,
I think it is better we could get the problem recreated using the event ExecutingSqlStatement, the event will pass out every sql statement sent to the SQL server, so if possible, try following code snippet, hope it helps:
MsSql2008FeatureLayer msSql2008FeatureLayer = new MsSql2008FeatureLayer("","",""); ((MsSql2008FeatureSource)(msSql2008FeatureLayer.FeatureSource)).ExecutingSqlStatement += new EventHandler<ExecutingSqlStatementMsSql2008FeatureSourceEventArgs>(DisplayShapeMap_ExecutingSqlStatement);
void DisplayShapeMap_ExecutingSqlStatement(object sender, ExecutingSqlStatementMsSql2008FeatureSourceEventArgs e)
{
System.Diagnostics.Debug.WriteLine(e.SqlStatement);
}
Any more questions please feel free to let me know.
Thanks.
Yale
I agree that would be the most helpful way to see what is happening.
Any chance you can provide that snippet in VB? Using developerfusion.com/tools/convert/csharp-to-vb/ to translate results in:
– line 1 col 1: EOF expected
David,
Sorry for the C# sample code not being sufficiently broad. Yang will respond to you with the more complete code in both C# and VB. Thank you.
Thanks - looking forward to the VB version that will somehow incorporate with the crash in the MouseDown event.
Not to say that the C# version won’t work, but if it won’t translate in developerfusion.com/tools/convert/csharp-to-vb/ then it’s beyond my ability to figure out what went wrong, not being conversant in C#.
David,
Thanks for your post and questions. Following code snippet is the VB version, hope it helps.
Dim msSql2008FeatureLayer As New MsSql2008FeatureLayer("", "", "")
AddHandler DirectCast(msSql2008FeatureLayer.FeatureSource, MsSql2008FeatureSource).ExecutingSqlStatement, AddressOf DisplayShapeMap_ExecutingSqlStatement
Private Sub DisplayShapeMap_ExecutingSqlStatement(ByVal sender As Object, ByVal e As ExecutingSqlStatementMsSql2008FeatureSourceEventArgs)
System.Diagnostics.Debug.WriteLine(e.SqlStatement)
End Sub
Any more questions please feel free to let me know.
Thanks.
Yale
Ok, that is very helpful - we should be able to see what SQL Server doesn't like about the SQL statement.
To summarise, here is my code:
Private Sub WinformsMap1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles WinformsMap1.MouseDown
' I want to be able to click on a vessel or maybe a target or other object to interrogate it, etc. How do I do that?
Debug.Print("WinformsMap1_MouseDown(): Triggered. Button clicked was " & e.Button.ToString)
If Not Compiled() Then
'Stop
End If
'Exit Sub
'Gets the closest feature from where the user clicked on.
Dim shipLayer2 As MsSql2008FeatureLayer = WinformsMap1.FindFeatureLayer("ShipLayer") ' DirectCast(MapEngine.StaticLayers("PointLayer"), ShapeFileFeatureLayer)
shipLayer2.Open()
Dim clickedPointShape As PointShape = ExtentHelper.ToWorldCoordinate(mapEngine.CurrentExtent, e.X, e.Y, WinformsMap1.Width, WinformsMap1.Height)
Dim clickedFeatures As Collection(Of Feature) = shipLayer2.QueryTools.GetFeaturesNearestTo(clickedPointShape, GeographyUnit.DecimalDegree, 1, ReturningColumnsType.AllColumns)
shipLayer2.Close()
When I left-click on a ship in ShipLayer, I get a crash in the 2nd last line (Dim clickedFeatures.....):
A first chance exception of type 'System.Data.SqlClient.SqlException' occurred in MapSuiteCore.dll
System.Transactions Critical: 0 :
<tracerecord severity="Critical">
<traceidentifier>
msdn.microsoft.com/TraceCodes/System/ActivityTracing/2004/07/Reliability/Exception/Unhandled
</traceidentifier>
<description>Unhandled exception</description><appdomain>MVMControl3.vshost.exe</appdomain><exception><exceptiontype>System.Data.SqlClient.SqlException, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</exceptiontype><message>A .NET Framework error occurred during execution of user-defined routine or aggregate "geography":
Microsoft.SqlServer.Types.GLArgumentException: 24205: The specified input does not represent a valid geography instance because it exceeds a single hemisphere. Each geography instance must fit inside a single hemisphere. A common reason for this error is that a polygon has the wrong ring orientation.</message></exception>
</tracerecord>
There appear to be quite a lot of SQL statements considering I just click once on the map - I will include them all just in case it is not the last line that is causing the crash:
WinformsMap1_MouseDown(): Triggered. Button clicked was Left
e.SqlStatement=SELECT COUNT(*) FROM Vessels WHERE VDateTime >= GETUTCDATE()-0.04166667;
e.SqlStatement=SELECT allTypes.name FROM sys.columns allColumns, sys.types allTypes, sys.all_views allViews WHERE allColumns.object_id=allViews.object_id AND allColumns.user_type_id=allTypes.user_type_id AND allTypes.system_type_id=240 AND allViews.name='Vessels'union SELECT allTypes.name FROM sys.columns allColumns, sys.tables allTables, sys.types allTypes WHERE allColumns.object_id=allTables.object_id AND allColumns.user_type_id=allTypes.user_type_id AND allTypes.system_type_id=240 AND allTables.name='Vessels'
e.SqlStatement=SELECT ID,Name,UseMe,VLat,VLon,VDateTime,VSpd,VCMG,MaxSpeedEver,WGS84Loc.STAsBinary() as WGS84Loc,FirstDateTime,Dimensions,Owner,Charterer,Origin,Label,Destination,ETA,Type_Cargo,IMO_No,CallSign,MsgType,Voltage,IO,OceanRegion,Temp,RPM,SigStrength,Altitude,WGS84Loc.STAsBinary() as WGS84Loc FROM Vessels WHERE (geography::STGeomFromText(@geography,4326).STIntersects(WGS84Loc)=1) AND VDATETIME >= GETUTCDATE()-0.04166667;
e.SqlStatement=SELECT allTypes.name FROM sys.columns allColumns, sys.types allTypes, sys.all_views allViews WHERE allColumns.object_id=allViews.object_id AND allColumns.user_type_id=allTypes.user_type_id AND allTypes.system_type_id=240 AND allViews.name='Vessels'union SELECT allTypes.name FROM sys.columns allColumns, sys.tables allTables, sys.types allTypes WHERE allColumns.object_id=allTables.object_id AND allColumns.user_type_id=allTypes.user_type_id AND allTypes.system_type_id=240 AND allTables.name='Vessels'
e.SqlStatement=SELECT ID,Name,UseMe,VLat,VLon,VDateTime,VSpd,VCMG,MaxSpeedEver,WGS84Loc.STAsBinary() as WGS84Loc,FirstDateTime,Dimensions,Owner,Charterer,Origin,Label,Destination,ETA,Type_Cargo,IMO_No,CallSign,MsgType,Voltage,IO,OceanRegion,Temp,RPM,SigStrength,Altitude,WGS84Loc.STAsBinary() as WGS84Loc FROM Vessels WHERE (geography::STGeomFromText(@geography,4326).STIntersects(WGS84Loc)=1) AND VDATETIME >= GETUTCDATE()-0.04166667;
e.SqlStatement=SELECT allTypes.name FROM sys.columns allColumns, sys.types allTypes, sys.all_views allViews WHERE allColumns.object_id=allViews.object_id AND allColumns.user_type_id=allTypes.user_type_id AND allTypes.system_type_id=240 AND allViews.name='Vessels'union SELECT allTypes.name FROM sys.columns allColumns, sys.tables allTables, sys.types allTypes WHERE allColumns.object_id=allTables.object_id AND allColumns.user_type_id=allTypes.user_type_id AND allTypes.system_type_id=240 AND allTables.name='Vessels'
e.SqlStatement=SELECT ID,Name,UseMe,VLat,VLon,VDateTime,VSpd,VCMG,MaxSpeedEver,WGS84Loc.STAsBinary() as WGS84Loc,FirstDateTime,Dimensions,Owner,Charterer,Origin,Label,Destination,ETA,Type_Cargo,IMO_No,CallSign,MsgType,Voltage,IO,OceanRegion,Temp,RPM,SigStrength,Altitude,WGS84Loc.STAsBinary() as WGS84Loc FROM Vessels WHERE (geography::STGeomFromText(@geography,4326).STIntersects(WGS84Loc)=1) AND VDATETIME >= GETUTCDATE()-0.04166667;
e.SqlStatement=SELECT allTypes.name FROM sys.columns allColumns, sys.types allTypes, sys.all_views allViews WHERE allColumns.object_id=allViews.object_id AND allColumns.user_type_id=allTypes.user_type_id AND allTypes.system_type_id=240 AND allViews.name='Vessels'union SELECT allTypes.name FROM sys.columns allColumns, sys.tables allTables, sys.types allTypes WHERE allColumns.object_id=allTables.object_id AND allColumns.user_type_id=allTypes.user_type_id AND allTypes.system_type_id=240 AND allTables.name='Vessels'
e.SqlStatement=SELECT ID,Name,UseMe,VLat,VLon,VDateTime,VSpd,VCMG,MaxSpeedEver,WGS84Loc.STAsBinary() as WGS84Loc,FirstDateTime,Dimensions,Owner,Charterer,Origin,Label,Destination,ETA,Type_Cargo,IMO_No,CallSign,MsgType,Voltage,IO,OceanRegion,Temp,RPM,SigStrength,Altitude,WGS84Loc.STAsBinary() as WGS84Loc FROM Vessels WHERE (geography::STGeomFromText(@geography,4326).STIntersects(WGS84Loc)=1) AND VDATETIME >= GETUTCDATE()-0.04166667;
e.SqlStatement=SELECT allTypes.name FROM sys.columns allColumns, sys.types allTypes, sys.all_views allViews WHERE allColumns.object_id=allViews.object_id AND allColumns.user_type_id=allTypes.user_type_id AND allTypes.system_type_id=240 AND allViews.name='Vessels'union SELECT allTypes.name FROM sys.columns allColumns, sys.tables allTables, sys.types allTypes WHERE allColumns.object_id=allTables.object_id AND allColumns.user_type_id=allTypes.user_type_id AND allTypes.system_type_id=240 AND allTables.name='Vessels'
e.SqlStatement=SELECT ID,Name,UseMe,VLat,VLon,VDateTime,VSpd,VCMG,MaxSpeedEver,WGS84Loc.STAsBinary() as WGS84Loc,FirstDateTime,Dimensions,Owner,Charterer,Origin,Label,Destination,ETA,Type_Cargo,IMO_No,CallSign,MsgType,Voltage,IO,OceanRegion,Temp,RPM,SigStrength,Altitude,WGS84Loc.STAsBinary() as WGS84Loc FROM Vessels WHERE (geography::STGeomFromText(@geography,4326).STIntersects(WGS84Loc)=1) AND VDATETIME >= GETUTCDATE()-0.04166667;
e.SqlStatement=SELECT allTypes.name FROM sys.columns allColumns, sys.types allTypes, sys.all_views allViews WHERE allColumns.object_id=allViews.object_id AND allColumns.user_type_id=allTypes.user_type_id AND allTypes.system_type_id=240 AND allViews.name='Vessels'union SELECT allTypes.name FROM sys.columns allColumns, sys.tables allTables, sys.types allTypes WHERE allColumns.object_id=allTables.object_id AND allColumns.user_type_id=allTypes.user_type_id AND allTypes.system_type_id=240 AND allTables.name='Vessels'
e.SqlStatement=SELECT ID,Name,UseMe,VLat,VLon,VDateTime,VSpd,VCMG,MaxSpeedEver,WGS84Loc.STAsBinary() as WGS84Loc,FirstDateTime,Dimensions,Owner,Charterer,Origin,Label,Destination,ETA,Type_Cargo,IMO_No,CallSign,MsgType,Voltage,IO,OceanRegion,Temp,RPM,SigStrength,Altitude,WGS84Loc.STAsBinary() as WGS84Loc FROM Vessels WHERE (geography::STGeomFromText(@geography,4326).STIntersects(WGS84Loc)=1) AND VDATETIME >= GETUTCDATE()-0.04166667;
e.SqlStatement=SELECT allTypes.name FROM sys.columns allColumns, sys.types allTypes, sys.all_views allViews WHERE allColumns.object_id=allViews.object_id AND allColumns.user_type_id=allTypes.user_type_id AND allTypes.system_type_id=240 AND allViews.name='Vessels'union SELECT allTypes.name FROM sys.columns allColumns, sys.tables allTables, sys.types allTypes WHERE allColumns.object_id=allTables.object_id AND allColumns.user_type_id=allTypes.user_type_id AND allTypes.system_type_id=240 AND allTables.name='Vessels'
e.SqlStatement=SELECT ID,Name,UseMe,VLat,VLon,VDateTime,VSpd,VCMG,MaxSpeedEver,WGS84Loc.STAsBinary() as WGS84Loc,FirstDateTime,Dimensions,Owner,Charterer,Origin,Label,Destination,ETA,Type_Cargo,IMO_No,CallSign,MsgType,Voltage,IO,OceanRegion,Temp,RPM,SigStrength,Altitude,WGS84Loc.STAsBinary() as WGS84Loc FROM Vessels WHERE (geography::STGeomFromText(@geography,4326).STIntersects(WGS84Loc)=1) AND VDATETIME >= GETUTCDATE()-0.04166667;
e.SqlStatement=SELECT allTypes.name FROM sys.columns allColumns, sys.types allTypes, sys.all_views allViews WHERE allColumns.object_id=allViews.object_id AND allColumns.user_type_id=allTypes.user_type_id AND allTypes.system_type_id=240 AND allViews.name='Vessels'union SELECT allTypes.name FROM sys.columns allColumns, sys.tables allTables, sys.types allTypes WHERE allColumns.object_id=allTables.object_id AND allColumns.user_type_id=allTypes.user_type_id AND allTypes.system_type_id=240 AND allTables.name='Vessels'
e.SqlStatement=SELECT ID,Name,UseMe,VLat,VLon,VDateTime,VSpd,VCMG,MaxSpeedEver,WGS84Loc.STAsBinary() as WGS84Loc,FirstDateTime,Dimensions,Owner,Charterer,Origin,Label,Destination,ETA,Type_Cargo,IMO_No,CallSign,MsgType,Voltage,IO,OceanRegion,Temp,RPM,SigStrength,Altitude,WGS84Loc.STAsBinary() as WGS84Loc FROM Vessels WHERE (geography::STGeomFromText(@geography,4326).STIntersects(WGS84Loc)=1) AND VDATETIME >= GETUTCDATE()-0.04166667;
e.SqlStatement=SELECT allTypes.name FROM sys.columns allColumns, sys.types allTypes, sys.all_views allViews WHERE allColumns.object_id=allViews.object_id AND allColumns.user_type_id=allTypes.user_type_id AND allTypes.system_type_id=240 AND allViews.name='Vessels'union SELECT allTypes.name FROM sys.columns allColumns, sys.tables allTables, sys.types allTypes WHERE allColumns.object_id=allTables.object_id AND allColumns.user_type_id=allTypes.user_type_id AND allTypes.system_type_id=240 AND allTables.name='Vessels'
e.SqlStatement=SELECT ID,Name,UseMe,VLat,VLon,VDateTime,VSpd,VCMG,MaxSpeedEver,WGS84Loc.STAsBinary() as WGS84Loc,FirstDateTime,Dimensions,Owner,Charterer,Origin,Label,Destination,ETA,Type_Cargo,IMO_No,CallSign,MsgType,Voltage,IO,OceanRegion,Temp,RPM,SigStrength,Altitude,WGS84Loc.STAsBinary() as WGS84Loc FROM Vessels WHERE (geography::STGeomFromText(@geography,4326).STIntersects(WGS84Loc)=1) AND VDATETIME >= GETUTCDATE()-0.04166667;
e.SqlStatement=SELECT allTypes.name FROM sys.columns allColumns, sys.types allTypes, sys.all_views allViews WHERE allColumns.object_id=allViews.object_id AND allColumns.user_type_id=allTypes.user_type_id AND allTypes.system_type_id=240 AND allViews.name='Vessels'union SELECT allTypes.name FROM sys.columns allColumns, sys.tables allTables, sys.types allTypes WHERE allColumns.object_id=allTables.object_id AND allColumns.user_type_id=allTypes.user_type_id AND allTypes.system_type_id=240 AND allTables.name='Vessels'
e.SqlStatement=SELECT ID,Name,UseMe,VLat,VLon,VDateTime,VSpd,VCMG,MaxSpeedEver,WGS84Loc.STAsBinary() as WGS84Loc,FirstDateTime,Dimensions,Owner,Charterer,Origin,Label,Destination,ETA,Type_Cargo,IMO_No,CallSign,MsgType,Voltage,IO,OceanRegion,Temp,RPM,SigStrength,Altitude,WGS84Loc.STAsBinary() as WGS84Loc FROM Vessels WHERE (geography::STGeomFromText(@geography,4326).STIntersects(WGS84Loc)=1) AND VDATETIME >= GETUTCDATE()-0.04166667;
e.SqlStatement=SELECT allTypes.name FROM sys.columns allColumns, sys.types allTypes, sys.all_views allViews WHERE allColumns.object_id=allViews.object_id AND allColumns.user_type_id=allTypes.user_type_id AND allTypes.system_type_id=240 AND allViews.name='Vessels'union SELECT allTypes.name FROM sys.columns allColumns, sys.tables allTables, sys.types allTypes WHERE allColumns.object_id=allTables.object_id AND allColumns.user_type_id=allTypes.user_type_id AND allTypes.system_type_id=240 AND allTables.name='Vessels'
e.SqlStatement=SELECT ID,Name,UseMe,VLat,VLon,VDateTime,VSpd,VCMG,MaxSpeedEver,WGS84Loc.STAsBinary() as WGS84Loc,FirstDateTime,Dimensions,Owner,Charterer,Origin,Label,Destination,ETA,Type_Cargo,IMO_No,CallSign,MsgType,Voltage,IO,OceanRegion,Temp,RPM,SigStrength,Altitude,WGS84Loc.STAsBinary() as WGS84Loc FROM Vessels WHERE (geography::STGeomFromText(@geography,4326).STIntersects(WGS84Loc)=1) AND VDATETIME >= GETUTCDATE()-0.04166667;
e.SqlStatement=SELECT allTypes.name FROM sys.columns allColumns, sys.types allTypes, sys.all_views allViews WHERE allColumns.object_id=allViews.object_id AND allColumns.user_type_id=allTypes.user_type_id AND allTypes.system_type_id=240 AND allViews.name='Vessels'union SELECT allTypes.name FROM sys.columns allColumns, sys.tables allTables, sys.types allTypes WHERE allColumns.object_id=allTables.object_id AND allColumns.user_type_id=allTypes.user_type_id AND allTypes.system_type_id=240 AND allTables.name='Vessels'
e.SqlStatement=SELECT ID,Name,UseMe,VLat,VLon,VDateTime,VSpd,VCMG,MaxSpeedEver,WGS84Loc.STAsBinary() as WGS84Loc,FirstDateTime,Dimensions,Owner,Charterer,Origin,Label,Destination,ETA,Type_Cargo,IMO_No,CallSign,MsgType,Voltage,IO,OceanRegion,Temp,RPM,SigStrength,Altitude,WGS84Loc.STAsBinary() as WGS84Loc FROM Vessels WHERE (geography::STGeomFromText(@geography,4326).STIntersects(WGS84Loc)=1) AND VDATETIME >= GETUTCDATE()-0.04166667;
e.SqlStatement=SELECT allTypes.name FROM sys.columns allColumns, sys.types allTypes, sys.all_views allViews WHERE allColumns.object_id=allViews.object_id AND allColumns.user_type_id=allTypes.user_type_id AND allTypes.system_type_id=240 AND allViews.name='Vessels'union SELECT allTypes.name FROM sys.columns allColumns, sys.tables allTables, sys.types allTypes WHERE allColumns.object_id=allTables.object_id AND allColumns.user_type_id=allTypes.user_type_id AND allTypes.system_type_id=240 AND allTables.name='Vessels'
e.SqlStatement=SELECT ID,Name,UseMe,VLat,VLon,VDateTime,VSpd,VCMG,MaxSpeedEver,WGS84Loc.STAsBinary() as WGS84Loc,FirstDateTime,Dimensions,Owner,Charterer,Origin,Label,Destination,ETA,Type_Cargo,IMO_No,CallSign,MsgType,Voltage,IO,OceanRegion,Temp,RPM,SigStrength,Altitude,WGS84Loc.STAsBinary() as WGS84Loc FROM Vessels WHERE (geography::STGeomFromText(@geography,4326).STIntersects(WGS84Loc)=1) AND VDATETIME >= GETUTCDATE()-0.04166667;
e.SqlStatement=SELECT allTypes.name FROM sys.columns allColumns, sys.types allTypes, sys.all_views allViews WHERE allColumns.object_id=allViews.object_id AND allColumns.user_type_id=allTypes.user_type_id AND allTypes.system_type_id=240 AND allViews.name='Vessels'union SELECT allTypes.name FROM sys.columns allColumns, sys.tables allTables, sys.types allTypes WHERE allColumns.object_id=allTables.object_id AND allColumns.user_type_id=allTypes.user_type_id AND allTypes.system_type_id=240 AND allTables.name='Vessels'
e.SqlStatement=SELECT ID,Name,UseMe,VLat,VLon,VDateTime,VSpd,VCMG,MaxSpeedEver,WGS84Loc.STAsBinary() as WGS84Loc,FirstDateTime,Dimensions,Owner,Charterer,Origin,Label,Destination,ETA,Type_Cargo,IMO_No,CallSign,MsgType,Voltage,IO,OceanRegion,Temp,RPM,SigStrength,Altitude,WGS84Loc.STAsBinary() as WGS84Loc FROM Vessels WHERE (geography::STGeomFromText(@geography,4326).STIntersects(WGS84Loc)=1) AND VDATETIME >= GETUTCDATE()-0.04166667;
e.SqlStatement=SELECT allTypes.name FROM sys.columns allColumns, sys.types allTypes, sys.all_views allViews WHERE allColumns.object_id=allViews.object_id AND allColumns.user_type_id=allTypes.user_type_id AND allTypes.system_type_id=240 AND allViews.name='Vessels'union SELECT allTypes.name FROM sys.columns allColumns, sys.tables allTables, sys.types allTypes WHERE allColumns.object_id=allTables.object_id AND allColumns.user_type_id=allTypes.user_type_id AND allTypes.system_type_id=240 AND allTables.name='Vessels'
e.SqlStatement=SELECT ID,Name,UseMe,VLat,VLon,VDateTime,VSpd,VCMG,MaxSpeedEver,WGS84Loc.STAsBinary() as WGS84Loc,FirstDateTime,Dimensions,Owner,Charterer,Origin,Label,Destination,ETA,Type_Cargo,IMO_No,CallSign,MsgType,Voltage,IO,OceanRegion,Temp,RPM,SigStrength,Altitude,WGS84Loc.STAsBinary() as WGS84Loc FROM Vessels WHERE (geography::STGeomFromText(@geography,4326).STIntersects(WGS84Loc)=1) AND VDATETIME >= GETUTCDATE()-0.04166667;
e.SqlStatement=SELECT allTypes.name FROM sys.columns allColumns, sys.types allTypes, sys.all_views allViews WHERE allColumns.object_id=allViews.object_id AND allColumns.user_type_id=allTypes.user_type_id AND allTypes.system_type_id=240 AND allViews.name='Vessels'union SELECT allTypes.name FROM sys.columns allColumns, sys.tables allTables, sys.types allTypes WHERE allColumns.object_id=allTables.object_id AND allColumns.user_type_id=allTypes.user_type_id AND allTypes.system_type_id=240 AND allTables.name='Vessels'
e.SqlStatement=SELECT ID,Name,UseMe,VLat,VLon,VDateTime,VSpd,VCMG,MaxSpeedEver,WGS84Loc.STAsBinary() as WGS84Loc,FirstDateTime,Dimensions,Owner,Charterer,Origin,Label,Destination,ETA,Type_Cargo,IMO_No,CallSign,MsgType,Voltage,IO,OceanRegion,Temp,RPM,SigStrength,Altitude,WGS84Loc.STAsBinary() as WGS84Loc FROM Vessels WHERE (geography::STGeomFromText(@geography,4326).STIntersects(WGS84Loc)=1) AND VDATETIME >= GETUTCDATE()-0.04166667;
A first chance exception of type 'System.Data.SqlClient.SqlException' occurred in MapSuiteCore.dll
Hope you can understand all of that
David,
I hope you are still at work for the day. Yale will come in a little bit later today and I am trying to anticipate what he will need to solve your last problem. I think it will really help to have that "ShipLayer". Is there a way we could get it? Otherwise, we will try to figure out why the crash happens based on what you included in your last post. Thank you.