[Geoserver-users] Publish WMS from Microsoft SQL Server Layer with GeoServer 2.17.2

Hello, i’m trying to publish a WMS Layer from a SQL View. The geodata is in a geometry column in a Microsoft SQL Server. The created view only has two columns: ID and geometry, and only two entries, where both are simple linestrings.

I can add the view as Layer, but if i try to view it in the layer preview, i just get an empty white rectangle. Both with OpenLayers and the WMS image options. The wfs options at least return something.

I can preview the lines directly from the View in SSMS, as shown in the attached image, but after adding it in GeoServer as Layer from SQL View, the WMS PNG option returns this empty rectangle. which is also attached.

I use the default line style which works perfectly for the sample line layers.

What could cause this to happen?

The two geometry entries within the View are:

0x00000000010414000000948BF792E41D5CC05C33EE7D2BE8734050A0846E32265CC05C33EE7D2BE87340948BF792E41D5CC0D1FE5BCF08ED7340948BF792E41D5CC07C237AF479FE73402591E2A2A9315CC041EE796EF6F97340C5C68FC4895B5DC041EE796EF6F97340580354DAFE695DC04C2CE4CE51FE7340580354DAFE695DC0D1FE5BCF08ED7340E0912AD7E95E5DC05C33EE7D2BE87340580354DAFE695DC05C33EE7D2BE87340580354DAFE695DC016B1601D40B673400A158B6DD6625DC03D07F7F058B47340580354DAFE695DC0765D8DC471B27340580354DAFE695DC076F1B44C9C1C73402E840265A0275CC076F1B44C9C1C7340948BF792E41D5CC039D30FC7C01F7340948BF792E41D5CC0765D8DC471B27340E179C0FF0C255CC03D07F7F058B47340948BF792E41D5CC016B1601D40B67340948BF792E41D5CC05C33EE7D2BE8734001000000010000000001000000FFFFFFFF0000000002

0x00000000010413000000583D8A66C9A15CC0B2C78CACD3217440583D8A66C9A15CC0A3998C3BCA2774403CE8272D26975CC0A3998C3BCA277440675FA51FEF9F5CC0BD97CFBA682C7440580354DAFE695DC0BD97CFBA682C7440580354DAFE695DC0F0F027675D1B7440580354DAFE695DC004DF32F4C6127440CC72AD7936685DC0B74DDB44D10E7440580354DAFE695DC0B74DDB44D10E7440580354DAFE695DC04C2CE4CE51FE7340C5C68FC4895B5DC041EE796EF6F973402591E2A2A9315CC041EE796EF6F97340948BF792E41D5CC07C237AF479FE7340BBDDD3F715195CC0B99829EC92FF7340A2955F788E0B5CC09E4A22B2A90274400A36B82DB01A5CC09E4A22B2A90274400A36B82DB01A5CC0E75E49324107744097BEF5E5100A5CC0E75E493241077440583D8A66C9A15CC0B2C78CACD321744001000000010000000001000000FFFFFFFF0000000002

I can get WFS formats from the layer preview. For example GeoJSON:

{"type":"FeatureCollection","features":[{"type":"Feature","id":"Testview.DDBF6CB6-753B-E011-B376-001AA0D73D69","geometry":{"type":"LineString","coordinates":[[-112.46707606,318.51061814],[-112.59682811,318.51061814],[-112.46707606,318.81465088],[-112.46707606,319.90477417],[-112.77597878,319.62266395],[-117.43028368,319.62266395],[-117.65617998,319.8949727],[-117.65617998,318.81465088],[-117.48302249,318.51061814],[-117.65617998,318.51061814],[-117.65617998,315.39065302],[-117.54433764,315.27171418],[-117.65617998,315.15277534],[-117.65617998,305.78815909],[-112.61916471,305.78815909],[-112.46707606,305.98456484],[-112.46707606,315.15277534],[-112.5789184,315.27171418],[-112.46707606,315.39065302],[-112.46707606,318.51061814]]},"geometry_name":"GeoData","properties":{}},{"type":"Feature","id":"Testview.DEBF6CB6-753B-E011-B376-001AA0D73D69","geometry":{"type":"LineString","coordinates":[[-114.52791751,322.11417823],[-114.52791751,322.4868732],[-114.3617051,322.4868732],[-114.49896995,322.77556878],[-117.65617998,322.77556878],[-117.65617998,321.71030346],[-117.65617998,321.17357273],[-117.62832491,320.92609106],[-117.65617998,320.92609106],[-117.65617998,319.8949727],[-117.43028368,319.62266395],[-112.77597878,319.62266395],[-112.46707606,319.90477417],[-112.39196582,319.97336975],[-112.18057069,320.16642965],[-112.41700309,320.16642965],[-112.41700309,320.4534171],[-112.15728139,320.4534171],[-114.52791751,322.11417823]]},"geometry_name":"GeoData","properties":{}}],"totalFeatures":2,"numberMatched":2,"numberReturned":2,"timeStamp":"2020-08-19T16:35:00.494Z","crs":{"type":"name","properties":{"name":"urn:ogc:def:crs:EPSG::4326"}}}
Best regards
Jonas

sql server.png

Testview.png

Those coordinates look very odd for lat/lon - (-112.46707606,318.51061814) is not going to fall on the Earth’s surface, is there perhaps a problem with the coordinate reference system you have set?

Ian

···

Ian Turton