Hi Ethan.
I could get the meter/pixel ration from OpenLayers, but the spatial queries are not working well.
Here is what I’ve got:
// Create Layer
var proj4 = new Proj4Projection(
Proj4Projection.GetDecimalDegreesParametersString(),
Proj4Projection.GetSphericalMercatorParametersString()
);
if(!proj4.IsOpen) proj4.Open();
var feature = new Feature(new PointShape(-108.558944, 45.149776));
var memoryLayer = new InMemoryFeatureLayer(new List<FeatureSourceColumn>(), new List<Feature>() { feature });
if (!memoryLayer.IsOpen) memoryLayer.Open();
memoryLayer.FeatureSource.Projection = proj4;
memoryLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle = new PointStyle(PointSymbolType.Circle, new GeoSolidBrush(GeoColor.StandardColors.Green), new GeoPen(GeoColor.StandardColors.Red, 5), 20);
memoryLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
// Create Click Feature
var clickLongitude = -108.558944;
var clickLatitude = 45.149776;
var clickRadiusInMeter = 1000;
var click = new PointShape(clickLongitude, clickLatitude);
var clickFeature = new EllipseShape(click, clickRadiusInMeter, GeographyUnit.DecimalDegree, DistanceUnit.Meter);
// Get Features Inside Click Area
var featuresContaining = memoryLayer.QueryTools.GetFeaturesContaining(clickFeature, ReturningColumnsType.AllColumns);
var featuresWithinDistance = memoryLayer.QueryTools.GetFeaturesWithinDistanceOf(clickFeature, GeographyUnit.DecimalDegree, DistanceUnit.Meter, 1000, ReturningColumnsType.AllColumns);
var featuresCrossing = memoryLayer.QueryTools.GetFeaturesCrossing(clickFeature, ReturningColumnsType.AllColumns);
var featuresIntersecting = memoryLayer.QueryTools.GetFeaturesIntersecting(clickFeature, ReturningColumnsType.AllColumns);
If you run the code above, no features are returned in any query. I wonder what I’m missing.