[mapguide-users] RE: Points from Sql/ODBC data source not showing

soudemans soudemans at ruekert-mielke.com
Tue Dec 6 16:36:51 EST 2011


GordonL wrote
> 
> In your final view in SQL Server 2008, you should just create a Point
> object with your two x and y columns.
> like this:
> /select geometry::Point(g.PNT_X,g.PNT_Y,0) as GEOM
> 	  FROM tbMYTABLE g/
> Then you can use the FDO for SQL Server Spatial rather than ODBC.
> 

Thanks Gordon,

I'll have to try that next, though my level of frustration with the FDOs not
working right is beginning to reach a boiling point.  Point and case, I
thought I'd try my hand (again) at creating a simple Join in the
FeatureSource editor.  This is to link some SQL data to SDF line features
(no points).  So I created an ODBC - SQL Server connection (the only
available for this purpose) to my data source.  I previewed the data which
is a SQL View that uses a CASE statement as follows:

SELECT PipeID,
    (CASE
         WHEN [WorkType] IS NULL THEN 'Yellow' 
         WHEN [WorkType] IN (N'Maintenance', N'Televising') AND
MonthsNotCleaned > 60 THEN 'Red' 
         WHEN [WorkType] IN (N'Root Cutting') AND MonthsNotCleaned > 12 THEN
'Red' 
         WHEN [WorkType] IN (N'Grease', N'Trouble') AND MonthsNotCleaned > 3
THEN 'Red' 
         ELSE 'Green'
    END) AS Condition
FROM dbo.qrySanMainLastCleaning

The data previews exactly as it should in the data source editor, so far so
good.  now I go to my sdf data source and add a join to my query.  No
errors, but when I preview the data the pipeID comes in, but the Condition
calculated field shows up as all nulls.  The map shows the default color
only which means that this is not a preview issue. Is this something I can't
do?  I also tried this with a SHP data source, same result.  I will let this
go for now and try Gordon's suggestion first.

Hey, thanks to you Gordon and anyone else looking at this stuff.  Your help
is much appreciated.

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Points-from-Sql-ODBC-data-source-not-showing-tp7021115p7068485.html
Sent from the MapGuide Users mailing list archive at Nabble.com.


More information about the mapguide-users mailing list