[fdo-users] SQL 2008 Spatial + FDO 3.4 + MGOS 2.1 Beta selection, SQL views and other issues

miansi AndreiSinelnikov at SierraSystems.com
Mon Aug 24 16:07:05 EDT 2009


I have:
0. Windows Server 2008 x64
1. SQL 2008 Spatial
2. Fresh install of MGOS v2.1 Beta 1 and FDO v3.4.
3. Application, which populates SQL table with spatial data from SHP file
using stored procedures, i.e.:
         	   INSERT INTO [dbo].[Asset]
			, [Geo] 
	   SELECT ...
			, GEOMETRY::STGeomFromText('POINT (15827.171034638939
5548789.1557188816)', 0) 

I am using geometry (not geography) and as you can see SRID set to be 0

I had some issues with FDO v3.3 and got fixed SQLServerSpatialProvider.dll
from Autodesk to resolve them (inability to select features on the map if
layer based on the SQL view due to the lack of primary key -

Well, I see exactly the same behaviour in MGOS v2.1 + FDO v3.4 - I am not
able to select features on the map if my layer retrieved from the SQL view.
Also I am not able to see layers from SQL tables.

1. Create Dataconnection and validate it in Maestro. One warning and lots of
information messages advising that features will not be selectable:
    Validating file:
Warning - OSGeo.MapGuide.MaestroAPI.FeatureSource: Spatial context extent
appears to be invalid (or default)
    Information - OSGeo.MapGuide.MaestroAPI.FeatureSource: No primary key
defined for class: geo:vw_Road_Intersection, features will not be selectable

I do not know how to fix "Spatial context extent appears to be invalid (or
default)" - I did Coordinate System override using projection information
from the shape file and I set Initial Map View to current layer extent. No
matter what I do - I always get this warning. Any idea what to do to fix it?



2. Create Layer based on the SQL view. View is quite simple - inner join of
2 tables


Note: Attempt to "Preview the item" in Maestro will result in error:


3. Add layer to the map and view it. Everything fine. Only you cannot select
features from the layer.

4. Go back to the layer and change it source to be an actual SQL table - see
error in MGOS Error Log:

<2009-08-24T12:18:25> 	4192	Ajax Viewer	::1	Administrator
 Error: Failed to stylize layer: Lr
        An exception occurred in FDO component.
        RDBMS: Incompatible column type 
  - MgMappingUtil.StylizeLayers() line 776 file
<2009-08-24T12:18:28> 	6524	Ajax Viewer	::1	Administrator
 Error: An exception occurred in FDO component.
        RDBMS: Incompatible column type 
  - MgRenderingServiceHandler.ProcessOperation() line 83 file
  - MgOpQueryFeatures.Execute() line 125 file
  - MgServerRenderingService.QueryFeatures() line 689 file
  - MgServerRenderingService.RenderForSelection() line 1356 file
  - MgServerFeatureService.SelectFeatures() line 405 file
  - MgServerSelectFeatures.SelectFeatures() line 246 file

I did uncheck all columns and checked only one with data type int. No luck.
Of course - layer dissapears from the map.

I tested this table in FDO Toolbox. Strangely enough - I noticed
"Incompatible column type" error only when I select "uniqueidentifier" type
of column, but this column unchecked in Maestro and I still see an error:


FDO Toolbox:

Attempt to do data query in FDO Toolbox against the view resulted in error
"Invalid object name vw_Road_Intersection":

I believe this happens because of schema name is other than "dbo" - it is
"geo". As soon as I changed schema - I was able to run Data Query and saw
results on the Map View

Long story short:
If it was so easy to fix FDO v3.3, so you can select features from SQL View
- will it be possible to fix it in FDO 3.4?

Thank you!


View this message in context: http://n2.nabble.com/SQL-2008-Spatial-FDO-3-4-MGOS-2-1-Beta-selection-SQL-views-and-other-issues-tp3505792p3505792.html
Sent from the FDO Users mailing list archive at Nabble.com.

More information about the fdo-users mailing list