public static LayerGeoJson GetTransectLineLayerGeoJson(this OnlandVisualTrashAssessment onlandVisualTrashAssessment)
        {
            LayerGeoJson transsectLineLayerGeoJson;

            if (onlandVisualTrashAssessment.OnlandVisualTrashAssessmentArea?.TransectLine != null)
            {
                transsectLineLayerGeoJson = onlandVisualTrashAssessment.OnlandVisualTrashAssessmentArea
                                            .GetTransectLineLayerGeoJson();
            }
            else
            {
                var featureCollection = new FeatureCollection();
                var dbGeometry        = onlandVisualTrashAssessment.GetTransect();
                if (dbGeometry == null)
                {
                    return(null);
                }

                var feature = DbGeometryToGeoJsonHelper.FromDbGeometryWithReprojectionCheck(dbGeometry.ToSqlGeometry().MakeValid().ToDbGeometry());
                featureCollection.Features.AddRange(new List <Feature> {
                    feature
                });

                transsectLineLayerGeoJson = new LayerGeoJson("transectLine", featureCollection, "#000000",
                                                             1,
                                                             LayerInitialVisibility.Show);
            }

            return(transsectLineLayerGeoJson);
        }
        public static IQueryable <Parcel> GetParcelsViaTransect(this OnlandVisualTrashAssessment ovta)
        {
            if (!ovta.OnlandVisualTrashAssessmentObservations.Any())
            {
                return(new List <Parcel>().AsQueryable());
            }

            var transect = ovta.OnlandVisualTrashAssessmentObservations.Count == 1
                ? ovta.OnlandVisualTrashAssessmentObservations.Single().LocationPoint // don't attempt to calculate the transect
                : ovta.GetTransect();

            return(HttpRequestStorage.DatabaseEntities.Parcels.Where(x => x.ParcelGeometry.Intersects(transect)));
        }