Select to view content in your preferred language

SQL View to sanitize geometrycollections

1242
3
Jump to solution
05-16-2017 08:09 AM
AdrianMarsden
Regular Contributor II

Hi


We've a third party spatial application that writes into native T-SQL tables.  It is happy with records like this;

GEOMETRYCOLLECTION (LINESTRING (315271.762 90124.145, 315271.812 90124.195), POLYGON ((315276.18 90120.38, 315275.05 90111.07, 315280.15 90110.42, 315279.36 90103.58, 315271.65 90104.25, 315267.35 90104.62, 315267.319 90104.625, 315267.681 90107.209, 315268.95 90117.12, 315272.94 90116.62, 315273.32 90118.96, 315270.73 90119.4, 315270.91 90120.92, 315271.36 90124.08, 315276.432 90123.633, 315276.18 90120.38)))

Anyone who has only ever used Esri products will, like me, be twitching at this mixing up stuff in a single record.

Anyone have any SQL views or procedures to sanitize these records into a format that sane GIS products can cope with?

Cheers


ACM

0 Kudos
1 Solution
3 Replies
AdrianMarsden
Regular Contributor II

Odd - i tried that yesterday, but gave up when the results looked like "0x346......." rather than "POLYGON(1234,.....)

But I saved the view and flung it at ArcMap and it worked.

Thanks

0 Kudos
JoshuaBixby
MVP Esteemed Contributor
0 Kudos