I am developing an application that implements DDD and repository template, as shown in the figure below:

I expect my domain level to be unstable, so I would not want to install entity libraries there. The only problem I am facing is that my application uses spatial data, but I should not use DbGeography as a property type of my objects, as soon as it belongs to the System.Data.Entity.Spatial namespace from the EntityFramework assembly.
Is there a way to create a class to store latitude, longitude, and height values in a domain layer, for example:
public class Location { public double Latitude { get; set; } public double Longitude { get; set; } public double Elevation { get; set; } }
and then convert this class to DbGeography at my repository level?
In other words, domain objects will only have the Location class as a property:
public class Place : IEntityBase, ILocalizable { public int Id { get; set; } public string Name { get; set; } public Location Location { get; set; } public User Owner { get; set; } }
and I would convert it to DbGegraphy to save spatial data and do some calculations only in the repository layer. My plans are to try something similar for conversion:
public class LocationMap : ComplexTypeConfiguration<Location> { public LocationMap() { Property(l => DbGeography.FromText(string.Format("POINT({0} {1})", l.Longitude, l.Latitude))).HasColumnName("Location"); Ignore(l => l.Elevation); Ignore(l => l.Latitude); Ignore(l => l.Longitude); } }
But it does not work and never will be. How can I solve this problem? What are the best practices in this situation?
thanks