This may be going outside of the scope for many users however it might be a challange for someone to work out if this is at all possible. So I thought Id throw it up and see what I get back from the community.
I have been sold on using petapoco as an ORM for Umbraco, MVC solution as it seems fast, simple and easy to use. However I've come up a bit of a caveat. Cant quite get Spatial data types mapping correctly.
When I take a look at the petapoco.cs file withinn umbraco 7.2.2 source I see that it appears to have limited support for types DBgeometry, DBGeography with use for SQLServer.
So why cannot I create a table including DBgeometry CLR and why does it not map on table creation.
It looks like it has something to do with umbracos implementation of petapoco. I beleive I will have to modfiy the umbraco souce to add a mapper but need some guidance on this....Cheers guys
I dont want to have to change to entityframework at this stage. Plus with all the mapping these days thought we should be able to utilize spatial datatypes for storage of polygons etc for GEOJSON output. Seems logical..?
StackTrace is as follows
{
Line 44: //Create DB table - and set overwrite to false
Line 45: db.CreateTable
Just to update I have checked the umbraco source and petapoco.cs contains the updates as mentioned by John in the aforementioned post. But from the look of this umbraco itself may be the issue?
I don't kow whether mapping to spatial datatypes is possible or not with Petapoco, but as a workaround how about you map your types to doubles? Then you can create a System.Spatial.GeographyPoint class from the latitude and longitude doube coordinates.
I would not consider bringing Entity Framework to the game at all, since Petapoco is much more lightweight and faster, not to mention Umbraco is built around Petapoco mini ORM.
I could However as I intend on storing Polygons; which *can contain multiple if no many Points, I thought this would get rather messy from a database perspective. I just dont understand why Petapoco with Umbraco doesnt have support for this. Hopefully someone can tell me more on why. Its just makes for a much more cleaner solution.
OK.. looks like it fails on table creation within registerevents.cs, It works on create :) but then fails again on Read with the following error...Exception Details: returns null
The spatial data you could store in the examine / lucene index and query on it using lucene spatial contrib package, if you dig around on our.umbraco it has been done a good article on lucene and spatial here https://www.leapinggorilla.com/Blog/Read/1010/spatial-search-in-lucenenet---worked-example. The only thing to be aware of is the spatial data was properties on umbraco nodes, I am assuming you have another data source of spatial data that you are trying to push into sql server?
Spatial Datatypes, Petapoco and umbraco.
Hey guys,
This may be going outside of the scope for many users however it might be a challange for someone to work out if this is at all possible. So I thought Id throw it up and see what I get back from the community.
I have been sold on using petapoco as an ORM for Umbraco, MVC solution as it seems fast, simple and easy to use. However I've come up a bit of a caveat. Cant quite get Spatial data types mapping correctly.
When I take a look at the petapoco.cs file withinn umbraco 7.2.2 source I see that it appears to have limited support for types DBgeometry, DBGeography with use for SQLServer.
So why cannot I create a table including DBgeometry CLR and why does it not map on table creation.
seems like the competetion has this half working http://john.katsiotis.com/blog/petapoco-and-spatial-data-types https://github.com/toptensoftware/PetaPoco/issues/181
It looks like it has something to do with umbracos implementation of petapoco. I beleive I will have to modfiy the umbraco souce to add a mapper but need some guidance on this....Cheers guys
I dont want to have to change to entityframework at this stage. Plus with all the mapping these days thought we should be able to utilize spatial datatypes for storage of polygons etc for GEOJSON output. Seems logical..?
StackTrace is as follows
{ Line 44: //Create DB table - and set overwrite to false Line 45: db.CreateTable
Just to update I have checked the umbraco source and petapoco.cs contains the updates as mentioned by John in the aforementioned post. But from the look of this umbraco itself may be the issue?
https://dnntracker.atlassian.net/browse/DNN-5140
Hi Matthew,
I don't kow whether mapping to spatial datatypes is possible or not with Petapoco, but as a workaround how about you map your types to doubles? Then you can create a System.Spatial.GeographyPoint class from the latitude and longitude doube coordinates.
I would not consider bringing Entity Framework to the game at all, since Petapoco is much more lightweight and faster, not to mention Umbraco is built around Petapoco mini ORM.
Cheers,
Peter
I could However as I intend on storing Polygons; which *can contain multiple if no many Points, I thought this would get rather messy from a database perspective. I just dont understand why Petapoco with Umbraco doesnt have support for this. Hopefully someone can tell me more on why. Its just makes for a much more cleaner solution.
OK.. looks like it fails on table creation within registerevents.cs, It works on create :) but then fails again on Read with the following error...Exception Details: returns null
Any ideas guys.
Matthew,
The spatial data you could store in the examine / lucene index and query on it using lucene spatial contrib package, if you dig around on our.umbraco it has been done a good article on lucene and spatial here https://www.leapinggorilla.com/Blog/Read/1010/spatial-search-in-lucenenet---worked-example. The only thing to be aware of is the spatial data was properties on umbraco nodes, I am assuming you have another data source of spatial data that you are trying to push into sql server?
Regards
Ismail
is working on a reply...