[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


Hello,

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 -
http://n2.nabble.com/SQL-2008-View-with-JOINS-Not-able-to-select-features-on-the-layer-td2356197.html#a2397992).

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.

Steps:
1. Create Dataconnection and validate it in Maestro. One warning and lots of
information messages advising that features will not be selectable:
    Validating file:
Session:4d1d0c5e-7304-102c-8000-005056c00001_en_0A2220EA0AFC0AFB0AFA//58487d8f-e6f5-41a9-a4b2-28ae4eeb3ec6.FeatureSource
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?

http://n2.nabble.com/file/n3505792/Override.png 

http://n2.nabble.com/file/n3505792/Extent.png 

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

http://n2.nabble.com/file/n3505792/View%2BDesign.png 

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

http://n2.nabble.com/file/n3505792/Layer%2BError.png 

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 
 StackTrace:
  - MgMappingUtil.StylizeLayers() line 776 file
c:\osgeo\mapguide_21\mgdev\server\src\services\mapping\MappingUtil.cpp	
<2009-08-24T12:18:28> 	6524	Ajax Viewer	::1	Administrator
 Error: An exception occurred in FDO component.
        RDBMS: Incompatible column type 
 StackTrace:
  - MgRenderingServiceHandler.ProcessOperation() line 83 file
c:\osgeo\mapguide_21\mgdev\server\src\services\rendering\RenderingServiceHandler.cpp
  - MgOpQueryFeatures.Execute() line 125 file
c:\osgeo\mapguide_21\mgdev\server\src\services\rendering\OpQueryFeatures.cpp
  - MgServerRenderingService.QueryFeatures() line 689 file
c:\osgeo\mapguide_21\mgdev\server\src\services\rendering\ServerRenderingService.cpp
  - MgServerRenderingService.RenderForSelection() line 1356 file
c:\osgeo\mapguide_21\mgdev\server\src\services\rendering\ServerRenderingService.cpp
  - MgServerFeatureService.SelectFeatures() line 405 file
c:\osgeo\mapguide_21\mgdev\server\src\services\feature\ServerFeatureService.cpp
  - MgServerSelectFeatures.SelectFeatures() line 246 file
c:\osgeo\mapguide_21\mgdev\server\src\services\feature\ServerSelectFeatures.cpp

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:

Maestro:
http://n2.nabble.com/file/n3505792/FDO%2BToolbox%2B-%2Bguid.png 

FDO Toolbox:
http://n2.nabble.com/file/n3505792/FDO%2BToolbox%2B-%2Bguid2.png 


Attempt to do data query in FDO Toolbox against the view resulted in error
"Invalid object name vw_Road_Intersection":
http://n2.nabble.com/file/n3505792/FDO%2BToolbox%2Berror.png 

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!

Andrei

-- 
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