Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Umbraco: Storing spatial data

I'm researching Umbraco for use as a base in a large CMS project, however the project calls for the SQL Server 2008 database to store spatial data against content.

Being new to Umbraco I'm still reading through the documentation and slowly building up an idea of it's architecture. However so far it doesn't look like Umbraco supports the storage of spatial data.

There only appears to be four database datatype options: date, integer, ntext, nvarchar

Is it possible to store spatial data to the database?

Update: Futher research into how Umbraco works has showed me I was on the wrong track. It seems the way to do this is store the lat/long data in the data inside the usual XML format Umbraco uses.

Then to use the Spatial.net extensions that have been built on top of Lucene.net, rather than use the limited search capabilities Examine exposes.

However this is all still theoretical, I've just not been able to achieve this. If I do before someone answers this question, I'll post my findings here to help others.

like image 884
Peter Bridger Avatar asked Jun 21 '26 06:06

Peter Bridger


2 Answers

You could take a look at how to make user controls (with Visual Studio) in Umbraco.

It is also possible the versatility in Umbraco 'Document Types' is enough for you.

It is possible to extend Umbraco in any sort of way to get the solution you want. I don't know how you want the spatial data to interact with your frontend - so it is difficult to provide a direct solution.

like image 184
Lysgaard Avatar answered Jun 24 '26 03:06

Lysgaard


Although there are ways to store spatial data and perform queries against it using Spatial.net, it's not a very elegant solution.

Instead I've created an additional table in SQL Server 2008 with the geometry/geography datatype and a reference to the Umbraco content it's connected with.

I've then got a event hook which updates this whether content is added/updated/deleted.

like image 29
Peter Bridger Avatar answered Jun 24 '26 05:06

Peter Bridger



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!