private bool IsBuildingOnCity(GeoObject data, GeoObject street) { if (data.GeocoderMetaData.Kind == GeoObjectKind.Locality || data.GeocoderMetaData.Kind == GeoObjectKind.House) { if (!string.IsNullOrEmpty(data.ToString()) && data.GeocoderMetaData.Address.Locality == street.GeocoderMetaData.Address.Locality && data.GeocoderMetaData.Address.Province == street.GeocoderMetaData.Address.Province && data.GeocoderMetaData.Address?.Street == street.GeocoderMetaData.Address.Street) { return(true); } } return(false); }
private bool IsStreetInCity(GeoObject data, GeoObject city) { if (data.GeocoderMetaData.Kind == GeoObjectKind.Street && !string.IsNullOrEmpty(data.ToString()) && data.GeocoderMetaData.Address.Locality == city.GeocoderMetaData.Address.Locality && data.GeocoderMetaData.Address.Province == city.GeocoderMetaData.Address.Province) { return(true); } return(false); }